Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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();
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: matrix c++ 
Cpp :: initialize 2d vector c++ 
Cpp :: c++ map lookup 
Cpp :: string in c++ 
Cpp :: converting char to integer c++ 
Cpp :: linear search 
Cpp :: struct node 
Cpp :: Euler constant 
Cpp :: input c++ 
Cpp :: Ninja c++ 
Cpp :: Abstract factory C++ code 
Cpp :: how to find product of a given numbers in c++ 
Cpp :: 2d array of zeros c++ 
Cpp :: c++ multiline string 
Cpp :: __builtin_popcount 
Cpp :: C++ float and double Using setprecision() For Floating-Point Numbers 
Cpp :: operator overloading in c++ 
Cpp :: C++ function inside main 
Cpp :: javascript if else exercises 
Cpp :: even and odd numbers 1 to 100 
Cpp :: remove elements from vector 
Cpp :: how togreper 
Cpp :: c++ download 
Cpp :: Array declaration by specifying the size and initializing elements in C++ 
Cpp :: how to read rotary encoder c++ 
Cpp :: how to type a vertical stack program c++ 
Cpp :: C++ Detect when user presses arrow key 
Cpp :: find min and max in array c++ 
Cpp :: argument to number C++ 
Cpp :: c++ check if cin got the wrong type 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =