Horje
c++ unittest in ros Code Example
c++ unittest in ros
// Bring in my package's API, which is what I'm testing
#include "foo/foo.h"
// Bring in gtest
#include <gtest/gtest.h>

// Declare a test
TEST(TestSuite, testCase1)
{
<test things here, calling EXPECT_* and/or ASSERT_* macros as needed>
}

// Declare another test
TEST(TestSuite, testCase2)
{
<test things here, calling EXPECT_* and/or ASSERT_* macros as needed>
}

// Run all the tests that were declared with TEST()
int main(int argc, char **argv){
  testing::InitGoogleTest(&argc, argv);
  ros::init(argc, argv, "tester");
  ros::NodeHandle nh;
  return RUN_ALL_TESTS();
}
Source: wiki.ros.org




Cpp

Related
double array size c++ Code Example double array size c++ Code Example
c++ namespace Code Example c++ namespace Code Example
c++ check that const char* has suffix Code Example c++ check that const char* has suffix Code Example
read a whole line from the input Code Example read a whole line from the input Code Example
how to concatenate two vectors in c++ Code Example how to concatenate two vectors in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12