]> git.meshlink.io Git - meshlink/blobdiff - test/get-all-nodes.c
Don't use assert() to check the results of pthread_*() calls.
[meshlink] / test / get-all-nodes.c
index 3340982b15f6f5a33a1d7371db853544a2e5d79b..152184c67a7a4092a03bfdf57481c7cb575f80f4 100644 (file)
@@ -24,6 +24,8 @@ static void status_cb(meshlink_handle_t *mesh, meshlink_node_t *node, bool reach
 }
 
 int main(void) {
+       init_sync_flag(&bar_reachable);
+
        struct meshlink_node **nodes = NULL;
        size_t nnodes = 0;
 
@@ -36,10 +38,10 @@ int main(void) {
        assert(meshlink_destroy("get_all_nodes_conf.3"));
 
        meshlink_handle_t *mesh[3];
-       mesh[0] = meshlink_open("get_all_nodes_conf.1", "foo", "import-export", DEV_CLASS_BACKBONE);
+       mesh[0] = meshlink_open("get_all_nodes_conf.1", "foo", "get-all-nodes", DEV_CLASS_BACKBONE);
        assert(mesh[0]);
 
-       mesh[1] = meshlink_open("get_all_nodes_conf.2", "bar", "import-export", DEV_CLASS_STATIONARY);
+       mesh[1] = meshlink_open("get_all_nodes_conf.2", "bar", "get-all-nodes", DEV_CLASS_STATIONARY);
        assert(mesh[1]);
 
        mesh[2] = meshlink_open("get_all_nodes_conf.3", "baz", "get-all-nodes", DEV_CLASS_STATIONARY);
@@ -169,7 +171,7 @@ int main(void) {
        meshlink_close(mesh[0]);
        sleep(2);
        time_t foo_stopped = time(NULL);
-       mesh[0] = meshlink_open("get_all_nodes_conf.1", "foo", "import-export", DEV_CLASS_BACKBONE);
+       mesh[0] = meshlink_open("get_all_nodes_conf.1", "foo", "get-all_nodes", DEV_CLASS_BACKBONE);
        assert(mesh[0]);
 
        nodes = meshlink_get_all_nodes(mesh[0], nodes, &nnodes);