Skip to content

Commit e4587a3

Browse files
committed
Add field detector test
Signed-off-by: Emerson Knapp <[email protected]>
1 parent c6b4366 commit e4587a3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

rosbag2_transport/test/rosbag2_transport/test_qos.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <string>
1818
#include <vector>
1919

20+
#include "rmw/types.h"
21+
2022
#include "qos.hpp"
2123

2224
TEST(TestQoS, serialization)
@@ -77,3 +79,22 @@ TEST(TestQoS, supports_version_4)
7779
// Any values not present in the YAML should take the default value in both profiles
7880
EXPECT_EQ(actual_qos, expected_qos);
7981
}
82+
83+
TEST(TestQoS, detect_new_qos_fields)
84+
{
85+
// By trying to construct a profile explicitly by fields, the build fails if policies are added
86+
// This build failure indicates that we need to update QoS serialization in rosbag2_transport
87+
rmw_time_t notime{0, 0};
88+
rmw_qos_profile_t profile{
89+
RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT,
90+
10,
91+
RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT,
92+
RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT,
93+
notime,
94+
notime,
95+
RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT,
96+
notime,
97+
false,
98+
};
99+
EXPECT_EQ(profile.history, RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT); // fix "unused variable"
100+
}

0 commit comments

Comments
 (0)