Go to the documentation of this file.
38 #include <gtest/gtest.h>
63 namespace message_traits
68 static const char*
value() {
return "MsgMD5Sum"; }
69 static const char*
value(
const Msg&) {
return "MsgMD5Sum"; }
75 static const char*
value() {
return "roscpp/MsgDataType"; }
76 static const char*
value(
const Msg&) {
return "roscpp/MsgDataType"; }
82 static const char*
value() {
return ""; }
83 static const char*
value(
const Msg&) {
return ""; }
87 namespace serialization
92 template<
typename Stream>
98 template<
typename Stream>
130 namespace message_traits
135 static const char*
value() {
return "MsgMD5Sum"; }
136 static const char*
value(
const Msg2&) {
return "MsgMD5Sum"; }
142 static const char*
value() {
return "roscpp/MsgDataType"; }
143 static const char*
value(
const Msg2&) {
return "roscpp/MsgDataType"; }
149 static const char*
value() {
return ""; }
154 namespace serialization
159 template<
typename Stream>
165 template<
typename Stream>
184 TEST(IntraprocessSubscriptions, noCopy)
209 EXPECT_EQ(
g_msg.get(), msg.get());
210 EXPECT_FALSE(
g_msg->serialized);
211 EXPECT_FALSE(
g_msg->deserialized);
215 TEST(IntraprocessSubscriptions, differentRTTI)
240 EXPECT_NE((
void*)
g_msg.get(), (
void*)msg.get());
241 EXPECT_TRUE(msg->serialized);
242 EXPECT_TRUE(
g_msg->deserialized);
253 TEST(IntraprocessSubscriptions, noCopyAndDifferentRTTI)
278 EXPECT_NE((
void*)
g_msg.get(), (
void*)msg.get());
279 EXPECT_TRUE(msg->serialized);
280 EXPECT_TRUE(
g_msg->deserialized);
283 EXPECT_EQ(
g_msg2.get(), msg.get());
284 EXPECT_TRUE(
g_msg2->serialized);
285 EXPECT_FALSE(
g_msg2->deserialized);
288 int main(
int argc,
char** argv)
290 testing::InitGoogleTest(&argc, argv);
291 ros::init(argc, argv,
"intraprocess_subscriptions");
295 return RUN_ALL_TESTS();
static const char * value(const Msg2 &)
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
static const char * value()
static const char * value(const Msg2 &)
static const char * value(const Msg &)
static const char * value(const Msg &)
ROSCPP_DECL void spinOnce()
static const char * value()
static const char * value()
static const char * value(const Msg &)
void publish(const boost::shared_ptr< M > &message) const
Publisher advertise(AdvertiseOptions &ops)
boost::shared_ptr< Msg const > MsgConstPtr
static void write(Stream &, const Msg &v)
uint32_t g_msg_constructor
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
static uint32_t serializedLength(const Msg &)
static void write(Stream &, const Msg2 &v)
void messageCallback(const MsgConstPtr &msg)
uint32_t g_msg2_constructor
TEST(IntraprocessSubscriptions, noCopy)
static void read(Stream &, Msg2 &v)
static const char * value(const Msg2 &)
static void read(Stream &, Msg &v)
static uint32_t serializedLength(const Msg2 &)
static const char * value()
int main(int argc, char **argv)
uint32_t getNumSubscribers() const
boost::shared_ptr< Msg2 const > Msg2ConstPtr
static const char * value()
static const char * value()
void messageCallback2(const Msg2ConstPtr &msg)
test_roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:57