Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed Oct 15, 2022
1 parent c9e9558 commit 4de3d60
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/test/pyModel_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def test_default_construction(self):
self.assertEqual(errors[1].message(),
"PoseRelativeToGraph error: scope does not point to a valid graph.")

# model dosn't have graphs, so no names should exist in graphs
self.assertFalse(model.name_exists_in_frame_attached_to_graph(""));
self.assertFalse(model.name_exists_in_frame_attached_to_graph("link"));


def test_copy_construction(self):
model = Model()
Expand Down
4 changes: 4 additions & 0 deletions python/test/pyWorld_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ def test_default_construction(self):
self.assertEqual(errors[1].message(),
"PoseRelativeToGraph error: scope does not point to a valid graph.")

# world dosn't have graphs, so no names should exist in graphs
self.assertFalse(world.name_exists_in_frame_attached_to_graph(""));
self.assertFalse(world.name_exists_in_frame_attached_to_graph("link"));


def test_copy_construction(self):
world = World()
Expand Down
7 changes: 7 additions & 0 deletions src/Model_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ TEST(DOMModel, Construction)
errors[1].Message().find(
"PoseRelativeToGraph error: scope does not point to a valid graph"))
<< errors[1];

// model dosn't have graphs, so no names should exist in graphs
EXPECT_FALSE(model.NameExistsInFrameAttachedToGraph(""));
EXPECT_FALSE(model.NameExistsInFrameAttachedToGraph("link"));
}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -229,6 +233,9 @@ TEST(DOMModel, AddLink)
EXPECT_EQ(1u, model.LinkCount());
EXPECT_FALSE(model.AddLink(link));
EXPECT_EQ(1u, model.LinkCount());
// model dosn't have graphs, so no names should exist in graphs
EXPECT_FALSE(model.NameExistsInFrameAttachedToGraph(""));
EXPECT_FALSE(model.NameExistsInFrameAttachedToGraph("link1"));

model.ClearLinks();
EXPECT_EQ(0u, model.LinkCount());
Expand Down
7 changes: 7 additions & 0 deletions src/World_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ TEST(DOMWorld, Construction)
EXPECT_NE(std::string::npos,
errors[1].Message().find(
"PoseRelativeToGraph error: scope does not point to a valid graph"));

// world dosn't have graphs, so no names should exist in graphs
EXPECT_FALSE(world.NameExistsInFrameAttachedToGraph(""));
EXPECT_FALSE(world.NameExistsInFrameAttachedToGraph("model1"));
}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -384,6 +388,9 @@ TEST(DOMWorld, AddModel)
EXPECT_EQ(1u, world.ModelCount());
EXPECT_FALSE(world.AddModel(model));
EXPECT_EQ(1u, world.ModelCount());
// world dosn't have graphs, so no names should exist in graphs
EXPECT_FALSE(world.NameExistsInFrameAttachedToGraph(""));
EXPECT_FALSE(world.NameExistsInFrameAttachedToGraph("model1"));

world.ClearModels();
EXPECT_EQ(0u, world.ModelCount());
Expand Down

0 comments on commit 4de3d60

Please sign in to comment.