51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
+
#include "execute_tests.h"
#include "test_cases_set_connection_try_cb.h"
#include "../common/test_step.h"
/* Meta-connection try callback handler */
static void connection_try_cb(meshlink_handle_t *mesh, meshlink_node_t *source) {
+ (void)source;
+
if(!strcmp(mesh->name, "foo")) {
++connection_attempts;
After closing bar node it should invoke 3 connection try callbacks in span of about 30 seconds.
*/
static bool test_set_connection_try_cb_01(void) {
- meshlink_destroy("meshlink_conf.1");
- meshlink_destroy("meshlink_conf.2");
+ assert(meshlink_destroy("meshlink_conf.1"));
+ assert(meshlink_destroy("meshlink_conf.2"));
// Opening foo and bar nodes
meshlink_handle_t *mesh1 = meshlink_open("meshlink_conf.1", "foo", "test", DEV_CLASS_STATIONARY);
assert(exp1 != NULL);
char *exp2 = meshlink_export(mesh2);
assert(exp2 != NULL);
- bool imp1 = meshlink_import(mesh1, exp2);
- bool imp2 = meshlink_import(mesh2, exp1);
+ assert(meshlink_import(mesh1, exp2));
+ assert(meshlink_import(mesh2, exp1));
free(exp1);
free(exp2);
assert_in_range(attempt_time_stop - attempt_time_start, 25, 45);
// Cleanup
- meshlink_destroy("meshlink_conf.1");
- meshlink_destroy("meshlink_conf.2");
+ assert(meshlink_destroy("meshlink_conf.1"));
+ assert(meshlink_destroy("meshlink_conf.2"));
return true;
}