Skip to content

Commit 4e0882d

Browse files
committed
add integration test for links
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
1 parent a3a1ba5 commit 4e0882d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

usd/src/usd_parser/usd2sdf_TEST.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,21 @@ TEST(check_cmd, IGN_UTILS_TEST_DISABLED_ON_WIN32(SDF))
139139
EXPECT_TRUE(world->ModelByName("ground_plane")->Static());
140140
ASSERT_NE(nullptr, world->ModelByName("box"));
141141
EXPECT_FALSE(world->ModelByName("box")->Static());
142+
143+
// check that models have the right links
144+
std::function<void(const std::string &, const std::string &)> checkLink =
145+
[&world](const std::string &_modelName, const std::string &_linkName)
146+
{
147+
const auto modelPtr = world->ModelByName(_modelName);
148+
ASSERT_NE(nullptr, modelPtr);
149+
EXPECT_EQ(1u, modelPtr->LinkCount());
150+
EXPECT_NE(nullptr, modelPtr->LinkByName(_linkName));
151+
};
152+
checkLink("ground_plane", "link");
153+
checkLink("box", "box_link");
154+
checkLink("cylinder", "cylinder_link");
155+
checkLink("sphere", "sphere_link");
156+
checkLink("capsule", "capsule_link");
157+
checkLink("ellipsoid", "ellipsoid_link");
142158
}
143159
}

0 commit comments

Comments
 (0)