utest.cpp
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (Apache License)
00003  *
00004  * Copyright (c) 2016 Shaun Edwards
00005  *
00006  * Licensed under the Apache License, Version 2.0 (the "License");
00007  * you may not use this file except in compliance with the License.
00008  * You may obtain a copy of the License at
00009  *
00010  * http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
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 }


packml_ros
Author(s): Shaun Edwards
autogenerated on Sat Jun 8 2019 20:13:36