ajout ex03 et correction dump core
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "RobotomyRequestForm.hpp"
|
||||
#include "PresidentialPardonForm.hpp"
|
||||
|
||||
#define N_TEST "7"
|
||||
#define N_TEST "9"
|
||||
|
||||
int main() {
|
||||
int i = 0;
|
||||
@@ -71,6 +71,26 @@ int main() {
|
||||
std::cout << s2 << "\n";
|
||||
}
|
||||
|
||||
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
|
||||
<< "Presidential copy test :" RESET "\n";
|
||||
{
|
||||
PresidentialPardonForm p1("turnips");
|
||||
PresidentialPardonForm p2(p1);
|
||||
|
||||
std::cout << p1 << "\n";
|
||||
std::cout << p2 << "\n";
|
||||
}
|
||||
|
||||
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
|
||||
<< "Robotomy copy test :" RESET "\n";
|
||||
{
|
||||
RobotomyRequestForm r1("artichokes");
|
||||
RobotomyRequestForm r2(r1);
|
||||
|
||||
std::cout << r1 << "\n";
|
||||
std::cout << r2 << "\n";
|
||||
}
|
||||
|
||||
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
|
||||
<< "Robotomy :" RESET "\n";
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ PresidentialPardonForm::PresidentialPardonForm( std::string target )
|
||||
}
|
||||
|
||||
PresidentialPardonForm::PresidentialPardonForm( PresidentialPardonForm const & src )
|
||||
: AForm("presidential_creation", this->getTarget(), 25, 5) {
|
||||
: AForm("presidential_creation", src.getTarget(), 25, 5) {
|
||||
std::cout << COPLIEN_COLOR "RobotomyRequestForm copy constructor" RESET "\n";
|
||||
*this = src;
|
||||
return;
|
||||
|
||||
@@ -13,7 +13,7 @@ RobotomyRequestForm::RobotomyRequestForm( std::string target )
|
||||
}
|
||||
|
||||
RobotomyRequestForm::RobotomyRequestForm( RobotomyRequestForm const & src )
|
||||
: AForm("robotomy_creation", this->getTarget(), 72, 45) {
|
||||
: AForm("robotomy_creation", src.getTarget(), 72, 45) {
|
||||
std::cout << COPLIEN_COLOR "RobotomyRequestForm copy constructor" RESET "\n";
|
||||
*this = src;
|
||||
return;
|
||||
|
||||
@@ -13,7 +13,7 @@ ShrubberyCreationForm::ShrubberyCreationForm( std::string target )
|
||||
}
|
||||
|
||||
ShrubberyCreationForm::ShrubberyCreationForm( ShrubberyCreationForm const & src )
|
||||
: AForm("shrubbery_creation", this->getTarget(), 145, 137) {
|
||||
: AForm("shrubbery_creation", src.getTarget(), 145, 137) {
|
||||
std::cout << COPLIEN_COLOR "ShrubberyCreationForm copy constructor" RESET "\n";
|
||||
*this = src;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user