Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <gtest/gtest.h>
00020 #include <ros/time.h>
00021 #include <ros/console.h>
00022 #include <packml_msgs/Transition.h>
00023 #include <packml_msgs/State.h>
00024 #include <packml_sm/common.h>
00025
00026
00027 int main(int argc, char **argv)
00028 {
00029 ros::Time::init();
00030 testing::InitGoogleTest(&argc, argv);
00031 return RUN_ALL_TESTS();
00032 }
00033
00034
00035 TEST(Packml_ROS, sync_packml_cmd)
00036 {
00037 using namespace packml_msgs;
00038 using namespace packml_sm;
00039 EXPECT_EQ(static_cast<int>(CmdEnum::ABORT), Transition::Request::ABORT);
00040 EXPECT_EQ(static_cast<int>(CmdEnum::CLEAR), Transition::Request::CLEAR);
00041 EXPECT_EQ(static_cast<int>(CmdEnum::ESTOP), Transition::Request::ESTOP);
00042 EXPECT_EQ(static_cast<int>(CmdEnum::HOLD), Transition::Request::HOLD);
00043 EXPECT_EQ(static_cast<int>(CmdEnum::RESET), Transition::Request::RESET);
00044 EXPECT_EQ(static_cast<int>(CmdEnum::START), Transition::Request::START);
00045 EXPECT_EQ(static_cast<int>(CmdEnum::STOP), Transition::Request::STOP);
00046 EXPECT_EQ(static_cast<int>(CmdEnum::SUSPEND), Transition::Request::SUSPEND);
00047 EXPECT_EQ(static_cast<int>(CmdEnum::UNDEFINED), Transition::Request::UNDEFINED);
00048 EXPECT_EQ(static_cast<int>(CmdEnum::UNHOLD), Transition::Request::UNHOLD);
00049 EXPECT_EQ(static_cast<int>(CmdEnum::UNSUSPEND), Transition::Request::UNSUSPEND);
00050 }
00051
00052
00053 TEST(Packml_ROS, sync_packml_state)
00054 {
00055 using namespace packml_msgs;
00056 using namespace packml_sm;
00057 EXPECT_EQ(static_cast<int>(StatesEnum::ABORTED), State::ABORTED);
00058 EXPECT_EQ(static_cast<int>(StatesEnum::ABORTING), State::ABORTING);
00059 EXPECT_EQ(static_cast<int>(StatesEnum::CLEARING), State::CLEARING);
00060 EXPECT_EQ(static_cast<int>(StatesEnum::COMPLETE), State::COMPLETE);
00061 EXPECT_EQ(static_cast<int>(StatesEnum::COMPLETING), State::COMPLETING);
00062 EXPECT_EQ(static_cast<int>(StatesEnum::EXECUTE), State::EXECUTE);
00063 EXPECT_EQ(static_cast<int>(StatesEnum::HELD), State::HELD);
00064 EXPECT_EQ(static_cast<int>(StatesEnum::HOLDING), State::HOLDING);
00065 EXPECT_EQ(static_cast<int>(StatesEnum::IDLE), State::IDLE);
00066
00067 }