aboutsummaryrefslogtreecommitdiff
path: root/test/interop/basic_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/interop/basic_test.c')
-rw-r--r--test/interop/basic_test.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/interop/basic_test.c b/test/interop/basic_test.c
index 76ddaec..90e2c65 100644
--- a/test/interop/basic_test.c
+++ b/test/interop/basic_test.c
@@ -1,21 +1,23 @@
#include "greatest.h"
#include "testclient.h"
+#include "cleanup.c"
+#include "topics.c"
TEST basic_test()
{
TestClient *client;
- client = TestClientNew("basic_test");
+ client = TestClientNew("clienta");
ASSERT(TestClientConnect(client, "localhost", 1883, 60, 1));
TestClientDisconnect(client);
TestClientFree(client);
- client = TestClientNew("basic_test");
+ client = TestClientNew("clienta");
ASSERT(TestClientConnect(client, "localhost", 1883, 60, 1));
- ASSERT(TestClientSubscribe(client, "basic_test/basic_test", 2));
- ASSERT(TestClientPublish(client, 0, 0, "basic_test/basic_test", "msg0"));
- ASSERT(TestClientPublish(client, 1, 0, "basic_test/basic_test", "msg1"));
- ASSERT(TestClientPublish(client, 2, 0, "basic_test/basic_test", "msg2"));
+ ASSERT(TestClientSubscribe(client, topics[0], 2));
+ ASSERT(TestClientPublish(client, 0, 0, topics[0], "msg0"));
+ ASSERT(TestClientPublish(client, 1, 0, topics[0], "msg1"));
+ ASSERT(TestClientPublish(client, 2, 0, topics[0], "msg2"));
ASSERT(TestClientWait(client, 2000));
ASSERT_EQ(3, TestClientMessageCount(client));
TestClientDisconnect(client);
@@ -29,6 +31,7 @@ GREATEST_MAIN_DEFS();
int main(int argc, char **argv)
{
GREATEST_MAIN_BEGIN();
+ cleanup();
RUN_TEST(basic_test);
GREATEST_MAIN_END();
}