}
}
+#ifdef _EVENT_DISABLE_MM_REPLACEMENT
+static void
+test_mm_functions(void *arg)
+{
+ _tinytest_set_test_skipped();
+}
+#else
static int
check_dummy_mem_ok(void *_mem)
{
if (b)
event_base_free(b);
}
+#endif
static void
many_event_cb(int fd, short event, void *arg)
}
#endif
+#ifndef _EVENT_DISABLE_MM_REPLACEMENT
static void *
failing_malloc(size_t how_much)
{
errno = ENOMEM;
return NULL;
}
+#endif
static void
test_evbuffer_readln(void *ptr)
evbuffer_validate(evb);
/* the next call to readline should fail */
+#ifndef _EVENT_DISABLE_MM_REPLACEMENT
event_set_mem_functions(failing_malloc, realloc, free);
cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
tt_assert(cp == NULL);
/* now we should get the next line back */
event_set_mem_functions(malloc, realloc, free);
+#endif
cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
tt_line_eq("two line");
free(cp); cp = NULL;