From 766853d7a425eab333d8e6d689a13615b82f793b Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 11 Apr 2017 20:42:25 -0400 Subject: [PATCH] Fix unit tests --- test/catch.cpp | 2 ++ test/scen_write.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/catch.cpp b/test/catch.cpp index c4ebda42..1dbc5815 100644 --- a/test/catch.cpp +++ b/test/catch.cpp @@ -12,7 +12,9 @@ cUniverse univ; // And these are referenced from the scenario code, though not used in test cases #include "scenario.hpp" +#include "undo.hpp" location cur_out; short cur_town; cScenario scenario; bool change_made; +cUndoList undo_list; diff --git a/test/scen_write.cpp b/test/scen_write.cpp index fe5d2bde..9cb7d115 100644 --- a/test/scen_write.cpp +++ b/test/scen_write.cpp @@ -250,7 +250,7 @@ TEST_CASE("Saving a scenario record") { CHECK(scen.shops[2].getItem(11).item.desc == "This is magic!"); ResMgr::popPath(); } - 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[3] = "Hello 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.intro_strs[4] = "Another intro string!"; 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[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.intro_strs[4] == "Another intro string!"); }