]> git.meshlink.io Git - meshlink/blobdiff - test/trio.c
Don't use assert() to check the results of pthread_*() calls.
[meshlink] / test / trio.c
index a183b3da92493d09e299989f843b160ec2bb93b9..bdb3904e37e4540faf734e4bd5c7c145f3eddd35 100644 (file)
@@ -47,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.
@@ -65,7 +69,7 @@ int main() {
                assert(mesh[i]);
                free(path);
 
-               assert(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]);