Classes | Functions | Variables
ros2_foxglove_bridge/tests/smoke_test.cpp File Reference
#include <chrono>
#include <filesystem>
#include <future>
#include <thread>
#include <gtest/gtest.h>
#include <std_msgs/msg/string.hpp>
#include <std_srvs/srv/set_bool.hpp>
#include <websocketpp/config/asio_client.hpp>
#include <foxglove_bridge/ros2_foxglove_bridge.hpp>
#include <foxglove_bridge/test/test_client.hpp>
#include <foxglove_bridge/websocket_client.hpp>
Include dependency graph for ros2_foxglove_bridge/tests/smoke_test.cpp:

Go to the source code of this file.

Classes

class  ExistingPublisherTest
 
class  ParameterTest
 
class  PublisherTest
 
class  ServiceTest
 
class  TestWithExecutor
 

Functions

template<class T >
std::shared_ptr< T > deserializeMsg (const rcl_serialized_message_t *msg)
 
 INSTANTIATE_TEST_SUITE_P (ExistingPublisherTestCDR, ExistingPublisherTest, testing::Values(std::make_pair("cdr", std::vector< uint8_t >(HELLO_WORLD_CDR, std::end(HELLO_WORLD_CDR)))))
 
 INSTANTIATE_TEST_SUITE_P (ExistingPublisherTestJSON, ExistingPublisherTest, testing::Values(std::make_pair("json", std::vector< uint8_t >(HELLO_WORLD_JSON, std::end(HELLO_WORLD_JSON)))))
 
 INSTANTIATE_TEST_SUITE_P (TestPublishingCDR, PublisherTest, testing::Values(std::make_pair("cdr", std::vector< uint8_t >(HELLO_WORLD_CDR, std::end(HELLO_WORLD_CDR)))))
 
 INSTANTIATE_TEST_SUITE_P (TestPublishingJSON, PublisherTest, testing::Values(std::make_pair("json", std::vector< uint8_t >(HELLO_WORLD_JSON, std::end(HELLO_WORLD_JSON)))))
 
int main (int argc, char **argv)
 
template<class T >
std::shared_ptr< rclcpp::SerializedMessage > serializeMsg (const T *msg)
 
 TEST (FetchAssetTest, fetchExistingAsset)
 
 TEST (FetchAssetTest, fetchNonExistingAsset)
 
 TEST (SmokeTest, receiveMessagesOfMultipleTransientLocalPublishers)
 
 TEST (SmokeTest, testConnection)
 
 TEST (SmokeTest, testSubscription)
 
 TEST (SmokeTest, testSubscriptionParallel)
 
 TEST_F (ParameterTest, testGetAllParams)
 
 TEST_F (ParameterTest, testGetNonExistingParameters)
 
 TEST_F (ParameterTest, testGetParameters)
 
 TEST_F (ParameterTest, testGetParametersParallel)
 
 TEST_F (ParameterTest, testParameterSubscription)
 
 TEST_F (ParameterTest, testSetFloatParametersWithIntegers)
 
 TEST_F (ParameterTest, testSetParameters)
 
 TEST_F (ParameterTest, testSetParametersWithReqId)
 
 TEST_F (ParameterTest, testUnsetParameter)
 
 TEST_F (ServiceTest, testAdvertiseService)
 
 TEST_F (ServiceTest, testCallNonexistentService)
 
 TEST_F (ServiceTest, testCallServiceParallel)
 
 TEST_P (ExistingPublisherTest, testPublishingWithExistingPublisher)
 
 TEST_P (PublisherTest, testPublishing)
 

Variables

constexpr auto DEFAULT_TIMEOUT = std::chrono::seconds(10)
 
constexpr uint8_t HELLO_WORLD_CDR []
 
constexpr char HELLO_WORLD_JSON [] = "{\"data\": \"hello world\"}"
 
constexpr auto ONE_SECOND = std::chrono::seconds(1)
 
constexpr char STD_MSGS_STRING_SCHEMA [] = "data string"
 
constexpr char URI [] = "ws://localhost:8765"
 

Function Documentation

◆ deserializeMsg()

template<class T >
std::shared_ptr<T> deserializeMsg ( const rcl_serialized_message_t *  msg)

Definition at line 164 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ INSTANTIATE_TEST_SUITE_P() [1/4]

INSTANTIATE_TEST_SUITE_P ( ExistingPublisherTestCDR  ,
ExistingPublisherTest  ,
testing::Values(std::make_pair("cdr", std::vector< uint8_t >(HELLO_WORLD_CDR, std::end(HELLO_WORLD_CDR))))   
)

◆ INSTANTIATE_TEST_SUITE_P() [2/4]

