utest.cpp
Go to the documentation of this file.
1 /*
2  * Software License Agreement (Apache License)
3  *
4  * Copyright (c) 2016 Shaun Edwards
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #include <gtest/gtest.h>
20 #include <ros/time.h>
21 #include <ros/console.h>
22 #include <packml_msgs/Transition.h>
23 #include <packml_msgs/State.h>
24 #include <packml_sm/common.h>
25 
26 
27 int main(int argc, char **argv)
28 {
30  testing::InitGoogleTest(&argc, argv);
31  return RUN_ALL_TESTS();
32 }
33 
34 
35 TEST(Packml_ROS, sync_packml_cmd)
36 {
37  using namespace packml_msgs;
38  using namespace packml_sm;
39  EXPECT_EQ(static_cast<int>(CmdEnum::ABORT), Transition::Request::ABORT);
40  EXPECT_EQ(static_cast<int>(CmdEnum::CLEAR), Transition::Request::CLEAR);
41  EXPECT_EQ(static_cast<int>(CmdEnum::ESTOP), Transition::Request::ESTOP);
42  EXPECT_EQ(static_cast<int>(CmdEnum::HOLD), Transition::Request::HOLD);
43  EXPECT_EQ(static_cast<int>(CmdEnum::RESET), Transition::Request::RESET);
44  EXPECT_EQ(static_cast<int>(CmdEnum::START), Transition::Request::START);
45  EXPECT_EQ(static_cast<int>(CmdEnum::STOP), Transition::Request::STOP);
46  EXPECT_EQ(static_cast<int>(CmdEnum::SUSPEND), Transition::Request::SUSPEND);
47  EXPECT_EQ(static_cast<int>(CmdEnum::UNDEFINED), Transition::Request::UNDEFINED);
48  EXPECT_EQ(static_cast<int>(CmdEnum::UNHOLD), Transition::Request::UNHOLD);
49  EXPECT_EQ(static_cast<int>(CmdEnum::UNSUSPEND), Transition::Request::UNSUSPEND);
50 }
51 
52 
53 TEST(Packml_ROS, sync_packml_state)
54 {
55  using namespace packml_msgs;
56  using namespace packml_sm;
57  EXPECT_EQ(static_cast<int>(StatesEnum::ABORTED), State::ABORTED);
58  EXPECT_EQ(static_cast<int>(StatesEnum::ABORTING), State::ABORTING);
59  EXPECT_EQ(static_cast<int>(StatesEnum::CLEARING), State::CLEARING);
60  EXPECT_EQ(static_cast<int>(StatesEnum::COMPLETE), State::COMPLETE);
61  EXPECT_EQ(static_cast<int>(StatesEnum::COMPLETING), State::COMPLETING);
62  EXPECT_EQ(static_cast<int>(StatesEnum::EXECUTE), State::EXECUTE);
63  EXPECT_EQ(static_cast<int>(StatesEnum::HELD), State::HELD);
64  EXPECT_EQ(static_cast<int>(StatesEnum::HOLDING), State::HOLDING);
65  EXPECT_EQ(static_cast<int>(StatesEnum::IDLE), State::IDLE);
66 
67 }
TEST(Packml_ROS, sync_packml_cmd)
Definition: utest.cpp:35
static void init()
int main(int argc, char **argv)
Definition: utest.cpp:27


packml_ros
Author(s): Shaun Edwards
autogenerated on Fri Jul 12 2019 03:31:00