Skip to content

Commit

Permalink
More tests for saving shops
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Jul 8, 2015
1 parent 59f6071 commit f435be2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/junk/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This folder is just here to dump temporary output files from the test cases.
12 changes: 12 additions & 0 deletions test/scen_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,20 @@ TEST_CASE("Saving a scenario record") {
in_and_out("shops", scen);
REQUIRE(scen.shops.size() == 3);
REQUIRE(scen.shops[0].size() == 10);
CHECK(scen.shops[0].getName() == "Magic Shop");
CHECK(scen.shops[0].getType() == eShopType::RANDOM);
CHECK(scen.shops[0].getPrompt() == eShopPrompt::SHOPPING);
CHECK(scen.shops[0].getFace() == 0);
CHECK(scen.shops[0].getItem(0).type == eShopItemType::TREASURE);
CHECK(scen.shops[0].getItem(0).item.item_level == 1);
CHECK(scen.shops[0].getItem(4).item.item_level == 2);
CHECK(scen.shops[0].getItem(7).item.item_level == 3);
CHECK(scen.shops[0].getItem(9).item.item_level == 4);
REQUIRE(scen.shops[1].size() == 9);
CHECK(scen.shops[1].getName() == "Healing");
CHECK(scen.shops[1].getType() == eShopType::ALLOW_DEAD);
CHECK(scen.shops[1].getPrompt() == eShopPrompt::HEALING);
CHECK(scen.shops[1].getFace() == 41);
CHECK(scen.shops[1].getItem(0).type == eShopItemType::HEAL_WOUNDS);
CHECK(scen.shops[1].getItem(1).type == eShopItemType::CURE_POISON);
CHECK(scen.shops[1].getItem(2).type == eShopItemType::CURE_DISEASE);
Expand All @@ -208,6 +216,10 @@ TEST_CASE("Saving a scenario record") {
CHECK(scen.shops[1].getItem(7).type == eShopItemType::RAISE_DEAD);
CHECK(scen.shops[1].getItem(8).type == eShopItemType::RESURRECT);
REQUIRE(scen.shops[2].size() == 12);
CHECK(scen.shops[2].getName() == "The Test Shop");
CHECK(scen.shops[2].getType() == eShopType::NORMAL);
CHECK(scen.shops[2].getPrompt() == eShopPrompt::SHOPPING);
CHECK(scen.shops[2].getFace() == 17);
CHECK(scen.shops[2].getItem(0).type == eShopItemType::ITEM);
CHECK(scen.shops[2].getItem(0).index == 1);
CHECK(scen.shops[2].getItem(0).quantity == 0);
Expand Down

0 comments on commit f435be2

Please sign in to comment.