Go to the documentation of this file.00001
00002
00003 #include <ros/ros.h>
00004 #include <gtest/gtest.h>
00005 #include "rviz_marker_stub.cpp"
00006
00007 #include "../../src/checkpoint_marker.h"
00008
00009 TEST(RvizMarkerStub, basic)
00010 {
00011 RvizMarkerStub rviz_stub;
00012
00013 ASSERT_EQ(rviz_stub.count_markers_received(), 0);
00014 }
00015
00016 TEST(CheckpointMarker, check_conection)
00017 {
00018 CheckpointMarker marker_server;
00019 RvizMarkerStub rviz_stub;
00020 CheckpointRequest position;
00021
00022
00023
00024 sleep(1);
00025
00026 marker_server.display_new_checkpoint(position);
00027 usleep(200);
00028
00029 ASSERT_EQ(rviz_stub.count_markers_received(),1);
00030
00031 marker_server.display_active_checkpoint(position);
00032 usleep(200);
00033
00034 ASSERT_EQ(rviz_stub.count_markers_received(),2);
00035
00036 marker_server.display_visited_checkpoint(position);
00037 usleep(200);
00038
00039 ASSERT_EQ(rviz_stub.count_markers_received(),3);
00040 }
00041
00042
00043 int main(int argc, char **argv)
00044 {
00045 ros::init(argc, argv, "checkpoint_marker_test");
00046
00047
00048 ros::AsyncSpinner spinner(1);
00049 spinner.start();
00050
00051 testing::InitGoogleTest(&argc, argv);
00052 return RUN_ALL_TESTS();
00053 }