X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fchannels-cornercases.c;h=b8534030086f095d8739efb9418154d7f2184f17;hb=6b125b5b68e2657eae9b36f23d7f569fb9e49f8d;hp=d4644a42c00943a1d9e57d91c4975f02fb192940;hpb=fe5563f92021618b4a8b41e412c73d8364fcaf6e;p=meshlink diff --git a/test/channels-cornercases.c b/test/channels-cornercases.c index d4644a42..b8534030 100644 --- a/test/channels-cornercases.c +++ b/test/channels-cornercases.c @@ -79,7 +79,7 @@ static void poll_cb2(meshlink_handle_t *mesh, meshlink_channel_t *channel, size_ set_sync_flag(channel->priv, true); } -int main() { +int main(void) { meshlink_set_log_cb(NULL, MESHLINK_DEBUG, log_cb); meshlink_handle_t *a, *b; @@ -96,6 +96,7 @@ int main() { 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() { // 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() { // 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);