fix unit tests

This commit is contained in:
2022-07-08 22:29:23 -04:00
parent 5b2561d034
commit df631f6c3c
4 changed files with 4 additions and 4 deletions

View File

@@ -724,7 +724,7 @@ std::ostream& operator<< (std::ostream& out, ePicType pic) {
}
std::istream& operator>> (std::istream& in, ePicType& pic) {
if(!readEnum(in, pic, pic_type_strs, PIC_NONE))
if(!readEnum(in, pic, pic_type_strs, NUM_PIC_TYPES))
in.setstate(std::ios::failbit);
return in;
}

View File

@@ -1685,7 +1685,7 @@ void readTownFromXml(ticpp::Document&& data, cTown*& town, cScenario& scen) {
if(num_timers >= 8)
throw xBadNode(type, elem->Row(), elem->Column(), fname);
readTimerFromXml(*elem, town->timers[num_timers]);
town->timers[num_timers].node_type = eSpecCtxType::SCEN;
town->timers[num_timers].node_type = eSpecCtxType::TOWN;
num_timers++;
} else if(type == "flags") {
Iterator<Element> flag;

View File

@@ -41,6 +41,6 @@
<default-ground>2</default-ground>
<last-out-section x="0" y="0" />
<last-town>0</last-town>
<graphics><pic index='1'>20</pic></graphics>
<graphics><pic index='1'>250</pic></graphics>
</editor>
</scenario>

View File

@@ -284,7 +284,7 @@ TEST_CASE("When converting legacy special nodes (general)") {
oldSpec.ex1a = 1;
newSpec.import_legacy(oldSpec);
CHECK(newSpec.type == eSpecType::CANT_ENTER);
CHECK(newSpec.ex1a == 1);
CHECK(newSpec.ex1a == 0);
CHECK(newSpec.ex2a == 0);
CHECK(newSpec.jumpto == 12);
}