]> git.meshlink.io Git - meshlink/blobdiff - test/blackbox/run_blackbox_tests/test_cases_submesh03.c
Don't fail to start MeshLink if some host config files couldn't be read.
[meshlink] / test / blackbox / run_blackbox_tests / test_cases_submesh03.c
index 76b6ef9e852e05467359c45f9b0073168beb9f76..18a80253e00a80b898504b453149060e8c38be95 100644 (file)
     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>
@@ -50,9 +55,9 @@ static mesh_event_t app1_node1[] = { NODE_STARTED, NODE_JOINED, CHANNEL_OPENED,
 static mesh_event_t app1_node2[] = { NODE_STARTED, NODE_JOINED, CHANNEL_OPENED, CHANNEL_DATA_RECIEVED, CHANNEL_OPENED, CHANNEL_DATA_RECIEVED, MESH_EVENT_COMPLETED};
 
 static node_status_t node_status[3] = {
-       {core_node1, 0, 3, false},
-       {app1_node1, 0, 4, false},
-       {app1_node2, 0, 7, false}
+       {core_node1, 0, 3},
+       {app1_node1, 0, 4},
+       {app1_node2, 0, 7},
 };
 
 /* State structure for SubMesh Test Case #3 */
@@ -64,6 +69,8 @@ static black_box_state_t test_case_submesh_3_state = {
 };
 
 static int black_box_group0_setup(void **state) {
+       (void)state;
+
        const char *nodes[] = { "corenode1", "app1node1", "app1node2" };
        int num_nodes = sizeof(nodes) / sizeof(nodes[0]);
 
@@ -75,23 +82,14 @@ static int black_box_group0_setup(void **state) {
 }
 
 static int black_box_group0_teardown(void **state) {
+       (void)state;
+
        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 void restart_all_nodes(char *import) {
        int i;
 
@@ -113,7 +111,7 @@ static bool event_cb(mesh_event_payload_t payload) {
        assert(change_state(&node_status[payload.client_id], payload.mesh_event));
 
        if(payload.mesh_event == NODE_JOINED) {
-               signal_node_start(node_status, 1, 2, node_ids);
+               signal_node_start(node_status, 1, 2, (char **)node_ids);
        }
 
        if(check_nodes_finished(node_status, 3)) {
@@ -144,10 +142,7 @@ static void test_case_submesh_03(void **state) {
 */
 static bool test_steps_submesh_03(void) {
        char *invite_app1node1, *invite_app1node2;
-       bool result = false;
-       int i;
        char *import;
-       pthread_t thread1, thread2;
 
        import = mesh_event_sock_create(eth_if_name);
        invite_app1node1 = invite_in_container("corenode1", "app1node1");
@@ -186,4 +181,4 @@ int test_cases_submesh03(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);
-}
\ No newline at end of file
+}