Skip to content

Commit

Permalink
test_roscpp/params/added getParamCachedSetParamLoop
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Wecht committed Jun 20, 2018
1 parent 89ca9a7 commit fff8901
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/test_roscpp/test/src/params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,23 @@ TEST(Params, getParamNames) {
EXPECT_LT(10u, test_params.size());
}

TEST(Params, getParamCachedSetParamLoop) {
NodeHandle nh;
const std::string name = "changeable_int";
for (int i = 0; i < 100; i++) {
nh.setParam(name, i);
int v = 0;
ASSERT_TRUE(nh.getParamCached(name, v));
ASSERT_EQ(i, v);
}
}

int
main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
ros::init( argc, argv, "params" );
// ros::NodeHandle nh;
ros::init(argc, argv, "params");
ros::NodeHandle nh;

return RUN_ALL_TESTS();
}

0 comments on commit fff8901

Please sign in to comment.