aboutsummaryrefslogtreecommitdiff
path: root/test/interop/subscribe_failure_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/interop/subscribe_failure_test.c')
-rw-r--r--test/interop/subscribe_failure_test.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/interop/subscribe_failure_test.c b/test/interop/subscribe_failure_test.c
new file mode 100644
index 0000000..84d3ebc
--- /dev/null
+++ b/test/interop/subscribe_failure_test.c
@@ -0,0 +1,28 @@
+#include "greatest.h"
+#include "testclient.h"
+#include "cleanup.c"
+#include "topics.c"
+
+TEST subscribe_failure_test()
+{
+ TestClient *client;
+
+ client = TestClientNew("clienta");
+ ASSERT(TestClientConnect(client, "localhost", 1883, 60, 1));
+ ASSERT_FALSE(TestClientSubscribe(client, nosubscribe_topics[0], 2));
+ ASSERT_EQ(MqttSubscriptionFailure, client->subStatus);
+ TestClientDisconnect(client);
+ TestClientFree(client);
+
+ PASS();
+}
+
+GREATEST_MAIN_DEFS();
+
+int main(int argc, char **argv)
+{
+ GREATEST_MAIN_BEGIN();
+ cleanup();
+ RUN_TEST(subscribe_failure_test);
+ GREATEST_MAIN_END();
+}