tests: add MockDDS and use it in GTest smoke-tests to simulate publish/subscribe flows
This commit is contained in:
1 parent
b44bb09891
commit
7372bdc766
5 files changed
+61
-4
No files matched your search
@@ -1,4 +1,5 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "mocks/MockDDS.h"
|
||||
|
||||
TEST(GenericSmokeGTest, BasicStringOps) {
|
||||
std::string s = "MiXeD";
|
||||
@@ -6,8 +7,9 @@ TEST(GenericSmokeGTest, BasicStringOps) {
|
||||
EXPECT_EQ(s, "mixed");
|
||||
}
|
||||
|
||||
TEST(GenericSmokeGTest, VariantLike) {
|
||||
// simulate basic core logic check
|
||||
int v = 42;
|
||||
EXPECT_EQ(v + 1, 43);
|
||||
TEST(GenericSmokeGTest, MockDDSPublishReceive) {
|
||||
MockDDS::clear_all();
|
||||
MockDDS::publish("topic1", "payload42");
|
||||
auto r = MockDDS::take_last("topic1");
|
||||
EXPECT_EQ(r, "payload42");
|
||||
}
|
||||
Reference in new issue
Block a user