51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
+
#include "execute_tests.h"
#include "test_cases_channel_shutdown.h"
#include "../common/containers.h"
static bool test_steps_mesh_channel_shutdown_02(void);
static void test_case_mesh_channel_shutdown_03(void **state);
static bool test_steps_mesh_channel_shutdown_03(void);
-static void test_case_mesh_channel_shutdown_04(void **state);
-static bool test_steps_mesh_channel_shutdown_04(void);
-static void test_case_mesh_channel_shutdown_05(void **state);
-static bool test_steps_mesh_channel_shutdown_05(void);
static void receive_cb(meshlink_handle_t *mesh, meshlink_channel_t *channel, const void *dat, size_t len);
-static void status_cb(meshlink_handle_t *mesh, meshlink_node_t *node, bool reachable);
static void poll_cb(meshlink_handle_t *mesh, meshlink_channel_t *channel, size_t len);
/* State structure for meshlink_channel_shutdown Test Case #1 */
.test_case_name = "test_case_mesh_channel_shutdown_03",
};
-/* State structure for meshlink_channel_shutdown Test Case #4 */
-static black_box_state_t test_mesh_channel_shutdown_04_state = {
- .test_case_name = "test_case_mesh_channel_shutdown_04",
-};
-
-/* State structure for meshlink_channel_shutdown Test Case #5 */
-static black_box_state_t test_mesh_channel_shutdown_05_state = {
- .test_case_name = "test_case_mesh_channel_shutdown_05",
-};
-
static bool channel_acc;
static bool polled;
static bool foo_responded;
static pthread_cond_t bar_cond = PTHREAD_COND_INITIALIZER;
static bool accept_cb(meshlink_handle_t *mesh, meshlink_channel_t *channel, uint16_t port, const void *data, size_t len) {
+ (void)data;
+
assert(port == 7);
assert(!len);
/* channel receive callback */
static void receive_cb(meshlink_handle_t *mesh, meshlink_channel_t *channel, const void *dat, size_t len) {
+ (void)dat;
+ (void)len;
+
if(!strcmp(mesh->name, "foo")) {
pthread_mutex_lock(& foo_responded_lock);
foo_responded = true;
*/
static bool test_steps_mesh_channel_shutdown_01(void) {
struct timespec timeout = {0};
- meshlink_destroy("chan_shutdown_conf.1");
- meshlink_destroy("chan_shutdown_conf.2");
+ assert(meshlink_destroy("chan_shutdown_conf.1"));
+ assert(meshlink_destroy("chan_shutdown_conf.2"));
// Open two new meshlink instance.
meshlink_handle_t *mesh1 = meshlink_open("chan_shutdown_conf.1", "foo", "channels", DEV_CLASS_BACKBONE);
pthread_mutex_unlock(&accept_lock);
- meshlink_channel_t *channel2 = bar->priv;
-
// Sending to bar and testing the echo
assert(meshlink_channel_send(mesh1, channel1, "echo", 4) >= 0);
meshlink_close(mesh2);
meshlink_close(mesh1);
- meshlink_destroy("chan_shutdown_conf.1");
- meshlink_destroy("chan_shutdown_conf.2");
+ assert(meshlink_destroy("chan_shutdown_conf.1"));
+ assert(meshlink_destroy("chan_shutdown_conf.2"));
return true;
}
meshlink_channel_shutdown API should report proper error handling
*/
static bool test_steps_mesh_channel_shutdown_02(void) {
- meshlink_destroy("channelshutdownconf.3");
+ assert(meshlink_destroy("channelshutdownconf.3"));
meshlink_set_log_cb(NULL, TEST_MESHLINK_LOG_LEVEL, meshlink_callback_logger);
/* Create meshlink instance */
assert_int_equal(meshlink_errno, MESHLINK_EINVAL);
meshlink_close(mesh_handle);
- meshlink_destroy("channelshutdownconf.3");
+ assert(meshlink_destroy("channelshutdownconf.3"));
return true;
}
meshlink_channel_shutdown API should report proper error handling
*/
static bool test_steps_mesh_channel_shutdown_03(void) {
- meshlink_destroy("channelshutdownconf.4");
+ assert(meshlink_destroy("channelshutdownconf.4"));
meshlink_set_log_cb(NULL, TEST_MESHLINK_LOG_LEVEL, meshlink_callback_logger);
/* Create meshlink instance */
assert_int_equal(meshlink_errno, MESHLINK_EINVAL);
meshlink_close(mesh_handle);
- meshlink_destroy("channelshutdownconf.4");
+ assert(meshlink_destroy("channelshutdownconf.4"));
return true;
}