diff --git a/test/unit-kami-agent.cc b/test/unit-kami-agent.cc index c89a8b7..ee4b5ba 100644 --- a/test/unit-kami-agent.cc +++ b/test/unit-kami-agent.cc @@ -34,17 +34,20 @@ using namespace kami; using namespace std; -class TestAgent : public Agent { +class TestAgent + : public Agent { public: AgentID step(shared_ptr model) override { return get_agent_id(); } }; -class TestModel : public Model { +class TestModel + : public Model { }; -class AgentTest : public ::testing::Test { +class AgentTest + : public ::testing::Test { protected: TestAgent agent_foo; TestAgent agent_bar; @@ -87,7 +90,10 @@ TEST_F(AgentTest, inequality) { EXPECT_FALSE(agent_bar != agent_bar); } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-agentid.cc b/test/unit-kami-agentid.cc index 7180d8c..31a5fbf 100644 --- a/test/unit-kami-agentid.cc +++ b/test/unit-kami-agentid.cc @@ -30,7 +30,8 @@ using namespace kami; -class AgentIDTest : public ::testing::Test { +class AgentIDTest + : public ::testing::Test { protected: AgentID agent_id_foo; AgentID agent_id_bar; @@ -62,7 +63,10 @@ TEST_F(AgentIDTest, ordering) { EXPECT_FALSE(agent_id_bar < agent_id_foo); } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-gridcoord1d.cc b/test/unit-kami-gridcoord1d.cc index 00a39b9..f77fe8b 100644 --- a/test/unit-kami-gridcoord1d.cc +++ b/test/unit-kami-gridcoord1d.cc @@ -30,7 +30,8 @@ using namespace kami; -class GridCoord1DTest : public ::testing::Test { +class GridCoord1DTest + : public ::testing::Test { protected: GridCoord1D gridcoord1d_foo = GridCoord1D(0); GridCoord1D gridcoord1d_bar = GridCoord1D(1); @@ -84,7 +85,10 @@ TEST_F(GridCoord1DTest, x) { EXPECT_FALSE(gridcoord1d_bar.x() == gridcoord1d_baz.x()); } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-gridcoord2d.cc b/test/unit-kami-gridcoord2d.cc index 16385e2..801fc74 100644 --- a/test/unit-kami-gridcoord2d.cc +++ b/test/unit-kami-gridcoord2d.cc @@ -30,7 +30,8 @@ using namespace kami; -class GridCoord2DTest : public ::testing::Test { +class GridCoord2DTest + : public ::testing::Test { protected: GridCoord2D gridcoord2d_foo = GridCoord2D(0, 0); GridCoord2D gridcoord2d_bar = GridCoord2D(1, 1); @@ -145,7 +146,10 @@ TEST_F(GridCoord2DTest, y) { EXPECT_FALSE(gridcoord2d_bar.y() == gridcoord2d_qu2.y()); } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-model.cc b/test/unit-kami-model.cc index 0afff59..77a0c1b 100644 --- a/test/unit-kami-model.cc +++ b/test/unit-kami-model.cc @@ -38,14 +38,16 @@ using namespace kami; using namespace kami::error; using namespace std; -class TestAgent : public Agent { +class TestAgent + : public Agent { public: AgentID step(shared_ptr model) override { return get_agent_id(); } }; -class TestModel : public Model { +class TestModel + : public Model { public: shared_ptr step() final { return shared_from_this(); @@ -127,7 +129,10 @@ TEST(Model, get_domain) { EXPECT_EQ(grid2_bar, grid2_baz); } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-multigrid1d.cc b/test/unit-kami-multigrid1d.cc index d6dbb70..efe1663 100644 --- a/test/unit-kami-multigrid1d.cc +++ b/test/unit-kami-multigrid1d.cc @@ -224,7 +224,9 @@ TEST(MultiGrid1D, get_neighborhood) { { MultiGrid1D multigrid1d_foo(10, true); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord9 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord9 + }); auto rval = multigrid1d_foo.get_neighborhood(coord0, true); EXPECT_EQ(tval, *rval); @@ -232,7 +234,9 @@ TEST(MultiGrid1D, get_neighborhood) { { MultiGrid1D multigrid1d_foo(10, true); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord2 + }); auto rval = multigrid1d_foo.get_neighborhood(coord1, true); EXPECT_EQ(tval, *rval); @@ -240,7 +244,9 @@ TEST(MultiGrid1D, get_neighborhood) { { MultiGrid1D multigrid1d_foo(10, false); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1 + }); auto rval = multigrid1d_foo.get_neighborhood(coord0, true); EXPECT_EQ(tval, *rval); @@ -248,7 +254,9 @@ TEST(MultiGrid1D, get_neighborhood) { { MultiGrid1D multigrid1d_foo(10, false); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord2 + }); auto rval = multigrid1d_foo.get_neighborhood(coord1, true); EXPECT_EQ(tval, *rval); @@ -256,7 +264,9 @@ TEST(MultiGrid1D, get_neighborhood) { { MultiGrid1D multigrid1d_foo(10, true); - auto tval = unordered_set < GridCoord1D > ({ coord1, coord9 }); + auto tval = unordered_set < GridCoord1D > ({ + coord1, coord9 + }); auto rval = multigrid1d_foo.get_neighborhood(coord0, false); EXPECT_EQ(tval, *rval); @@ -264,7 +274,9 @@ TEST(MultiGrid1D, get_neighborhood) { { MultiGrid1D multigrid1d_foo(10, true); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord2 + }); auto rval = multigrid1d_foo.get_neighborhood(coord1, false); EXPECT_EQ(tval, *rval); @@ -272,7 +284,9 @@ TEST(MultiGrid1D, get_neighborhood) { { MultiGrid1D multigrid1d_foo(10, false); - auto tval = unordered_set < GridCoord1D > ({ coord1 }); + auto tval = unordered_set < GridCoord1D > ({ + coord1 + }); auto rval = multigrid1d_foo.get_neighborhood(coord0, false); EXPECT_EQ(tval, *rval); @@ -280,7 +294,9 @@ TEST(MultiGrid1D, get_neighborhood) { { MultiGrid1D multigrid1d_foo(10, false); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord2 + }); auto rval = multigrid1d_foo.get_neighborhood(coord1, false); EXPECT_EQ(tval, *rval); @@ -288,14 +304,18 @@ TEST(MultiGrid1D, get_neighborhood) { { MultiGrid1D multigrid1d_foo(10, true); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord9 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord9 + }); EXPECT_THROW(auto rval = multigrid1d_foo.get_neighborhood(agent_id_foo, true), AgentNotFound); } { MultiGrid1D multigrid1d_foo(10, true); multigrid1d_foo.add_agent(agent_id_foo, coord0); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord9 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord9 + }); auto rval = multigrid1d_foo.get_neighborhood(agent_id_foo, true); EXPECT_EQ(tval, *rval); @@ -304,7 +324,9 @@ TEST(MultiGrid1D, get_neighborhood) { MultiGrid1D multigrid1d_foo(10, true); multigrid1d_foo.add_agent(agent_id_foo, coord1); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord2 + }); auto rval = multigrid1d_foo.get_neighborhood(agent_id_foo, true); EXPECT_EQ(tval, *rval); @@ -313,7 +335,9 @@ TEST(MultiGrid1D, get_neighborhood) { MultiGrid1D multigrid1d_foo(10, false); multigrid1d_foo.add_agent(agent_id_foo, coord0); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1 + }); auto rval = multigrid1d_foo.get_neighborhood(agent_id_foo, true); EXPECT_EQ(tval, *rval); @@ -322,7 +346,9 @@ TEST(MultiGrid1D, get_neighborhood) { MultiGrid1D multigrid1d_foo(10, false); multigrid1d_foo.add_agent(agent_id_foo, coord1); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord2 + }); auto rval = multigrid1d_foo.get_neighborhood(agent_id_foo, true); EXPECT_EQ(tval, *rval); @@ -331,7 +357,9 @@ TEST(MultiGrid1D, get_neighborhood) { MultiGrid1D multigrid1d_foo(10, true); multigrid1d_foo.add_agent(agent_id_foo, coord0); - auto tval = unordered_set < GridCoord1D > ({ coord1, coord9 }); + auto tval = unordered_set < GridCoord1D > ({ + coord1, coord9 + }); auto rval = multigrid1d_foo.get_neighborhood(agent_id_foo, false); EXPECT_EQ(tval, *rval); @@ -340,7 +368,9 @@ TEST(MultiGrid1D, get_neighborhood) { MultiGrid1D multigrid1d_foo(10, true); multigrid1d_foo.add_agent(agent_id_foo, coord1); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord2 + }); auto rval = multigrid1d_foo.get_neighborhood(agent_id_foo, false); EXPECT_EQ(tval, *rval); @@ -349,7 +379,9 @@ TEST(MultiGrid1D, get_neighborhood) { MultiGrid1D multigrid1d_foo(10, false); multigrid1d_foo.add_agent(agent_id_foo, coord0); - auto tval = unordered_set < GridCoord1D > ({ coord1 }); + auto tval = unordered_set < GridCoord1D > ({ + coord1 + }); auto rval = multigrid1d_foo.get_neighborhood(agent_id_foo, false); EXPECT_EQ(tval, *rval); @@ -358,7 +390,9 @@ TEST(MultiGrid1D, get_neighborhood) { MultiGrid1D multigrid1d_foo(10, false); multigrid1d_foo.add_agent(agent_id_foo, coord1); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord2 + }); auto rval = multigrid1d_foo.get_neighborhood(agent_id_foo, false); EXPECT_EQ(tval, *rval); @@ -407,7 +441,9 @@ TEST(MultiGrid1D, get_location_contents) { static_cast(multigrid1d_foo.add_agent(agent_id_bar, coord1)); static_cast(multigrid1d_foo.add_agent(agent_id_baz, coord1)); - auto tval = set < AgentID > ({ agent_id_foo, agent_id_bar, agent_id_baz }); + auto tval = set < AgentID > ({ + agent_id_foo, agent_id_bar, agent_id_baz + }); auto rval = multigrid1d_foo.get_location_contents(coord1); EXPECT_TRUE(rval); @@ -419,7 +455,9 @@ TEST(MultiGrid1D, get_location_contents) { static_cast(multigrid1d_foo.add_agent(agent_id_bar, coord1)); static_cast(multigrid1d_foo.add_agent(agent_id_baz, coord9)); - auto tval = set < AgentID > ({ agent_id_foo, agent_id_bar }); + auto tval = set < AgentID > ({ + agent_id_foo, agent_id_bar + }); auto rval = multigrid1d_foo.get_location_contents(coord1); EXPECT_TRUE(rval); @@ -427,7 +465,10 @@ TEST(MultiGrid1D, get_location_contents) { } } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-multigrid2d.cc b/test/unit-kami-multigrid2d.cc index 89d3bc0..8a1e464 100644 --- a/test/unit-kami-multigrid2d.cc +++ b/test/unit-kami-multigrid2d.cc @@ -226,12 +226,24 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { MultiGrid2D multigrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 0, 1 }, - { 9, 0 }, - { 0, 9 }, - { 1, 0 }, - { 0, 0 } + { + 0, 1 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 0, 9 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, true, GridNeighborhoodType::VonNeumann); @@ -242,11 +254,21 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { MultiGrid2D multigrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 1, 2 }, - { 2, 1 }, - { 1, 0 }, - { 0, 1 }, - { 1, 1 } + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord1, true, GridNeighborhoodType::VonNeumann); @@ -257,9 +279,15 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { MultiGrid2D multigrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 1, 0 }, - { 0, 0 } + { + 0, 1 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, true, GridNeighborhoodType::VonNeumann); @@ -270,11 +298,21 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { MultiGrid2D multigrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 2 }, - { 2, 1 }, - { 1, 0 }, - { 0, 1 }, - { 1, 1 } + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord1, true, GridNeighborhoodType::VonNeumann); @@ -285,10 +323,18 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { MultiGrid2D multigrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 }, - { 9, 0 }, - { 0, 9 } + { + 1, 0 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 0, 9 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::VonNeumann); @@ -299,10 +345,18 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { MultiGrid2D multigrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 }, - { 9, 0 }, - { 0, 9 } + { + 1, 0 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 0, 9 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::VonNeumann); @@ -313,8 +367,12 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { MultiGrid2D multigrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 } + { + 1, 0 + }, + { + 0, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::VonNeumann); @@ -325,8 +383,12 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { MultiGrid2D multigrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 } + { + 1, 0 + }, + { + 0, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::VonNeumann); @@ -336,17 +398,27 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { { MultiGrid2D multigrid2d_foo(10, 10, true, true); EXPECT_THROW(auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::VonNeumann), - AgentNotFound); + AgentNotFound); } { MultiGrid2D multigrid2d_foo(10, 10, true, true); multigrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 9, 0 }, - { 0, 9 }, - { 1, 0 }, - { 0, 0 } + { + 0, 1 + }, + { + 9, 0 + }, + { + 0, 9 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::VonNeumann); @@ -358,11 +430,21 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { multigrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 1, 2 }, - { 2, 1 }, - { 1, 0 }, - { 0, 1 }, - { 1, 1 } + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::VonNeumann); @@ -374,9 +456,15 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { multigrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 1, 0 }, - { 0, 0 } + { + 0, 1 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::VonNeumann); @@ -388,11 +476,21 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { multigrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 1, 2 }, - { 2, 1 }, - { 1, 0 }, - { 0, 1 }, - { 1, 1 } + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::VonNeumann); @@ -404,10 +502,18 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { multigrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 }, - { 9, 0 }, - { 0, 9 } + { + 1, 0 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 0, 9 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::VonNeumann); @@ -419,10 +525,18 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { multigrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 1, 2 }, - { 2, 1 }, - { 1, 0 } + { + 0, 1 + }, + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::VonNeumann); @@ -434,8 +548,12 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { multigrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 } + { + 1, 0 + }, + { + 0, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::VonNeumann); @@ -447,10 +565,18 @@ TEST(MultiGrid2D, get_neighborhood_VonNeumann) { multigrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 1, 2 }, - { 2, 1 }, - { 1, 0 } + { + 0, 1 + }, + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::VonNeumann); @@ -466,15 +592,34 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { { MultiGrid2D multigrid2d_foo(10, 10, true, true); - auto tval = unordered_set({{9, 9}, - {9, 1}, - { 1, 1 }, - { 0, 1 }, - { 9, 0 }, - { 1, 9 }, - { 0, 9 }, - { 1, 0 }, - { 0, 0 } + auto tval = unordered_set < GridCoord2D > ({ + { + 9, 9 + }, + { + 9, 1 + }, + { + 1, 1 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 1, 9 + }, + { + 0, 9 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, true, GridNeighborhoodType::Moore); @@ -485,15 +630,33 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { MultiGrid2D multigrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 }, - { 2, 0 }, - { 0, 1 }, - { 1, 1 } + { + 2, 2 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord1, true, GridNeighborhoodType::Moore); @@ -504,10 +667,18 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { MultiGrid2D multigrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 1 }, - { 0, 1 }, - { 1, 0 }, - { 0, 0 } + { + 1, 1 + }, + { + 0, 1 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, true, GridNeighborhoodType::Moore); @@ -518,15 +689,33 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { MultiGrid2D multigrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 }, - { 2, 0 }, - { 0, 1 }, - { 1, 1 } + { + 2, 2 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord1, true, GridNeighborhoodType::Moore); @@ -537,14 +726,30 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { MultiGrid2D multigrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 9, 9 }, - { 9, 1 }, - { 1, 0 }, - { 1, 1 }, - { 0, 1 }, - { 0, 9 }, - { 1, 9 }, - { 9, 0 } + { + 9, 9 + }, + { + 9, 1 + }, + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + }, + { + 0, 9 + }, + { + 1, 9 + }, + { + 9, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::Moore); @@ -555,14 +760,30 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { MultiGrid2D multigrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 9, 9 }, - { 9, 1 }, - { 1, 0 }, - { 1, 1 }, - { 0, 1 }, - { 0, 9 }, - { 1, 9 }, - { 9, 0 } + { + 9, 9 + }, + { + 9, 1 + }, + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + }, + { + 0, 9 + }, + { + 1, 9 + }, + { + 9, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::Moore); @@ -573,9 +794,15 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { MultiGrid2D multigrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 1, 1 }, - { 0, 1 } + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::Moore); @@ -586,9 +813,15 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { MultiGrid2D multigrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 1, 1 }, - { 0, 1 } + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::Moore); @@ -598,21 +831,39 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { { MultiGrid2D multigrid2d_foo(10, 10, true, true); EXPECT_THROW(auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::Moore), - AgentNotFound); + AgentNotFound); } { MultiGrid2D multigrid2d_foo(10, 10, true, true); multigrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 9, 9 }, - { 9, 1 }, - { 1, 1 }, - { 0, 1 }, - { 9, 0 }, - { 1, 9 }, - { 0, 9 }, - { 1, 0 }, - { 0, 0 } + { + 9, 9 + }, + { + 9, 1 + }, + { + 1, 1 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 1, 9 + }, + { + 0, 9 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::Moore); @@ -624,15 +875,33 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { multigrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 }, - { 2, 0 }, - { 0, 1 }, - { 1, 1 } + { + 2, 2 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::Moore); @@ -644,10 +913,18 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { multigrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 1, 1 }, - { 0, 1 }, - { 1, 0 }, - { 0, 0 } + { + 1, 1 + }, + { + 0, 1 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::Moore); @@ -659,15 +936,33 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { multigrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 }, - { 2, 0 }, - { 0, 1 }, - { 1, 1 } + { + 2, 2 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::Moore); @@ -679,14 +974,30 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { multigrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 9, 9 }, - { 9, 1 }, - { 1, 0 }, - { 1, 1 }, - { 0, 1 }, - { 0, 9 }, - { 1, 9 }, - { 9, 0 } + { + 9, 9 + }, + { + 9, 1 + }, + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + }, + { + 0, 9 + }, + { + 1, 9 + }, + { + 9, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::Moore); @@ -698,14 +1009,30 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { multigrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 2, 0 }, - { 0, 1 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 } + { + 2, 2 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::Moore); @@ -717,9 +1044,15 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { multigrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 1, 1 }, - { 0, 1 } + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::Moore); @@ -731,14 +1064,30 @@ TEST(MultiGrid2D, get_neighborhood_Moore) { multigrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 2, 0 }, - { 0, 1 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 } + { + 2, 2 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + } }); auto rval = multigrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::Moore); @@ -767,7 +1116,10 @@ TEST(MultiGrid2D, get_location_by_agent) { } } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-population.cc b/test/unit-kami-population.cc index 64c9171..f7a01c0 100644 --- a/test/unit-kami-population.cc +++ b/test/unit-kami-population.cc @@ -34,12 +34,15 @@ using namespace kami; using namespace kami::error; using namespace std; -class TestAgent : public Agent { +class TestAgent + : public Agent { private: int _x; public: - explicit TestAgent(int x) : _x(x) {}; + explicit TestAgent(int x) + :_x(x) { + }; AgentID step(shared_ptr model) override { return get_agent_id(); @@ -191,7 +194,10 @@ TEST(Population, get_agent_list) { } } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-position.cc b/test/unit-kami-position.cc index 1e87f4f..203d1ea 100644 --- a/test/unit-kami-position.cc +++ b/test/unit-kami-position.cc @@ -30,7 +30,8 @@ using namespace kami; -class PositionTest : public ::testing::Test { +class PositionTest + : public ::testing::Test { protected: Position pos_foo = GridCoord1D(5); Position pos_bar = GridCoord2D(2, 5); @@ -41,7 +42,10 @@ TEST_F(PositionTest, DefaultConstructor) { EXPECT_NE(pos_foo, pos_bar); } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-random.cc b/test/unit-kami-random.cc index 87f85f5..39a42c5 100644 --- a/test/unit-kami-random.cc +++ b/test/unit-kami-random.cc @@ -39,14 +39,16 @@ using namespace kami; using namespace std; -class TestAgent : public Agent { +class TestAgent + : public Agent { public: AgentID step(shared_ptr model) override { return get_agent_id(); } }; -class TestModel : public Model { +class TestModel + : public Model { public: shared_ptr> retval; @@ -61,7 +63,8 @@ class TestModel : public Model { } }; -class RandomSchedulerTest : public ::testing::Test { +class RandomSchedulerTest + : public ::testing::Test { protected: shared_ptr mod = nullptr; shared_ptr rng = nullptr; @@ -158,7 +161,10 @@ TEST_F(RandomSchedulerTest, set_rng) { EXPECT_NE(new_rng, rval1); } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-reporter.cc b/test/unit-kami-reporter.cc index d744e29..5dfabfe 100644 --- a/test/unit-kami-reporter.cc +++ b/test/unit-kami-reporter.cc @@ -39,7 +39,8 @@ using namespace kami; using namespace std; -class TestAgent : public ReporterAgent { +class TestAgent + : public ReporterAgent { public: AgentID step(shared_ptr model) override { return get_agent_id(); @@ -55,7 +56,8 @@ class TestAgent : public ReporterAgent { } }; -class TestModel : public ReporterModel { +class TestModel + : public ReporterModel { public: shared_ptr> retval; @@ -69,7 +71,8 @@ class TestModel : public ReporterModel { } }; -class ReporterModelTest : public ::testing::Test { +class ReporterModelTest + : public ::testing::Test { protected: shared_ptr mod = nullptr; @@ -117,10 +120,13 @@ TEST_F(ReporterModelTest, report) { auto rval = mod->report(); EXPECT_EQ(rval->dump(), - "[{\"agent_data\":[{\"agent_id\":\"13\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}},{\"agent_id\":\"14\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}},{\"agent_id\":\"15\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}}],\"model_data\":{\"fname\":\"Walter\",\"lname\":\"White\"},\"step_id\":1},{\"agent_data\":[{\"agent_id\":\"13\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}},{\"agent_id\":\"14\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}},{\"agent_id\":\"15\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}}],\"model_data\":{\"fname\":\"Walter\",\"lname\":\"White\"},\"step_id\":2}]"); + "[{\"agent_data\":[{\"agent_id\":\"13\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}},{\"agent_id\":\"14\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}},{\"agent_id\":\"15\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}}],\"model_data\":{\"fname\":\"Walter\",\"lname\":\"White\"},\"step_id\":1},{\"agent_data\":[{\"agent_id\":\"13\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}},{\"agent_id\":\"14\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}},{\"agent_id\":\"15\",\"data\":{\"fname\":\"Jesse\",\"lname\":\"Pinkman\"}}],\"model_data\":{\"fname\":\"Walter\",\"lname\":\"White\"},\"step_id\":2}]"); } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-reporteragent.cc b/test/unit-kami-reporteragent.cc index 7fa56fa..cf1b6a2 100644 --- a/test/unit-kami-reporteragent.cc +++ b/test/unit-kami-reporteragent.cc @@ -35,7 +35,8 @@ using namespace kami; using namespace std; -class TestAgent : public ReporterAgent { +class TestAgent + : public ReporterAgent { public: AgentID step(shared_ptr model) override { return get_agent_id(); @@ -51,14 +52,16 @@ class TestAgent : public ReporterAgent { } }; -class TestModel : public ReporterModel { +class TestModel + : public ReporterModel { public: std::unique_ptr collect() override { return std::make_unique(); } }; -class ReporterAgentTest : public ::testing::Test { +class ReporterAgentTest + : public ::testing::Test { protected: TestAgent agent_foo; TestAgent agent_bar; @@ -106,7 +109,10 @@ TEST_F(ReporterAgentTest, inequality) { EXPECT_FALSE(agent_bar != agent_bar); } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-sequential.cc b/test/unit-kami-sequential.cc index 17146bd..51debe7 100644 --- a/test/unit-kami-sequential.cc +++ b/test/unit-kami-sequential.cc @@ -37,14 +37,16 @@ using namespace kami; using namespace std; -class TestAgent : public Agent { +class TestAgent + : public Agent { public: AgentID step(shared_ptr model) override { return get_agent_id(); } }; -class TestModel : public Model { +class TestModel + : public Model { public: shared_ptr> retval; @@ -59,7 +61,8 @@ class TestModel : public Model { } }; -class SequentialSchedulerTest : public ::testing::Test { +class SequentialSchedulerTest + : public ::testing::Test { protected: shared_ptr mod = nullptr; @@ -127,7 +130,10 @@ TEST_F(SequentialSchedulerTest, step_10000) { } } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-sologrid1d.cc b/test/unit-kami-sologrid1d.cc index 9f17c94..4af15ee 100644 --- a/test/unit-kami-sologrid1d.cc +++ b/test/unit-kami-sologrid1d.cc @@ -222,7 +222,9 @@ TEST(SoloGrid1D, get_neighborhood) { { SoloGrid1D sologrid1d_foo(10, true); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord9 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord9 + }); auto rval = sologrid1d_foo.get_neighborhood(coord0, true); EXPECT_EQ(tval, *rval); @@ -230,7 +232,9 @@ TEST(SoloGrid1D, get_neighborhood) { { SoloGrid1D sologrid1d_foo(10, true); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord2 + }); auto rval = sologrid1d_foo.get_neighborhood(coord1, true); EXPECT_EQ(tval, *rval); @@ -238,7 +242,9 @@ TEST(SoloGrid1D, get_neighborhood) { { SoloGrid1D sologrid1d_foo(10, false); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1 + }); auto rval = sologrid1d_foo.get_neighborhood(coord0, true); EXPECT_EQ(tval, *rval); @@ -246,7 +252,9 @@ TEST(SoloGrid1D, get_neighborhood) { { SoloGrid1D sologrid1d_foo(10, false); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord2 + }); auto rval = sologrid1d_foo.get_neighborhood(coord1, true); EXPECT_EQ(tval, *rval); @@ -254,7 +262,9 @@ TEST(SoloGrid1D, get_neighborhood) { { SoloGrid1D sologrid1d_foo(10, true); - auto tval = unordered_set < GridCoord1D > ({ coord1, coord9 }); + auto tval = unordered_set < GridCoord1D > ({ + coord1, coord9 + }); auto rval = sologrid1d_foo.get_neighborhood(coord0, false); EXPECT_EQ(tval, *rval); @@ -262,7 +272,9 @@ TEST(SoloGrid1D, get_neighborhood) { { SoloGrid1D sologrid1d_foo(10, true); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord2 + }); auto rval = sologrid1d_foo.get_neighborhood(coord1, false); EXPECT_EQ(tval, *rval); @@ -270,7 +282,9 @@ TEST(SoloGrid1D, get_neighborhood) { { SoloGrid1D sologrid1d_foo(10, false); - auto tval = unordered_set < GridCoord1D > ({ coord1 }); + auto tval = unordered_set < GridCoord1D > ({ + coord1 + }); auto rval = sologrid1d_foo.get_neighborhood(coord0, false); EXPECT_EQ(tval, *rval); @@ -278,20 +292,26 @@ TEST(SoloGrid1D, get_neighborhood) { { SoloGrid1D sologrid1d_foo(10, false); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord2 + }); auto rval = sologrid1d_foo.get_neighborhood(coord1, false); EXPECT_EQ(tval, *rval); } { SoloGrid1D sologrid1d_foo(10, true); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord9 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord9 + }); EXPECT_THROW(auto rval = sologrid1d_foo.get_neighborhood(agent_id_foo, true), AgentNotFound); } { SoloGrid1D sologrid1d_foo(10, true); sologrid1d_foo.add_agent(agent_id_foo, coord0); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord9 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord9 + }); auto rval = sologrid1d_foo.get_neighborhood(agent_id_foo, true); EXPECT_EQ(tval, *rval); @@ -300,7 +320,9 @@ TEST(SoloGrid1D, get_neighborhood) { SoloGrid1D sologrid1d_foo(10, true); sologrid1d_foo.add_agent(agent_id_foo, coord1); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord2 + }); auto rval = sologrid1d_foo.get_neighborhood(agent_id_foo, true); EXPECT_EQ(tval, *rval); @@ -309,7 +331,9 @@ TEST(SoloGrid1D, get_neighborhood) { SoloGrid1D sologrid1d_foo(10, false); sologrid1d_foo.add_agent(agent_id_foo, coord0); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1 + }); auto rval = sologrid1d_foo.get_neighborhood(agent_id_foo, true); EXPECT_EQ(tval, *rval); @@ -318,7 +342,9 @@ TEST(SoloGrid1D, get_neighborhood) { SoloGrid1D sologrid1d_foo(10, false); sologrid1d_foo.add_agent(agent_id_foo, coord1); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord1, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord1, coord2 + }); auto rval = sologrid1d_foo.get_neighborhood(agent_id_foo, true); EXPECT_EQ(tval, *rval); @@ -327,7 +353,9 @@ TEST(SoloGrid1D, get_neighborhood) { SoloGrid1D sologrid1d_foo(10, true); sologrid1d_foo.add_agent(agent_id_foo, coord0); - auto tval = unordered_set < GridCoord1D > ({ coord1, coord9 }); + auto tval = unordered_set < GridCoord1D > ({ + coord1, coord9 + }); auto rval = sologrid1d_foo.get_neighborhood(agent_id_foo, false); EXPECT_EQ(tval, *rval); @@ -336,7 +364,9 @@ TEST(SoloGrid1D, get_neighborhood) { SoloGrid1D sologrid1d_foo(10, true); sologrid1d_foo.add_agent(agent_id_foo, coord1); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord2 + }); auto rval = sologrid1d_foo.get_neighborhood(agent_id_foo, false); EXPECT_EQ(tval, *rval); @@ -345,7 +375,9 @@ TEST(SoloGrid1D, get_neighborhood) { SoloGrid1D sologrid1d_foo(10, false); sologrid1d_foo.add_agent(agent_id_foo, coord0); - auto tval = unordered_set < GridCoord1D > ({ coord1 }); + auto tval = unordered_set < GridCoord1D > ({ + coord1 + }); auto rval = sologrid1d_foo.get_neighborhood(agent_id_foo, false); EXPECT_EQ(tval, *rval); @@ -354,7 +386,9 @@ TEST(SoloGrid1D, get_neighborhood) { SoloGrid1D sologrid1d_foo(10, false); sologrid1d_foo.add_agent(agent_id_foo, coord1); - auto tval = unordered_set < GridCoord1D > ({ coord0, coord2 }); + auto tval = unordered_set < GridCoord1D > ({ + coord0, coord2 + }); auto rval = sologrid1d_foo.get_neighborhood(agent_id_foo, false); EXPECT_EQ(tval, *rval); @@ -403,7 +437,9 @@ TEST(SoloGrid1D, get_location_contents) { EXPECT_THROW(static_cast(sologrid1d_foo.add_agent(agent_id_bar, coord1)), LocationUnavailable); EXPECT_THROW(static_cast(sologrid1d_foo.add_agent(agent_id_baz, coord1)), LocationUnavailable); - auto tval = set < AgentID > ({ agent_id_foo }); + auto tval = set < AgentID > ({ + agent_id_foo + }); auto rval = sologrid1d_foo.get_location_contents(coord1); EXPECT_TRUE(rval); @@ -415,7 +451,9 @@ TEST(SoloGrid1D, get_location_contents) { EXPECT_THROW(static_cast(sologrid1d_foo.add_agent(agent_id_bar, coord1)), LocationUnavailable); EXPECT_THROW(static_cast(sologrid1d_foo.add_agent(agent_id_baz, coord1)), LocationUnavailable); - auto tval = set < AgentID > ({ agent_id_foo }); + auto tval = set < AgentID > ({ + agent_id_foo + }); auto rval = sologrid1d_foo.get_location_contents(coord1); EXPECT_TRUE(rval); @@ -423,7 +461,10 @@ TEST(SoloGrid1D, get_location_contents) { } } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-sologrid2d.cc b/test/unit-kami-sologrid2d.cc index ff859de..68ff47b 100644 --- a/test/unit-kami-sologrid2d.cc +++ b/test/unit-kami-sologrid2d.cc @@ -219,12 +219,24 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { SoloGrid2D sologrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 0, 1 }, - { 9, 0 }, - { 0, 9 }, - { 1, 0 }, - { 0, 0 } + { + 0, 1 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 0, 9 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, true, GridNeighborhoodType::VonNeumann); @@ -234,11 +246,21 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { SoloGrid2D sologrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 1, 2 }, - { 2, 1 }, - { 1, 0 }, - { 0, 1 }, - { 1, 1 } + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord1, true, GridNeighborhoodType::VonNeumann); @@ -248,9 +270,15 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { SoloGrid2D sologrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 1, 0 }, - { 0, 0 } + { + 0, 1 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, true, GridNeighborhoodType::VonNeumann); @@ -260,11 +288,21 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { SoloGrid2D sologrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 2 }, - { 2, 1 }, - { 1, 0 }, - { 0, 1 }, - { 1, 1 } + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord1, true, GridNeighborhoodType::VonNeumann); @@ -274,10 +312,18 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { SoloGrid2D sologrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 }, - { 9, 0 }, - { 0, 9 } + { + 1, 0 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 0, 9 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::VonNeumann); @@ -287,10 +333,18 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { SoloGrid2D sologrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 }, - { 9, 0 }, - { 0, 9 } + { + 1, 0 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 0, 9 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::VonNeumann); @@ -300,8 +354,12 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { SoloGrid2D sologrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 } + { + 1, 0 + }, + { + 0, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::VonNeumann); @@ -311,8 +369,12 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { SoloGrid2D sologrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 } + { + 1, 0 + }, + { + 0, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::VonNeumann); @@ -321,17 +383,27 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { { SoloGrid2D sologrid2d_foo(10, 10, true, true); EXPECT_THROW(auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::VonNeumann), - AgentNotFound); + AgentNotFound); } { SoloGrid2D sologrid2d_foo(10, 10, true, true); sologrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 9, 0 }, - { 0, 9 }, - { 1, 0 }, - { 0, 0 } + { + 0, 1 + }, + { + 9, 0 + }, + { + 0, 9 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::VonNeumann); @@ -342,11 +414,21 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { sologrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 1, 2 }, - { 2, 1 }, - { 1, 0 }, - { 0, 1 }, - { 1, 1 } + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::VonNeumann); @@ -357,9 +439,15 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { sologrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 1, 0 }, - { 0, 0 } + { + 0, 1 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::VonNeumann); @@ -370,11 +458,21 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { sologrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 1, 2 }, - { 2, 1 }, - { 1, 0 }, - { 0, 1 }, - { 1, 1 } + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::VonNeumann); @@ -385,10 +483,18 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { sologrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 }, - { 9, 0 }, - { 0, 9 } + { + 1, 0 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 0, 9 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::VonNeumann); @@ -399,10 +505,18 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { sologrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 1, 2 }, - { 2, 1 }, - { 1, 0 } + { + 0, 1 + }, + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::VonNeumann); @@ -413,8 +527,12 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { sologrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 0, 1 } + { + 1, 0 + }, + { + 0, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::VonNeumann); @@ -425,10 +543,18 @@ TEST(SoloGrid2D, get_neighborhood_VonNeumann) { sologrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 0, 1 }, - { 1, 2 }, - { 2, 1 }, - { 1, 0 } + { + 0, 1 + }, + { + 1, 2 + }, + { + 2, 1 + }, + { + 1, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::VonNeumann); @@ -443,15 +569,34 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { { SoloGrid2D sologrid2d_foo(10, 10, true, true); - auto tval = unordered_set({{9, 9}, - { 9, 1 }, - { 1, 1 }, - { 0, 1 }, - { 9, 0 }, - { 1, 9 }, - { 0, 9 }, - { 1, 0 }, - { 0, 0 } + auto tval = unordered_set < GridCoord2D > ({ + { + 9, 9 + }, + { + 9, 1 + }, + { + 1, 1 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 1, 9 + }, + { + 0, 9 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, true, GridNeighborhoodType::Moore); @@ -461,15 +606,33 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { SoloGrid2D sologrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 }, - { 2, 0 }, - { 0, 1 }, - { 1, 1 } + { + 2, 2 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord1, true, GridNeighborhoodType::Moore); @@ -479,10 +642,18 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { SoloGrid2D sologrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 1 }, - { 0, 1 }, - { 1, 0 }, - { 0, 0 } + { + 1, 1 + }, + { + 0, 1 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, true, GridNeighborhoodType::Moore); @@ -493,15 +664,33 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { SoloGrid2D sologrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 }, - { 2, 0 }, - { 0, 1 }, - { 1, 1 } + { + 2, 2 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord1, true, GridNeighborhoodType::Moore); @@ -512,14 +701,30 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { SoloGrid2D sologrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 9, 9 }, - { 9, 1 }, - { 1, 0 }, - { 1, 1 }, - { 0, 1 }, - { 0, 9 }, - { 1, 9 }, - { 9, 0 } + { + 9, 9 + }, + { + 9, 1 + }, + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + }, + { + 0, 9 + }, + { + 1, 9 + }, + { + 9, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::Moore); @@ -530,14 +735,30 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { SoloGrid2D sologrid2d_foo(10, 10, true, true); auto tval = unordered_set < GridCoord2D > ({ - { 9, 9 }, - { 9, 1 }, - { 1, 0 }, - { 1, 1 }, - { 0, 1 }, - { 0, 9 }, - { 1, 9 }, - { 9, 0 } + { + 9, 9 + }, + { + 9, 1 + }, + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + }, + { + 0, 9 + }, + { + 1, 9 + }, + { + 9, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::Moore); @@ -548,9 +769,15 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { SoloGrid2D sologrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 1, 1 }, - { 0, 1 } + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::Moore); @@ -561,9 +788,15 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { SoloGrid2D sologrid2d_foo(10, 10, false, false); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 1, 1 }, - { 0, 1 } + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(coord0, false, GridNeighborhoodType::Moore); @@ -573,21 +806,39 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { { SoloGrid2D sologrid2d_foo(10, 10, true, true); EXPECT_THROW(auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::Moore), - AgentNotFound); + AgentNotFound); } { SoloGrid2D sologrid2d_foo(10, 10, true, true); sologrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 9, 9 }, - { 9, 1 }, - { 1, 1 }, - { 0, 1 }, - { 9, 0 }, - { 1, 9 }, - { 0, 9 }, - { 1, 0 }, - { 0, 0 } + { + 9, 9 + }, + { + 9, 1 + }, + { + 1, 1 + }, + { + 0, 1 + }, + { + 9, 0 + }, + { + 1, 9 + }, + { + 0, 9 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::Moore); @@ -599,15 +850,33 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { sologrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 }, - { 2, 0 }, - { 0, 1 }, - { 1, 1 } + { + 2, 2 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::Moore); @@ -619,10 +888,18 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { sologrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 1, 1 }, - { 0, 1 }, - { 1, 0 }, - { 0, 0 } + { + 1, 1 + }, + { + 0, 1 + }, + { + 1, 0 + }, + { + 0, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::Moore); @@ -634,15 +911,33 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { sologrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 }, - { 2, 0 }, - { 0, 1 }, - { 1, 1 } + { + 2, 2 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 1, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, true, GridNeighborhoodType::Moore); @@ -654,14 +949,30 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { sologrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 9, 9 }, - { 9, 1 }, - { 1, 0 }, - { 1, 1 }, - { 0, 1 }, - { 0, 9 }, - { 1, 9 }, - { 9, 0 } + { + 9, 9 + }, + { + 9, 1 + }, + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + }, + { + 0, 9 + }, + { + 1, 9 + }, + { + 9, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::Moore); @@ -673,14 +984,30 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { sologrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 2, 0 }, - { 0, 1 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 } + { + 2, 2 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::Moore); @@ -692,9 +1019,15 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { sologrid2d_foo.add_agent(agent_id_foo, coord0); auto tval = unordered_set < GridCoord2D > ({ - { 1, 0 }, - { 1, 1 }, - { 0, 1 } + { + 1, 0 + }, + { + 1, 1 + }, + { + 0, 1 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::Moore); @@ -706,14 +1039,30 @@ TEST(SoloGrid2D, get_neighborhood_Moore) { sologrid2d_foo.add_agent(agent_id_foo, coord1); auto tval = unordered_set < GridCoord2D > ({ - { 2, 2 }, - { 2, 0 }, - { 0, 1 }, - { 0, 2 }, - { 1, 2 }, - { 0, 0 }, - { 2, 1 }, - { 1, 0 } + { + 2, 2 + }, + { + 2, 0 + }, + { + 0, 1 + }, + { + 0, 2 + }, + { + 1, 2 + }, + { + 0, 0 + }, + { + 2, 1 + }, + { + 1, 0 + } }); auto rval = sologrid2d_foo.get_neighborhood(agent_id_foo, false, GridNeighborhoodType::Moore); @@ -742,7 +1091,10 @@ TEST(SoloGrid2D, get_location_by_agent) { } } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-staged.cc b/test/unit-kami-staged.cc index 680cdbc..70c0b7a 100644 --- a/test/unit-kami-staged.cc +++ b/test/unit-kami-staged.cc @@ -38,7 +38,8 @@ using namespace kami; using namespace std; -class TestAgent : public StagedAgent { +class TestAgent + : public StagedAgent { public: AgentID step(shared_ptr model) override { return get_agent_id(); @@ -49,7 +50,8 @@ class TestAgent : public StagedAgent { } }; -class TestModel : public Model { +class TestModel + : public Model { public: shared_ptr> retval; @@ -64,7 +66,8 @@ class TestModel : public Model { } }; -class StagedSchedulerTest : public ::testing::Test { +class StagedSchedulerTest + : public ::testing::Test { protected: shared_ptr mod = nullptr; @@ -129,7 +132,10 @@ TEST_F(StagedSchedulerTest, step_10000) { } } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/unit-kami-stagedagent.cc b/test/unit-kami-stagedagent.cc index 83f2c97..d9e32a0 100644 --- a/test/unit-kami-stagedagent.cc +++ b/test/unit-kami-stagedagent.cc @@ -34,7 +34,8 @@ using namespace kami; using namespace std; -class TestAgent : public StagedAgent { +class TestAgent + : public StagedAgent { public: AgentID advance(shared_ptr model) override { return get_agent_id(); @@ -45,10 +46,12 @@ class TestAgent : public StagedAgent { } }; -class TestModel : public Model { +class TestModel + : public Model { }; -class StagedAgentTest : public ::testing::Test { +class StagedAgentTest + : public ::testing::Test { protected: TestAgent agent_foo; TestAgent agent_bar; @@ -96,7 +99,10 @@ TEST_F(StagedAgentTest, inequality) { EXPECT_FALSE(agent_bar != agent_bar); } -int main(int argc, char **argv) { +int main( + int argc, + char** argv +) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }