]> git.meshlink.io Git - meshlink/blobdiff - test/blackbox/run_blackbox_tests/test_cases_submesh02.c
Fix spelling errors.
[meshlink] / test / blackbox / run_blackbox_tests / test_cases_submesh02.c
index 13c87d0dbc096a1a603d341071a5e7a726c1d089..9f21850acd5a53d156a3addc363617fc2e6e71d4 100644 (file)
     with this program; if not, write to the Free Software Foundation, Inc.,
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
     with this program; if not, write to the Free Software Foundation, Inc.,
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
+
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
+
 #include <stdlib.h>
 #include <stdarg.h>
 #include <setjmp.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <setjmp.h>
@@ -71,6 +76,8 @@ static black_box_state_t test_case_submesh_2_state = {
 };
 
 static int black_box_group0_setup(void **state) {
 };
 
 static int black_box_group0_setup(void **state) {
+       (void)state;
+
        const char *nodes[] = { "corenode1", "app1node1", "app2node1", "corenode2", "app1node2", "app2node2" };
        int num_nodes = sizeof(nodes) / sizeof(nodes[0]);
 
        const char *nodes[] = { "corenode1", "app1node1", "app2node1", "corenode2", "app1node2", "app2node2" };
        int num_nodes = sizeof(nodes) / sizeof(nodes[0]);
 
@@ -82,38 +89,29 @@ static int black_box_group0_setup(void **state) {
 }
 
 static int black_box_group0_teardown(void **state) {
 }
 
 static int black_box_group0_teardown(void **state) {
+       (void)state;
+
        PRINT_TEST_CASE_MSG("Destroying Containers\n");
        destroy_containers();
 
        return 0;
 }
 
        PRINT_TEST_CASE_MSG("Destroying Containers\n");
        destroy_containers();
 
        return 0;
 }
 
-static int black_box_all_nodes_setup(void **state) {
-       const char *nodes[] = { "corenode1" };
-       int num_nodes = sizeof(nodes) / sizeof(nodes[0]);
-
-       PRINT_TEST_CASE_MSG("Creating Containers\n");
-       destroy_containers();
-       create_containers(nodes, num_nodes);
-       PRINT_TEST_CASE_MSG("Created Containers\n");
-       return 0;
-}
-
 static bool event_cb(mesh_event_payload_t payload) {
        static node_status_t node_status[6] = {
 static bool event_cb(mesh_event_payload_t payload) {
        static node_status_t node_status[6] = {
-               {core_node1, 0, 3, false},
-               {app1_node1, 0, 4, false},
-               {app2_node1, 0, 4, false},
-               {core_node2, 0, 4, false},
-               {app1_node2, 0, 7, false},
-               {app2_node2, 0, 7, false}
+               {core_node1, 0, 3},
+               {app1_node1, 0, 4},
+               {app2_node1, 0, 4},
+               {core_node2, 0, 4},
+               {app1_node2, 0, 7},
+               {app2_node2, 0, 7},
        };
 
        fprintf(stderr, "%s(%lu) : %s\n", event_node_name[payload.client_id], time(NULL), event_status[payload.mesh_event]);
        assert(change_state(&node_status[payload.client_id], payload.mesh_event));
 
        if(payload.mesh_event == NODE_JOINED) {
        };
 
        fprintf(stderr, "%s(%lu) : %s\n", event_node_name[payload.client_id], time(NULL), event_status[payload.mesh_event]);
        assert(change_state(&node_status[payload.client_id], payload.mesh_event));
 
        if(payload.mesh_event == NODE_JOINED) {
-               signal_node_start(node_status, 1, 5, node_ids);
+               signal_node_start(node_status, 1, 5, (char **)node_ids);
        }
 
        if(check_nodes_finished(node_status, 6)) {
        }
 
        if(check_nodes_finished(node_status, 6)) {
@@ -136,7 +134,7 @@ static void test_case_submesh_02(void **state) {
     2. Generate invites to app1node1, app2node1, corenode2, app1node2 and app2node2
         from corenode1 to join corenode1.
     3. After Join is successful start channels from all nodes and exchange data on channels
     2. Generate invites to app1node1, app2node1, corenode2, app1node2 and app2node2
         from corenode1 to join corenode1.
     3. After Join is successful start channels from all nodes and exchange data on channels
-    4. Try to fetch the list of all nodes and check if the nodes in other submesh doesnot
+    4. Try to fetch the list of all nodes and check if the nodes in other submesh does not
        appear in the list.
     5. Try fetch all the nodes with a submesh handle and check only if both the nodes joining
        the submesh are present.
        appear in the list.
     5. Try fetch all the nodes with a submesh handle and check only if both the nodes joining
        the submesh are present.
@@ -148,10 +146,7 @@ static void test_case_submesh_02(void **state) {
 */
 static bool test_steps_submesh_02(void) {
        char *invite_corenode2, *invite_app1node1, *invite_app2node1, *invite_app1node2, *invite_app2node2;
 */
 static bool test_steps_submesh_02(void) {
        char *invite_corenode2, *invite_app1node1, *invite_app2node1, *invite_app1node2, *invite_app2node2;
-       bool result = false;
-       int i;
        char *import;
        char *import;
-       pthread_t thread1, thread2;
 
        import = mesh_event_sock_create(eth_if_name);
        invite_corenode2 = invite_in_container("corenode1", "corenode2");
 
        import = mesh_event_sock_create(eth_if_name);
        invite_corenode2 = invite_in_container("corenode1", "corenode2");
@@ -191,4 +186,4 @@ int test_cases_submesh02(void) {
        total_tests += sizeof(blackbox_group0_tests) / sizeof(blackbox_group0_tests[0]);
 
        return cmocka_run_group_tests(blackbox_group0_tests, black_box_group0_setup, black_box_group0_teardown);
        total_tests += sizeof(blackbox_group0_tests) / sizeof(blackbox_group0_tests[0]);
 
        return cmocka_run_group_tests(blackbox_group0_tests, black_box_group0_setup, black_box_group0_teardown);
-}
\ No newline at end of file
+}