X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fblackbox%2Frun_blackbox_tests%2Ftest_cases_blacklist.c;h=8f9a118cafa43ca0f9be5d211c2d4be650c0a266;hb=fe5563f92021618b4a8b41e412c73d8364fcaf6e;hp=7324a19e9d1cc72ebfb743c0b3afe44f4bcbb834;hpb=cdb3dada645394bb1e0d0bf7816291fbd9a2a4a0;p=meshlink diff --git a/test/blackbox/run_blackbox_tests/test_cases_blacklist.c b/test/blackbox/run_blackbox_tests/test_cases_blacklist.c index 7324a19e..8f9a118c 100644 --- a/test/blackbox/run_blackbox_tests/test_cases_blacklist.c +++ b/test/blackbox/run_blackbox_tests/test_cases_blacklist.c @@ -17,6 +17,10 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#ifdef NDEBUG +#undef NDEBUG +#endif + /* Modify this to change the logging level of Meshlink */ #define TEST_MESHLINK_LOG_LEVEL MESHLINK_DEBUG @@ -95,8 +99,8 @@ static void status_cb(meshlink_handle_t *mesh, meshlink_node_t *node, bool reach but when enabled foo node should not receive data */ bool test_steps_mesh_blacklist_01(void) { - meshlink_destroy("blacklist_conf.1"); - meshlink_destroy("blacklist_conf.2"); + assert(meshlink_destroy("blacklist_conf.1")); + assert(meshlink_destroy("blacklist_conf.2")); // Open two new meshlink instance. meshlink_handle_t *mesh1 = meshlink_open("blacklist_conf.1", "foo", "blacklist", DEV_CLASS_BACKBONE); @@ -132,7 +136,7 @@ bool test_steps_mesh_blacklist_01(void) { sleep(1); assert(received); - meshlink_blacklist(mesh1, bar); + assert(meshlink_blacklist(mesh1, bar)); received = false; assert(meshlink_send(mesh2, foo, "test", 5)); @@ -142,8 +146,8 @@ bool test_steps_mesh_blacklist_01(void) { // Clean up. meshlink_close(mesh2); meshlink_close(mesh1); - meshlink_destroy("blacklist_conf.1"); - meshlink_destroy("blacklist_conf.2"); + assert(meshlink_destroy("blacklist_conf.1")); + assert(meshlink_destroy("blacklist_conf.2")); return true; } @@ -162,7 +166,7 @@ void test_case_mesh_blacklist_02(void **state) { meshlink_blacklist API handles the invalid parameter when called by giving proper error number. */ bool test_steps_mesh_blacklist_02(void) { - meshlink_destroy("blacklist_conf.3"); + assert(meshlink_destroy("blacklist_conf.3")); // Open two new meshlink instance. meshlink_handle_t *mesh = meshlink_open("blacklist_conf.3", "foo", "blacklist", DEV_CLASS_BACKBONE); @@ -172,12 +176,12 @@ bool test_steps_mesh_blacklist_02(void) { assert(node); // Passing NULL as mesh handle and node handle being some valid node handle - meshlink_blacklist(NULL, node); + assert(!meshlink_blacklist(NULL, node)); assert_int_equal(meshlink_errno, MESHLINK_EINVAL); // Clean up. meshlink_close(mesh); - meshlink_destroy("blacklist_conf.3"); + assert(meshlink_destroy("blacklist_conf.3")); return true; } @@ -196,19 +200,19 @@ void test_case_mesh_blacklist_03(void **state) { meshlink_blacklist API handles the invalid parameter when called by giving proper error number. */ bool test_steps_mesh_blacklist_03(void) { - meshlink_destroy("blacklist_conf.4"); + assert(meshlink_destroy("blacklist_conf.4")); // Open two new meshlink instance. meshlink_handle_t *mesh = meshlink_open("blacklist_conf.4", "foo", "blacklist", DEV_CLASS_BACKBONE); assert(mesh != NULL); // Passing NULL as node handle and mesh handle being some valid mesh handle value - meshlink_blacklist(mesh, NULL); + assert(!meshlink_blacklist(mesh, NULL)); assert_int_equal(meshlink_errno, MESHLINK_EINVAL); // Clean up. meshlink_close(mesh); - meshlink_destroy("blacklist_conf.4"); + assert(meshlink_destroy("blacklist_conf.4")); return true; }