]> granicus.if.org Git - libevent/commitdiff
Fix compilation with mm-replacement disabled.
authorNick Mathewson <nickm@torproject.org>
Tue, 3 Apr 2012 18:54:39 +0000 (14:54 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 3 Apr 2012 18:54:39 +0000 (14:54 -0400)
test/regress.c
test/regress_util.c

index 49c40efd5af630f132b12e824f8f69d89f44b12d..0b68650c59edea6f1a085bbfd3e12be3dcd539ed 100644 (file)
@@ -2244,7 +2244,7 @@ end:
 static void
 test_mm_functions(void *arg)
 {
-       _tinytest_set_test_skipped();
+       tinytest_set_test_skipped_();
 }
 #else
 static int
index fce093f26322438e917bb609271e1e7873a7765a..e7662e0fb2ae2241cf373724ab674a6dfd79381b 100644 (file)
@@ -1081,10 +1081,12 @@ test_event_malloc(void *arg)
        (void)arg;
 
        /* mm_malloc(0) should simply return NULL. */
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
        errno = 0;
        p = mm_malloc(0);
        tt_assert(p == NULL);
        tt_int_op(errno, ==, 0);
+#endif
 
        /* Trivial case. */
        errno = 0;
@@ -1104,6 +1106,7 @@ test_event_calloc(void *arg)
        void *p = NULL;
        (void)arg;
 
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
        /* mm_calloc() should simply return NULL
         * if either argument is zero. */
        errno = 0;
@@ -1118,6 +1121,7 @@ test_event_calloc(void *arg)
        p = mm_calloc(1, 0);
        tt_assert(p == NULL);
        tt_int_op(errno, ==, 0);
+#endif
 
        /* Trivial case. */
        errno = 0;
@@ -1144,11 +1148,13 @@ test_event_strdup(void *arg)
        void *p = NULL;
        (void)arg;
 
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
        /* mm_strdup(NULL) should set errno = EINVAL and return NULL. */
        errno = 0;
        p = mm_strdup(NULL);
        tt_assert(p == NULL);
        tt_int_op(errno, ==, EINVAL);
+#endif
 
        /* Trivial cases. */