INSTANTIATE_TEST_SUITE_P ( ExistingPublisherTestJSON  ,
ExistingPublisherTest  ,
testing::Values(std::make_pair("json", std::vector< uint8_t >(HELLO_WORLD_JSON, std::end(HELLO_WORLD_JSON))))   
)

◆ INSTANTIATE_TEST_SUITE_P() [3/4]

INSTANTIATE_TEST_SUITE_P ( TestPublishingCDR  ,
PublisherTest  ,
testing::Values(std::make_pair("cdr", std::vector< uint8_t >(HELLO_WORLD_CDR, std::end(HELLO_WORLD_CDR))))   
)

◆ INSTANTIATE_TEST_SUITE_P() [4/4]

INSTANTIATE_TEST_SUITE_P ( TestPublishingJSON  ,
PublisherTest  ,
testing::Values(std::make_pair("json", std::vector< uint8_t >(HELLO_WORLD_JSON, std::end(HELLO_WORLD_JSON))))   
)

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 764 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ serializeMsg()

template<class T >
std::shared_ptr<rclcpp::SerializedMessage> serializeMsg ( const T *  msg)

Definition at line 154 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST() [1/6]

TEST ( FetchAssetTest  ,
fetchExistingAsset   
)

Definition at line 717 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST() [2/6]

TEST ( FetchAssetTest  ,
fetchNonExistingAsset   
)

Definition at line 746 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST() [3/6]

TEST ( SmokeTest  ,
receiveMessagesOfMultipleTransientLocalPublishers   
)

Definition at line 666 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST() [4/6]

TEST ( SmokeTest  ,
testConnection   
)

Definition at line 173 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST() [5/6]

TEST ( SmokeTest  ,
testSubscription   
)

Definition at line 178 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST() [6/6]

TEST ( SmokeTest  ,
testSubscriptionParallel   
)

Definition at line 215 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [1/12]

TEST_F ( ParameterTest  ,
testGetAllParams   
)

Definition at line 361 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [2/12]

TEST_F ( ParameterTest  ,
testGetNonExistingParameters   
)

Definition at line 371 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [3/12]

TEST_F ( ParameterTest  ,
testGetParameters   
)

Definition at line 382 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [4/12]

TEST_F ( ParameterTest  ,
testGetParametersParallel   
)

Definition at line 540 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [5/12]

TEST_F ( ParameterTest  ,
testParameterSubscription   
)

Definition at line 521 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [6/12]

TEST_F ( ParameterTest  ,
testSetFloatParametersWithIntegers   
)

Definition at line 465 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [7/12]

TEST_F ( ParameterTest  ,
testSetParameters   
)

Definition at line 411 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [8/12]

TEST_F ( ParameterTest  ,
testSetParametersWithReqId   
)

Definition at line 449 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [9/12]

TEST_F ( ParameterTest  ,
testUnsetParameter   
)

Definition at line 506 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [10/12]

TEST_F ( ServiceTest  ,
testAdvertiseService   
)

Definition at line 573 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [11/12]

TEST_F ( ServiceTest  ,
testCallNonexistentService   
)

Definition at line 640 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_F() [12/12]

TEST_F ( ServiceTest  ,
testCallServiceParallel   
)

Definition at line 588 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_P() [1/2]

TEST_P ( ExistingPublisherTest  ,
testPublishingWithExistingPublisher   
)

Definition at line 311 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ TEST_P() [2/2]

TEST_P ( PublisherTest  ,
testPublishing   
)

Definition at line 261 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

Variable Documentation

◆ DEFAULT_TIMEOUT

constexpr auto DEFAULT_TIMEOUT = std::chrono::seconds(10)
constexpr

Definition at line 24 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ HELLO_WORLD_CDR

constexpr uint8_t HELLO_WORLD_CDR[]
constexpr
Initial value:
= {0, 1, 0, 0, 12, 0, 0, 0, 104, 101,
108, 108, 111, 32, 119, 111, 114, 108, 100, 0}

Definition at line 18 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ HELLO_WORLD_JSON

constexpr char HELLO_WORLD_JSON[] = "{\"data\": \"hello world\"}"
constexpr

Definition at line 20 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ ONE_SECOND

constexpr auto ONE_SECOND = std::chrono::seconds(1)
constexpr

Definition at line 23 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ STD_MSGS_STRING_SCHEMA

constexpr char STD_MSGS_STRING_SCHEMA[] = "data string"
constexpr

Definition at line 21 of file ros2_foxglove_bridge/tests/smoke_test.cpp.

◆ URI

constexpr char URI[] = "ws://localhost:8765"
constexpr

Definition at line 15 of file ros2_foxglove_bridge/tests/smoke_test.cpp.



foxglove_bridge
Author(s): Foxglove
autogenerated on Wed Mar 5 2025 03:34:31