]> git.meshlink.io Git - meshlink/blobdiff - test/trio2.c
Don't use assert() to check the results of pthread_*() calls.
[meshlink] / test / trio2.c
index 283b280a08085c951e09f557a5f48d1a82cf4e94..dc57679e706c9ac1ceb8829bc37b0a3b661e87d9 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);
 
-               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]);