X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fblackbox%2Frun_blackbox_tests%2Ftest_cases_invite.c;h=929b002ab3241fa663259960b6b00101d1509761;hb=fe5563f92021618b4a8b41e412c73d8364fcaf6e;hp=cd5b7faf5f8c88ea351fc70ba71d75ee6be6080d;hpb=cdb3dada645394bb1e0d0bf7816291fbd9a2a4a0;p=meshlink diff --git a/test/blackbox/run_blackbox_tests/test_cases_invite.c b/test/blackbox/run_blackbox_tests/test_cases_invite.c index cd5b7faf..929b002a 100644 --- a/test/blackbox/run_blackbox_tests/test_cases_invite.c +++ b/test/blackbox/run_blackbox_tests/test_cases_invite.c @@ -17,6 +17,10 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#ifdef NDEBUG +#undef NDEBUG +#endif + #include "execute_tests.h" #include "test_cases_invite.h" #include "../common/containers.h" @@ -74,7 +78,7 @@ static void test_case_invite_01(void **state) { Generates an invitation */ static bool test_invite_01(void) { - meshlink_destroy("inviteconf"); + assert(meshlink_destroy("inviteconf")); meshlink_set_log_cb(NULL, TEST_MESHLINK_LOG_LEVEL, meshlink_callback_logger); // Create meshlink instance @@ -87,7 +91,7 @@ static bool test_invite_01(void) { free(invitation); meshlink_close(mesh_handle); - meshlink_destroy("inviteconf"); + assert(meshlink_destroy("inviteconf")); return true; } @@ -123,7 +127,7 @@ static void test_case_invite_03(void **state) { Reports appropriate error by returning NULL */ static bool test_invite_03(void) { - meshlink_destroy("inviteconf"); + assert(meshlink_destroy("inviteconf")); meshlink_set_log_cb(NULL, TEST_MESHLINK_LOG_LEVEL, meshlink_callback_logger); // Create meshlink instance @@ -136,7 +140,7 @@ static bool test_invite_03(void) { assert_int_equal(invitation, NULL); meshlink_close(mesh_handle); - meshlink_destroy("inviteconf"); + assert(meshlink_destroy("inviteconf")); return true; } @@ -155,7 +159,7 @@ static void test_case_invite_04(void **state) { Newly added address should be there in the invitation. */ static bool test_invite_04(void) { - meshlink_destroy("inviteconf"); + assert(meshlink_destroy("inviteconf")); meshlink_set_log_cb(NULL, TEST_MESHLINK_LOG_LEVEL, meshlink_callback_logger); // Create meshlink instance @@ -164,12 +168,12 @@ static bool test_invite_04(void) { meshlink_set_log_cb(mesh_handle, TEST_MESHLINK_LOG_LEVEL, meshlink_callback_logger); char *hostname1 = "127.1.1.1"; - meshlink_add_address(mesh_handle, hostname1); + assert(meshlink_add_address(mesh_handle, hostname1)); char *invitation = meshlink_invite(mesh_handle, NULL, "foo"); assert_int_not_equal(strstr(invitation, hostname1), NULL); char *hostname2 = "127.1.2.3"; - meshlink_add_address(mesh_handle, hostname2); + assert(meshlink_add_address(mesh_handle, hostname2)); invitation = meshlink_invite(mesh_handle, NULL, "bar"); // Verify we have both the added addresses @@ -177,7 +181,7 @@ static bool test_invite_04(void) { assert_int_not_equal(strstr(invitation, hostname2), NULL); meshlink_close(mesh_handle); - meshlink_destroy("inviteconf"); + assert(meshlink_destroy("inviteconf")); return true; }