simple_action_server_construction_test.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2021, Smart Robotics BV.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of the Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
36 
37 #include <actionlib/TestAction.h>
39 #include <gtest/gtest.h>
40 #include <stdlib.h>
41 
42 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
43 
44 using namespace actionlib;
45 
46 TEST(SimpleActionServerConstruction, test_name_cb_autostart) {
47  SimpleActionServer<TestAction>::ExecuteCallback callback = [](const TestGoalConstPtr&){};
48  SimpleActionServer<TestAction> as("name", callback, false);
49 }
50 
51 TEST(SimpleActionServerConstruction, test_name_autostart) {
52  SimpleActionServer<TestAction> as("name", false);
53 }
54 
55 TEST(SimpleActionServerConstruction, test_name) {
57 }
58 
59 TEST(SimpleActionServerConstruction, test_name_cb) {
60  SimpleActionServer<TestAction>::ExecuteCallback callback = [](const TestGoalConstPtr&){};
61  SimpleActionServer<TestAction> as("name", callback);
62 }
63 
64 TEST(SimpleActionServerConstruction, test_nh_name_cb_autostart) {
65  ros::NodeHandle nh;
66  SimpleActionServer<TestAction>::ExecuteCallback callback = [](const TestGoalConstPtr&){};
67  SimpleActionServer<TestAction> as(nh, "name", callback, false);
68 }
69 
70 TEST(SimpleActionServerConstruction, test_nh_name_autostart) {
71  ros::NodeHandle nh;
72  SimpleActionServer<TestAction> as(nh, "name", false);
73 }
74 
75 TEST(SimpleActionServerConstruction, test_nh_name) {
76  ros::NodeHandle nh;
77  SimpleActionServer<TestAction> as(nh, "name");
78 }
79 
80 TEST(SimpleActionServerConstruction, test_nh_name_cb) {
81  ros::NodeHandle nh;
82  SimpleActionServer<TestAction>::ExecuteCallback callback = [](const TestGoalConstPtr&){};
83  SimpleActionServer<TestAction> as(nh, "name", callback);
84 }
85 
86 int main(int argc, char **argv) {
87  testing::InitGoogleTest(&argc, argv);
88 
89  ros::init(argc, argv, "simple_action_server_construction");
90 
91  return RUN_ALL_TESTS();
92 }
ros::init
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
main
int main(int argc, char **argv)
Definition: simple_action_server_construction_test.cpp:86
simple_action_server.h
TEST
TEST(SimpleActionServerConstruction, test_name_cb_autostart)
Definition: simple_action_server_construction_test.cpp:46
actionlib::SimpleActionServer
Definition: simple_action_server.h:95
actionlib
Definition: action_definition.h:40
ros::NodeHandle


actionlib
Author(s): Eitan Marder-Eppstein, Vijay Pradeep, Mikael Arguedas
autogenerated on Fri May 19 2023 02:36:55