Fix unit tests

This commit is contained in:
2017-04-11 20:42:25 -04:00
parent 945a7a9e5a
commit 766853d7a4
2 changed files with 5 additions and 3 deletions

View File

@@ -12,7 +12,9 @@ cUniverse univ;
// And these are referenced from the scenario code, though not used in test cases // And these are referenced from the scenario code, though not used in test cases
#include "scenario.hpp" #include "scenario.hpp"
#include "undo.hpp"
location cur_out; location cur_out;
short cur_town; short cur_town;
cScenario scenario; cScenario scenario;
bool change_made; bool change_made;
cUndoList undo_list;

View File

@@ -250,7 +250,7 @@ TEST_CASE("Saving a scenario record") {
CHECK(scen.shops[2].getItem(11).item.desc == "This is magic!"); CHECK(scen.shops[2].getItem(11).item.desc == "This is magic!");
ResMgr::popPath<StringRsrc>(); ResMgr::popPath<StringRsrc>();
} }
SECTION("With some empty strings, only trailing ones are stripped") { SECTION("With some empty strings, none are stripped") {
scen.spec_strs.resize(12); scen.spec_strs.resize(12);
scen.spec_strs[3] = "Hello World!"; scen.spec_strs[3] = "Hello World!";
scen.spec_strs[9] = "Goodbye World!"; scen.spec_strs[9] = "Goodbye World!";
@@ -258,10 +258,10 @@ TEST_CASE("Saving a scenario record") {
scen.journal_strs[7] = "My best journal!"; scen.journal_strs[7] = "My best journal!";
scen.intro_strs[4] = "Another intro string!"; scen.intro_strs[4] = "Another intro string!";
in_and_out("empty strings", scen); in_and_out("empty strings", scen);
REQUIRE(scen.spec_strs.size() == 10); REQUIRE(scen.spec_strs.size() == 12);
CHECK(scen.spec_strs[3] == "Hello World!"); CHECK(scen.spec_strs[3] == "Hello World!");
CHECK(scen.spec_strs[9] == "Goodbye World!"); CHECK(scen.spec_strs[9] == "Goodbye World!");
REQUIRE(scen.journal_strs.size() == 8); REQUIRE(scen.journal_strs.size() == 19);
CHECK(scen.journal_strs[7] == "My best journal!"); CHECK(scen.journal_strs[7] == "My best journal!");
CHECK(scen.intro_strs[4] == "Another intro string!"); CHECK(scen.intro_strs[4] == "Another intro string!");
} }