]> git.meshlink.io Git - meshlink/blobdiff - test/blackbox/run_blackbox_tests/test_cases_channel_ex.c
Fix __warn_unused_result__, add more of it and fix the resulting warnings.
[meshlink] / test / blackbox / run_blackbox_tests / test_cases_channel_ex.c
index aa6fa23d0c9e395deff41ac6fce4879d8807b07e..74c3a3e66b3012afb56e019fee2e7429731d6fff 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 "execute_tests.h"
 #include "test_cases_channel_ex.h"
 #include "../common/containers.h"
@@ -73,10 +78,6 @@ static black_box_state_t test_case_channel_ex_05_state = {
 static black_box_state_t test_case_channel_ex_06_state = {
        .test_case_name = "test_case_channel_ex_06",
 };
-static black_box_state_t test_case_channel_ex_07_state = {
-       .test_case_name = "test_case_channel_ex_07",
-};
-
 /* mutex for the common variable */
 static pthread_mutex_t accept_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_cond_t accept_cond = PTHREAD_COND_INITIALIZER;
@@ -94,9 +95,11 @@ static void cb(meshlink_handle_t *mesh, meshlink_channel_t *channel, const void
 }
 
 static bool channel_accept(meshlink_handle_t *mesh, meshlink_channel_t *channel, uint16_t port, const void *dat, size_t len) {
+       (void)mesh;
+       (void)channel;
        (void)dat;
        (void)len;
-       char *data = (char *) dat;
+
        assert_int_equal(port, PORT);
 
        pthread_mutex_lock(&accept_lock);
@@ -161,7 +164,7 @@ static bool test_steps_channel_ex_01(void) {
        assert_int_equal(ret, true);
 
        meshlink_close(mesh_handle);
-       meshlink_destroy("channelexconf");
+       assert(meshlink_destroy("channelexconf"));
 
        return true;
 }
@@ -214,7 +217,7 @@ static bool test_steps_channel_ex_02(void) {
        assert_int_equal(ret, true);
 
        meshlink_close(mesh_handle);
-       meshlink_destroy("channelexconf");
+       assert(meshlink_destroy("channelexconf"));
        return true;
 }
 
@@ -266,7 +269,7 @@ static bool test_steps_channel_ex_03(void) {
        assert_int_equal(ret, true);
 
        meshlink_close(mesh_handle);
-       meshlink_destroy("channelexconf");
+       assert(meshlink_destroy("channelexconf"));
        return true;
 }
 
@@ -318,7 +321,7 @@ static bool test_steps_channel_ex_04(void) {
        assert_int_equal(ret, true);
 
        meshlink_close(mesh_handle);
-       meshlink_destroy("channelexconf");
+       assert(meshlink_destroy("channelexconf"));
        return true;
 }
 
@@ -358,7 +361,7 @@ static bool test_steps_channel_ex_05(void) {
        assert(channel == NULL);
 
        meshlink_close(mesh_handle);
-       meshlink_destroy("channelexconf");
+       assert(meshlink_destroy("channelexconf"));
        return true;
 }
 
@@ -396,7 +399,7 @@ static bool test_steps_channel_ex_06(void) {
        assert_int_equal(channel, NULL);
 
        meshlink_close(mesh_handle);
-       meshlink_destroy("channelexconf");
+       assert(meshlink_destroy("channelexconf"));
        return true;
 }