summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-05-26 15:10:20 -0700
committerFuwn <[email protected]>2022-05-26 15:10:20 -0700
commite340db1e4036a2e738bd0efe48753f7259f65d93 (patch)
tree85a74e84e834c84aa51cb07c2ee517fe0ce7323e
parentformat(testPlatypus.cpp): grammar (diff)
downloadwk7_platypusproject-main.tar.xz
wk7_platypusproject-main.zip
feat(testPlatypus.cpp): comprehensive geMe testHEADmain
-rw-r--r--platypus/testPlatypus.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/platypus/testPlatypus.cpp b/platypus/testPlatypus.cpp
index 708a4ba..569da61 100644
--- a/platypus/testPlatypus.cpp
+++ b/platypus/testPlatypus.cpp
@@ -13,13 +13,17 @@ int main() {
// Test constructors
Platypus p1;
Platypus p2(23.5, 5, "Perry", "m");
+ Platypus p3(2, 3, "Pearl", "f");
std::cout << "Platypus #1 after birth(default constructor):\n" << std::endl;
// Test `print`
p1.print();
- cout << endl;
+ std::cout << "\nPlatypus #3 after birth(established constructor):\n"
+ << std::endl;
+
+ p3.print();
// Test setters
p1.setWeight(25.7f);
@@ -29,7 +33,7 @@ int main() {
p1.setAlive(true);
p1.setMutant(false);
- std::cout << "Platypus #1 after changes to weight, age, name, gender, "
+ std::cout << "\nPlatypus #1 after changes to weight, age, name, gender, "
"alive, mutant:\n"
<< std::endl;
@@ -41,17 +45,24 @@ int main() {
// Test `eat`ing
p1.eat();
- cout << "Platypus #1 weight after eating: " << p1.getWeight() << endl;
- cout << "\nPlatypus #1 before aging: " << p1.getAge()
+ cout << "Platypus #1 weight after eating: " << p1.getWeight()
+ << "\n\nPlatypus #1 before aging: " << p1.getAge()
<< ", old mutant status: " << p1.getMutant()
- << ", old alive status: " << p1.getAlive() << endl;
+ << ", old alive status: " << p1.getAlive()
+ << "\nPlatypus #3 before aging: " << p3.getAge()
+ << ", old mutant status: " << p3.getMutant()
+ << ", old alive status: " << p3.getAlive() << endl;
// Test aging
p1.ageMe();
+ p3.ageMe();
- cout << "Platypus #1 after aging: " << p1.getAge()
+ cout << "\nPlatypus #1 after aging: " << p1.getAge()
<< ", new mutant status: " << p1.getMutant()
- << ", new alive status: " << p1.getAlive() << endl
+ << ", new alive status: " << p1.getAlive() << '\n'
+ << "Platypus #3 after aging: " << p3.getAge()
+ << ", new mutant status: " << p3.getMutant()
+ << ", new alive status: " << p3.getAlive() << endl
<< endl;
}