X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Ftrio.c;h=a183b3da92493d09e299989f843b160ec2bb93b9;hb=HEAD;hp=a60d0f26061eae31102005f74389f390f4934c77;hpb=9a2520c36431a8a5fd90451e97f488c22f4decc5;p=meshlink diff --git a/test/trio.c b/test/trio.c index a60d0f26..bdb3904e 100644 --- a/test/trio.c +++ b/test/trio.c @@ -1,5 +1,9 @@ #define _GNU_SOURCE +#ifdef NDEBUG +#undef NDEBUG +#endif + #include #include #include @@ -43,7 +47,11 @@ static void baz_status_cb(meshlink_handle_t *mesh, meshlink_node_t *node, bool r } } -int main() { +int main(void) { + init_sync_flag(&received); + init_sync_flag(&bar_learned_baz); + init_sync_flag(&baz_learned_bar); + meshlink_set_log_cb(NULL, MESHLINK_DEBUG, log_cb); // Create three instances. @@ -61,7 +69,7 @@ int main() { assert(mesh[i]); free(path); - meshlink_add_address(mesh[i], "localhost"); + assert(meshlink_set_canonical_address(mesh[i], meshlink_get_self(mesh[i]), "localhost", NULL)); data[i] = meshlink_export(mesh[i]); assert(data[i]);