X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fblackbox%2Frun_blackbox_tests%2Ftest_cases_channel_set_poll_cb.c;h=5ad8f03d6c2d99de657cdc3d27f16b6f4438bfff;hb=fe5563f92021618b4a8b41e412c73d8364fcaf6e;hp=5e1d63ed7c8301bb3355f7d4ba090fbb7d7bf69a;hpb=1c04402a6d2f3a85d0cb4a5b4a6db5b1f3a79511;p=meshlink diff --git a/test/blackbox/run_blackbox_tests/test_cases_channel_set_poll_cb.c b/test/blackbox/run_blackbox_tests/test_cases_channel_set_poll_cb.c index 5e1d63ed..5ad8f03d 100644 --- a/test/blackbox/run_blackbox_tests/test_cases_channel_set_poll_cb.c +++ b/test/blackbox/run_blackbox_tests/test_cases_channel_set_poll_cb.c @@ -16,6 +16,11 @@ 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 "execute_tests.h" #include "test_cases_channel_set_poll_cb.h" #include "../common/containers.h" @@ -80,6 +85,13 @@ static void poll_cb(meshlink_handle_t *mesh, meshlink_channel_t *channel, size_t } static void node_status_cb(meshlink_handle_t *mesh, meshlink_node_t *source, bool reach) { + (void)mesh; + (void)source; + + if(!reach) { + return; + } + pthread_mutex_lock(&reachable_lock); reachable = true; assert(!pthread_cond_broadcast(&reachable_cond)); @@ -102,8 +114,8 @@ static void test_case_channel_set_poll_cb_01(void **state) { static bool test_steps_channel_set_poll_cb_01(void) { /* deleting the confbase if already exists */ struct timespec timeout = {0}; - meshlink_destroy("pollconf1"); - meshlink_destroy("pollconf2"); + assert(meshlink_destroy("pollconf1")); + assert(meshlink_destroy("pollconf2")); meshlink_set_log_cb(NULL, TEST_MESHLINK_LOG_LEVEL, meshlink_callback_logger); /* Create meshlink instances */ @@ -158,8 +170,8 @@ static bool test_steps_channel_set_poll_cb_01(void) { /* closing channel, meshes and destroying confbase */ meshlink_close(mesh1); meshlink_close(mesh2); - meshlink_destroy("pollconf1"); - meshlink_destroy("pollconf2"); + assert(meshlink_destroy("pollconf1")); + assert(meshlink_destroy("pollconf2")); return true; } @@ -200,7 +212,7 @@ static bool test_steps_channel_set_poll_cb_02(void) { assert_int_not_equal(meshlink_errno, 0); meshlink_close(mesh_handle); - meshlink_destroy("channelpollconf3"); + assert(meshlink_destroy("channelpollconf3")); return true; } @@ -233,7 +245,7 @@ static bool test_steps_channel_set_poll_cb_03(void) { assert_int_equal(meshlink_errno, MESHLINK_EINVAL); meshlink_close(mesh_handle); - meshlink_destroy("channelpollconf4"); + assert(meshlink_destroy("channelpollconf4")); return true; }