d04 check leaks and error ok

This commit is contained in:
hugogogo
2022-03-14 18:18:45 +01:00
parent aa6f1c9928
commit 277f92ac93
21 changed files with 22 additions and 307 deletions

View File

@@ -12,7 +12,7 @@ Cat::Cat() {
return;
}
Cat::Cat( Cat const & src ) {
Cat::Cat( Cat const & src ) : Animal(src) {
std::cout << COPLIEN_COLOR "Cat copy constructor" RESET "\n";
*this = src;
return;

View File

@@ -12,7 +12,7 @@ Dog::Dog() {
return;
}
Dog::Dog( Dog const & src ) {
Dog::Dog( Dog const & src ) : Animal(src) {
std::cout << COPLIEN_COLOR "Dog copy constructor" RESET "\n";
*this = src;
return;

View File

@@ -72,6 +72,9 @@ $(OBJS): $(HEADERS:%=$(D_HEADERS)/%)
$(NAME): $(OBJS)
$(CC) $(OBJS) -o $@ $(LIBS)
leaks: $(NAME)
valgrind --leak-check=full --show-leak-kinds=all ./$(NAME)
clean:
$(RM_OBJS)

View File

@@ -12,7 +12,7 @@ WrongCat::WrongCat() {
return;
}
WrongCat::WrongCat( WrongCat const & src ) {
WrongCat::WrongCat( WrongCat const & src ) : WrongAnimal(src) {
std::cout << COPLIEN_COLOR "WrongCat copy constructor" RESET "\n";
*this = src;
return;