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"
|
||||
#include <map>
|
||||
|
||||
TEST(FunctionTopicSmokeGTest, Containers) {
|
||||
@@ -7,3 +8,10 @@ TEST(FunctionTopicSmokeGTest, Containers) {
|
||||
m["two"] = 2;
|
||||
EXPECT_EQ(m["two"], 2);
|
||||
}
|
||||
|
||||
TEST(FunctionTopicSmokeGTest, MockDDSTopicAsSignal) {
|
||||
MockDDS::clear_all();
|
||||
MockDDS::publish("func/topic", "evt:1");
|
||||
auto val = MockDDS::take_last("func/topic");
|
||||
EXPECT_EQ(val, "evt:1");
|
||||
}
|
||||
Reference in new issue
Block a user