d05 ex03 handle weird request as long as they contains form name

This commit is contained in:
Hugo LAMY
2022-03-17 12:01:13 +01:00
parent 5f090531bc
commit e76d67dec7
5 changed files with 50 additions and 28 deletions

View File

@@ -142,39 +142,49 @@ int main() {
AForm * f2;
AForm * f3;
AForm * f4;
AForm * f5;
std::cout << B_BLUE "intern tries to create a Shrubbery form" RESET "\n";
std::cout << B_BLUE "\nintern tries to create a Shrubbery form" RESET "\n";
f1 = i.makeForm("Shrubbery", "smoking");
if (f1)
std::cout << *f1 << '\n';
else
std::cout << "intern make an error and cannot create the form\n";
std::cout << "intern makes an error and cannot create the form\n";
std::cout << B_BLUE "\nintern tries to create a Robotomy form" RESET "\n";
f2 = i.makeForm("Robotomy", "building");
if (f2)
std::cout << *f2 << '\n';
else
std::cout << "intern make an error and cannot create the form\n";
std::cout << "intern makes an error and cannot create the form\n";
std::cout << B_BLUE "\nintern tries to create a Presidential form" RESET "\n";
f3 = i.makeForm("Presidential", "building");
if (f3)
std::cout << *f3 << '\n';
else
std::cout << "intern make an error and cannot create the form\n";
std::cout << "intern makes an error and cannot create the form\n";
std::cout << B_BLUE "\nintern tries to create a blueberry form" RESET "\n";
f4 = i.makeForm("blueberry", "giv_me_gold");
if (f4)
std::cout << *f4 << '\n';
else
std::cout << "intern make an error and cannot create the form\n";
std::cout << "intern makes an error and cannot create the form\n";
std::cout << B_BLUE "\nintern tries to create a \"robotomy request\" form" RESET "\n";
f5 = i.makeForm("robotomy request", "try_hard");
if (f5)
std::cout << *f5 << '\n';
else
std::cout << "intern makes an error and cannot create the form\n";
std::cout << '\n';
delete f1;
delete f2;
delete f3;
delete f4;
delete f5;
}
std::cout << "\n";