diff --git a/tests/dCommonTests/ZoneFileTests.cpp b/tests/dCommonTests/ZoneFileTests.cpp index ed42cd0b7..78f8f4114 100644 --- a/tests/dCommonTests/ZoneFileTests.cpp +++ b/tests/dCommonTests/ZoneFileTests.cpp @@ -101,22 +101,18 @@ TEST(ZoneFileTests, ReadsScenesAndPaths) { } // Boundary lines sit between the scenes and the terrain file's name -// A waypoint keeps every name / value pair as the file has it, in order, also the ones that are no waypoint command +// A waypoint keeps every name / value pair as the file has it, in order (names with their spaces), also on a +// spawner path, whose pairs are LDF config TEST(ZoneFileTests, WaypointsKeepTheirActions) { - ZoneBytes w; - w.Put(3).Wide("PlayAim").Wide("idle").Wide("de lay").Wide(" 2 ").Wide("spawner_node_id").Wide("1:4"); - std::istringstream file(w.data); - PathWaypoint waypoint; - ASSERT_TRUE(ZoneFile::ReadLdfConfig(file, PathType::MovingPlatform, waypoint)); - const std::vector> expected{ { "PlayAim", "idle" }, { "de lay", " 2 " }, { "spawner_node_id", "1:4" } }; - EXPECT_EQ(waypoint.actions, expected); - ASSERT_EQ(waypoint.commands.size(), 1u); - EXPECT_EQ(waypoint.commands[0].data, "2"); - - std::istringstream again(w.data); - PathWaypoint spawner; - ASSERT_TRUE(ZoneFile::ReadLdfConfig(again, PathType::Spawner, spawner)); - EXPECT_EQ(spawner.actions, expected); + std::istringstream stream(SampleZone()); + ZoneFile zone; + zone.Read(stream); + ASSERT_EQ(zone.paths.size(), 3u); + const std::vector> patrol{ { "de lay", " 2 " } }; + EXPECT_EQ(zone.paths[0].pathWaypoints.at(0).actions, patrol); + const std::vector> spawner{ { "spawner_node_id", "1:4" } }; + EXPECT_EQ(zone.paths[1].pathWaypoints.at(0).actions, spawner); + EXPECT_TRUE(zone.paths[2].pathWaypoints.at(0).actions.empty()); } TEST(ZoneFileTests, ReadsZoneBoundaries) { diff --git a/tests/dGameTests/dComponentsTests/MovingPlatformComponentTests.cpp b/tests/dGameTests/dComponentsTests/MovingPlatformComponentTests.cpp index 7b2a59ba4..672c49f45 100644 --- a/tests/dGameTests/dComponentsTests/MovingPlatformComponentTests.cpp +++ b/tests/dGameTests/dComponentsTests/MovingPlatformComponentTests.cpp @@ -7,7 +7,6 @@ #include -#include "ScriptedActivityComponent.h" #include "BitStream.h" #include "CDClientDatabase.h" #include "Entity.h" @@ -20,6 +19,7 @@ #include "ai/MINIGAME/SG_GF/SERVER/SGCannon.h" #include "ai/MINIGAME/SG_GF/SERVER/SgTarget.h" #include "ScriptComponent.h" +#include "ScriptedActivityComponent.h" #include "SimplePhysicsComponent.h" #include "Zone.h" #include "dZoneManager.h"