]> git.meshlink.io Git - meshlink/blobdiff - test/channels-cornercases.c
Fix warnings and missing mutex/cond initialization in the test suite.
[meshlink] / test / channels-cornercases.c
index 3b605bb53ae4143381a14d0f8deaddb880cfb1d2..b8534030086f095d8739efb9418154d7f2184f17 100644 (file)
@@ -96,6 +96,7 @@ int main(void) {
        assert(nb);
 
        struct sync_flag channel_opened = {.flag = false};
+       init_sync_flag(&channel_opened);
 
        meshlink_channel_t *channel = meshlink_channel_open(a, nb, 7, a_receive_cb, &channel_opened, 0);
        assert(channel);
@@ -136,6 +137,7 @@ int main(void) {
        // Send a message to b
 
        struct sync_flag channel_closed = {.flag = false};
+       init_sync_flag(&channel_closed);
        channel->priv = &channel_closed;
 
        assert(meshlink_channel_send(a, channel, "Hello", 5) == 5);
@@ -146,6 +148,7 @@ int main(void) {
        // Try to create a second channel
 
        struct sync_flag channel_polled = {.flag = false};
+       init_sync_flag(&channel_polled);
 
        meshlink_channel_t *channel2 = meshlink_channel_open(a, nb, 7, a_receive_cb, &channel_polled, 0);
        assert(channel2);