tests: richer MockDDS (subscriptions, queues, seq) and link into Qt/GTest smoke-tests
This commit is contained in:
1 parent
69d30bc20a
commit
bec34480c8
2 files changed
+60
-7
No files matched your search
@@ -1,11 +1,26 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
namespace MockDDS {
|
||||
|
||||
// Very small mock: single-writer, single-last-message per topic store.
|
||||
// Richer mock for migration smoke-tests:
|
||||
// - publish(topic, payload)
|
||||
// - subscribe(topic, callback) -> subscription id
|
||||
// - unsubscribe(topic, subscription id)
|
||||
// - take_last(topic), get_queue(topic)
|
||||
// - clear_all()
|
||||
// - sequence numbers per topic (as simple integer appended to payload meta)
|
||||
|
||||
using Subscriber = std::function<void(const std::string &payload)>;
|
||||
using SubscriptionId = unsigned long;
|
||||
|
||||
void publish(const std::string &topic, const std::string &msg);
|
||||
SubscriptionId subscribe(const std::string &topic, Subscriber cb);
|
||||
void unsubscribe(const std::string &topic, SubscriptionId id);
|
||||
std::string take_last(const std::string &topic);
|
||||
std::vector<std::string> get_queue(const std::string &topic);
|
||||
void clear_all();
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user