]> git.meshlink.io Git - meshlink/blobdiff - test/blackbox/run_blackbox_tests/test_cases_set_log_cb.c
Fix __warn_unused_result__, add more of it and fix the resulting warnings.
[meshlink] / test / blackbox / run_blackbox_tests / test_cases_set_log_cb.c
index 71019a13b0f0ec0ebcfe4352f0e524638e594078..da49558432dbb1972eaa82849ff6364a4479441b 100644 (file)
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
+
 #include "execute_tests.h"
 #include "test_cases_set_log_cb.h"
 #include "../common/containers.h"
@@ -38,8 +42,6 @@ static void test_case_set_log_cb_01(void **state);
 static bool test_set_log_cb_01(void);
 static void test_case_set_log_cb_02(void **state);
 static bool test_set_log_cb_02(void);
-static void test_case_set_log_cb_03(void **state);
-static bool test_set_log_cb_03(void);
 
 /* log variable gives access to the log callback to know whether invoked or not */
 static bool log;
@@ -57,6 +59,9 @@ static black_box_state_t test_case_set_log_cb_02_state = {
 
 /* log callback */
 static void log_cb(meshlink_handle_t *mesh, meshlink_log_level_t level, const char *text) {
+       (void)mesh;
+       (void)level;
+
        fprintf(stderr, "Received log text : %s\n", text);
        log = true;
 }
@@ -75,7 +80,7 @@ static void test_case_set_log_cb_01(void **state) {
     log callback should be invoked when NUT joins with relay.
 */
 static bool test_set_log_cb_01(void) {
-       meshlink_destroy("logconf");
+       assert(meshlink_destroy("logconf"));
 
        // Create meshlink instance for NUT
 
@@ -99,7 +104,7 @@ static bool test_set_log_cb_01(void) {
        // closing meshes and destroying confbase
 
        meshlink_close(mesh);
-       meshlink_destroy("logconf");
+       assert(meshlink_destroy("logconf"));
 
        return true;
 }