aboutsummaryrefslogtreecommitdiff
path: root/test/interop/subscribe_failure_test.c
blob: 07a0d1bbcea79b30aee4d4c0b78320cf55509a7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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[0]);
    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();
}