C ++ Gtest如何将参数传递给类夹具?

时间:2019-07-10 14:23:52

标签: c++ googletest ros fixtures

我对如何将参数从main传递到类固定装置感到有些困惑。说我有:

#include "robot.h"
class Checksweep : public testing::Test{
public: 
  Checksweep(){}
  virtual void SetUp() {

    Robot1 = new Robot(&nh);
  }

  virtual void TearDown() { delete Robot1; }

  Robot *Robot1;

};

TEST_F(Checksweep, MyTestCaseName)
{
}

int main(int argc, char **argv){
  testing::InitGoogleTest(&argc, argv);
  ros::init(argc, argv, "robot_test_node");
  ros::NodeHandle nh;
  return RUN_ALL_TESTS();
}

反正我有nh类中的main()setup()发送到Checksweep吗?

0 个答案:

没有答案