aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--test/interop/CMakeLists.txt1
-rw-r--r--test/interop/dollar_topics_test.c38
3 files changed, 40 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4565556..f51fabb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -39,7 +39,7 @@ ENDIF()
TARGET_INCLUDE_DIRECTORIES(mqtt
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib
+ PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/lib
)
IF(WIN32)
diff --git a/test/interop/CMakeLists.txt b/test/interop/CMakeLists.txt
index f35ca04..e907776 100644
--- a/test/interop/CMakeLists.txt
+++ b/test/interop/CMakeLists.txt
@@ -16,3 +16,4 @@ ADD_INTEROP_TEST(overlapping_subscriptions_test)
ADD_INTEROP_TEST(keepalive_test)
ADD_INTEROP_TEST(redelivery_on_reconnect_test)
ADD_INTEROP_TEST(subscribe_failure_test)
+ADD_INTEROP_TEST(dollar_topics_test)
diff --git a/test/interop/dollar_topics_test.c b/test/interop/dollar_topics_test.c
new file mode 100644
index 0000000..d7cb130
--- /dev/null
+++ b/test/interop/dollar_topics_test.c
@@ -0,0 +1,38 @@
+#include "greatest.h"
+#include "testclient.h"
+#include "cleanup.c"
+#include "topics.c"
+#include <bstrlib/bstrlib.h>
+
+TEST dollar_topics_test()
+{
+ TestClient *client;
+ bstring topic;
+
+ topic = bfromcstr("$");
+ bcatcstr(topic, topics[1]);
+
+ client = TestClientNew("clientb");
+ ASSERT(TestClientConnect(client, "localhost", 1883, 60, 0));
+ ASSERT(TestClientSubscribe(client, wildtopics[5], 2));
+ ASSERT(TestClientWait(client, 1000));
+ ASSERT(TestClientPublish(client, 1, 0, bdata(topic), ""));
+ ASSERT(TestClientWait(client, 2000));
+ TestClientDisconnect(client);
+ ASSERT_EQ(0, TestClientMessageCount(client));
+ TestClientFree(client);
+
+ bdestroy(topic);
+
+ PASS();
+}
+
+GREATEST_MAIN_DEFS();
+
+int main(int argc, char **argv)
+{
+ GREATEST_MAIN_BEGIN();
+ cleanup();
+ RUN_TEST(dollar_topics_test);
+ GREATEST_MAIN_END();
+}