]> granicus.if.org Git - libevent/commitdiff
Make main/methods test pass on systems where only one backend exists.
authorNick Mathewson <nickm@torproject.org>
Thu, 23 Apr 2009 18:08:42 +0000 (18:08 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 23 Apr 2009 18:08:42 +0000 (18:08 +0000)
svn:r1235

test/regress.c

index 2af6c80a732ee85a36610aad423be91afd760fc6..d7161ec3d686de7bc18399655a29cf08ab636924 100644 (file)
@@ -1368,20 +1368,18 @@ test_methods(void *ptr)
                ++n_methods;
        }
 
-       if (n_methods > 1) {
-               /* only one method supported; can't continue. */
-                goto end;
-       }
-
        cfg = event_config_new();
        assert(cfg != NULL);
 
        tt_int_op(event_config_avoid_method(cfg, backend), ==, 0);
 
        base = event_base_new_with_config(cfg);
-        tt_assert(base);
-
-       tt_str_op(backend, !=, event_base_get_method(base));
+       if (n_methods > 1) {
+               tt_assert(base);
+               tt_str_op(backend, !=, event_base_get_method(base));
+       } else {
+               tt_assert(base == NULL);
+       }
 
 end:
         if (base)