CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: joerg Date: Sun May 30 00:19:09 UTC 2021 Modified Files: src/external/bsd/libevent/dist/test: regress_ssl.c Log Message: Cast to enums via uintptr_t to avoid compiler warnings. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/libevent/dist/test/regress_ssl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress_ssl.c diff -u src/external/bsd/libevent/dist/test/regress_ssl.c:1.5 src/external/bsd/libevent/dist/test/regress_ssl.c:1.6 --- src/external/bsd/libevent/dist/test/regress_ssl.c:1.5 Wed Apr 7 03:36:48 2021 +++ src/external/bsd/libevent/dist/test/regress_ssl.c Sun May 30 00:19:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: regress_ssl.c,v 1.5 2021/04/07 03:36:48 christos Exp $ */ +/* $NetBSD: regress_ssl.c,v 1.6 2021/05/30 00:19:08 joerg Exp $ */ /* * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson @@ -891,7 +891,7 @@ regress_bufferevent_openssl_wm(void *arg struct sockaddr_in sin; struct sockaddr_storage ss; enum regress_openssl_type type = - (enum regress_openssl_type)data->setup_data; + (enum regress_openssl_type)(uintptr_t)data->setup_data; int bev_flags = BEV_OPT_CLOSE_ON_FREE; ev_socklen_t slen; SSL *ssl;
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: rillig Date: Sat Apr 10 19:27:16 UTC 2021 Modified Files: src/external/bsd/libevent/dist/test: regress_http.c Log Message: tests/libevent: fix Clang build No idea why GCC did not complain about this as well. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/bsd/libevent/dist/test/regress_http.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress_http.c diff -u src/external/bsd/libevent/dist/test/regress_http.c:1.9 src/external/bsd/libevent/dist/test/regress_http.c:1.10 --- src/external/bsd/libevent/dist/test/regress_http.c:1.9 Sat Apr 10 19:18:45 2021 +++ src/external/bsd/libevent/dist/test/regress_http.c Sat Apr 10 19:27:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: regress_http.c,v 1.9 2021/04/10 19:18:45 rillig Exp $ */ +/* $NetBSD: regress_http.c,v 1.10 2021/04/10 19:27:16 rillig Exp $ */ /* * Copyright (c) 2003-2007 Niels Provos @@ -36,7 +36,7 @@ #include "event2/event-config.h" #include -__RCSID("$NetBSD: regress_http.c,v 1.9 2021/04/10 19:18:45 rillig Exp $"); +__RCSID("$NetBSD: regress_http.c,v 1.10 2021/04/10 19:27:16 rillig Exp $"); #include #include @@ -4580,7 +4580,11 @@ http_request_own_test(void *arg) test_ok = 1; } -static void http_run_bev_request(struct event_base *base, int port, +static void +#ifdef __GNUC__ + __attribute__((format(printf, 3, 4))) +#endif +http_run_bev_request(struct event_base *base, int port, const char *fmt, ...) { struct bufferevent *bev = NULL;
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: joerg Date: Fri Aug 28 13:04:48 UTC 2015 Modified Files: src/external/bsd/libevent/dist/test: regress_buffer.c Log Message: Simplify. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libevent/dist/test/regress_buffer.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress_buffer.c diff -u src/external/bsd/libevent/dist/test/regress_buffer.c:1.4 src/external/bsd/libevent/dist/test/regress_buffer.c:1.5 --- src/external/bsd/libevent/dist/test/regress_buffer.c:1.4 Thu Jan 29 07:26:02 2015 +++ src/external/bsd/libevent/dist/test/regress_buffer.c Fri Aug 28 13:04:48 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: regress_buffer.c,v 1.4 2015/01/29 07:26:02 spz Exp $ */ +/* $NetBSD: regress_buffer.c,v 1.5 2015/08/28 13:04:48 joerg Exp $ */ /* * Copyright (c) 2003-2007 Niels Provos pro...@citi.umich.edu * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson @@ -33,7 +33,7 @@ #include event2/event-config.h #include sys/cdefs.h -__RCSID($NetBSD: regress_buffer.c,v 1.4 2015/01/29 07:26:02 spz Exp $); +__RCSID($NetBSD: regress_buffer.c,v 1.5 2015/08/28 13:04:48 joerg Exp $); #include sys/types.h #include sys/stat.h @@ -199,7 +199,7 @@ test_evbuffer(void *ptr) tt_assert(evbuffer_get_length(evb_two) == 0); tt_assert(evbuffer_get_length(evb) == 7); - tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), 1/hello, 7) != 0); + tt_assert(memcmp((char*)EVBUFFER_DATA(evb), 1/hello, 7) == 0); memset(buffer, 0, sizeof(buffer)); evbuffer_add(evb, buffer, sizeof(buffer));
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: joerg Date: Sat Jan 31 12:12:17 UTC 2015 Modified Files: src/external/bsd/libevent/dist/test: regress.h Log Message: timeval fields might not be int, so use imaxabs. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libevent/dist/test/regress.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress.h diff -u src/external/bsd/libevent/dist/test/regress.h:1.4 src/external/bsd/libevent/dist/test/regress.h:1.5 --- src/external/bsd/libevent/dist/test/regress.h:1.4 Thu Jan 29 07:26:02 2015 +++ src/external/bsd/libevent/dist/test/regress.h Sat Jan 31 12:12:17 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: regress.h,v 1.4 2015/01/29 07:26:02 spz Exp $ */ +/* $NetBSD: regress.h,v 1.5 2015/01/31 12:12:17 joerg Exp $ */ /* * Copyright (c) 2000-2007 Niels Provos pro...@citi.umich.edu * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson @@ -112,7 +112,7 @@ int _test_ai_eq(const struct evutil_addr } while (/*CONSTCOND*/0) #define test_timeval_diff_leq(tv1, tv2, diff, tolerance) \ - tt_int_op(abs(timeval_msec_diff((tv1), (tv2)) - diff), =, tolerance) + tt_int_op(imaxabs(timeval_msec_diff((tv1), (tv2)) - diff), =, tolerance) #define test_timeval_diff_eq(tv1, tv2, diff)\ test_timeval_diff_leq((tv1), (tv2), (diff), 50)
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: joerg Date: Thu Feb 27 18:11:04 UTC 2014 Modified Files: src/external/bsd/libevent/dist/test: regress.h Log Message: time_t is larger than int, so don't use abs. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libevent/dist/test/regress.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress.h diff -u src/external/bsd/libevent/dist/test/regress.h:1.2 src/external/bsd/libevent/dist/test/regress.h:1.3 --- src/external/bsd/libevent/dist/test/regress.h:1.2 Thu Apr 11 16:56:42 2013 +++ src/external/bsd/libevent/dist/test/regress.h Thu Feb 27 18:11:04 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: regress.h,v 1.2 2013/04/11 16:56:42 christos Exp $ */ +/* $NetBSD: regress.h,v 1.3 2014/02/27 18:11:04 joerg Exp $ */ /* * Copyright (c) 2000-2007 Niels Provos pro...@citi.umich.edu * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson @@ -112,7 +112,7 @@ int _test_ai_eq(const struct evutil_addr } while (/*CONSTCOND*/0) #define test_timeval_diff_leq(tv1, tv2, diff, tolerance) \ - tt_int_op(abs(timeval_msec_diff((tv1), (tv2)) - diff), =, tolerance) + tt_int_op(imaxabs(timeval_msec_diff((tv1), (tv2)) - diff), =, tolerance) #define test_timeval_diff_eq(tv1, tv2, diff)\ test_timeval_diff_leq((tv1), (tv2), (diff), 50)
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: joerg Date: Sat Jan 4 02:56:31 UTC 2014 Modified Files: src/external/bsd/libevent/dist/test: regress_buffer.c Log Message: Fix memcmp use. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libevent/dist/test/regress_buffer.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress_buffer.c diff -u src/external/bsd/libevent/dist/test/regress_buffer.c:1.2 src/external/bsd/libevent/dist/test/regress_buffer.c:1.3 --- src/external/bsd/libevent/dist/test/regress_buffer.c:1.2 Thu Apr 11 16:56:42 2013 +++ src/external/bsd/libevent/dist/test/regress_buffer.c Sat Jan 4 02:56:31 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: regress_buffer.c,v 1.2 2013/04/11 16:56:42 christos Exp $ */ +/* $NetBSD: regress_buffer.c,v 1.3 2014/01/04 02:56:31 joerg Exp $ */ /* * Copyright (c) 2003-2007 Niels Provos pro...@citi.umich.edu * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson @@ -33,7 +33,7 @@ #include event2/event-config.h #include sys/cdefs.h -__RCSID($NetBSD: regress_buffer.c,v 1.2 2013/04/11 16:56:42 christos Exp $); +__RCSID($NetBSD: regress_buffer.c,v 1.3 2014/01/04 02:56:31 joerg Exp $); #include sys/types.h #include sys/stat.h @@ -247,7 +247,7 @@ test_evbuffer(void *ptr) if (memcmp(evbuffer_pullup( evb, -1), buffer, sizeof(buffer) / 2) != 0 || memcmp(evbuffer_pullup( - evb_two, -1), buffer, sizeof(buffer) != 0)) + evb_two, -1), buffer, sizeof(buffer)) != 0) tt_abort_msg(Pullup did not preserve content); evbuffer_validate(evb);
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: christos Date: Fri Apr 12 17:50:27 UTC 2013 Modified Files: src/external/bsd/libevent/dist/test: regress.c Log Message: remove bug we added. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/bsd/libevent/dist/test/regress.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress.c diff -u src/external/bsd/libevent/dist/test/regress.c:1.6 src/external/bsd/libevent/dist/test/regress.c:1.7 --- src/external/bsd/libevent/dist/test/regress.c:1.6 Thu Apr 11 16:14:44 2013 +++ src/external/bsd/libevent/dist/test/regress.c Fri Apr 12 13:50:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: regress.c,v 1.6 2013/04/11 20:14:44 christos Exp $ */ +/* $NetBSD: regress.c,v 1.7 2013/04/12 17:50:27 christos Exp $ */ /* * Copyright (c) 2003-2007 Niels Provos pro...@citi.umich.edu * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson @@ -33,7 +33,7 @@ #include event2/event-config.h #include sys/cdefs.h -__RCSID($NetBSD: regress.c,v 1.6 2013/04/11 20:14:44 christos Exp $); +__RCSID($NetBSD: regress.c,v 1.7 2013/04/12 17:50:27 christos Exp $); #include sys/types.h #include sys/stat.h @@ -89,8 +89,6 @@ static struct timeval tset; static struct timeval tcalled; -static int interval; - #define TEST1 this is a test #define SECONDS 1 @@ -247,7 +245,7 @@ timeout_cb(evutil_socket_t fd, short eve else evutil_timersub(tset, tcalled, tv); - diff = tv.tv_sec*1000 + tv.tv_usec/1000 - interval; + diff = tv.tv_sec*1000 + tv.tv_usec/1000 - SECONDS * 1000; if (diff 0) diff = -diff;
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: joerg Date: Fri Apr 12 18:11:41 UTC 2013 Modified Files: src/external/bsd/libevent/dist/test: tinytest_macros.h Log Message: Remove potentially extra consts. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/bsd/libevent/dist/test/tinytest_macros.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/tinytest_macros.h diff -u src/external/bsd/libevent/dist/test/tinytest_macros.h:1.2 src/external/bsd/libevent/dist/test/tinytest_macros.h:1.3 --- src/external/bsd/libevent/dist/test/tinytest_macros.h:1.2 Thu Apr 11 16:56:42 2013 +++ src/external/bsd/libevent/dist/test/tinytest_macros.h Fri Apr 12 18:11:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: tinytest_macros.h,v 1.2 2013/04/11 16:56:42 christos Exp $ */ +/* $NetBSD: tinytest_macros.h,v 1.3 2013/04/12 18:11:40 joerg Exp $ */ /* tinytest_macros.h -- Copyright 2009-2012 Nick Mathewson * * Redistribution and use in source and binary forms, with or without @@ -114,8 +114,8 @@ #define tt_assert_test_fmt_type(a,b,str_test,type,test,printf_type,printf_fmt, \ setup_block,cleanup_block,die_on_fail)\ TT_STMT_BEGIN \ - const type _val1 = (const type)(a);\ - const type _val2 = (const type)(b);\ + type _val1 = (type)(a); \ + type _val2 = (type)(b); \ int _tt_status = (test); \ if (!_tt_status || _tinytest_get_verbosity()1) { \ printf_type _print; \
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: christos Date: Fri Apr 12 19:59:26 UTC 2013 Modified Files: src/external/bsd/libevent/dist/test: regress_thread.c Log Message: XXX: disable the simple conditions test right now because it depends on thread scheduling timings and we don't seem to schedule threads the way it assumes. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libevent/dist/test/regress_thread.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress_thread.c diff -u src/external/bsd/libevent/dist/test/regress_thread.c:1.2 src/external/bsd/libevent/dist/test/regress_thread.c:1.3 --- src/external/bsd/libevent/dist/test/regress_thread.c:1.2 Thu Apr 11 12:56:42 2013 +++ src/external/bsd/libevent/dist/test/regress_thread.c Fri Apr 12 15:59:26 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: regress_thread.c,v 1.2 2013/04/11 16:56:42 christos Exp $ */ +/* $NetBSD: regress_thread.c,v 1.3 2013/04/12 19:59:26 christos Exp $ */ /* * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * @@ -30,7 +30,7 @@ #include event2/event-config.h #include sys/cdefs.h -__RCSID($NetBSD: regress_thread.c,v 1.2 2013/04/11 16:56:42 christos Exp $); +__RCSID($NetBSD: regress_thread.c,v 1.3 2013/04/12 19:59:26 christos Exp $); #include sys/types.h #include stdio.h @@ -304,6 +304,7 @@ wait_for_condition(void *arg) THREAD_RETURN(); } +#if 0 static void thread_conditions_simple(void *arg) { @@ -394,7 +395,7 @@ thread_conditions_simple(void *arg) } evutil_timeradd(target_delay, launched_at, target_time); test_timeval_diff_leq(target_time, alerted[i].alerted_at, - 0, 50); + 0, 150); } tt_int_op(n_broadcast + n_signal + n_timed_out, ==, NUM_THREADS); tt_int_op(n_signal, ==, 1); @@ -402,6 +403,7 @@ thread_conditions_simple(void *arg) end: ; } +#endif #define CB_COUNT 128 #define QUEUE_THREAD_COUNT 8 @@ -507,7 +509,9 @@ struct testcase_t thread_testcases[] = { { forking, thread_basic, TT_FORK|TT_NEED_THREADS|TT_NEED_BASE, basic_setup, __UNCONST(forking) }, #endif +#if 0 TEST(conditions_simple), +#endif TEST(deferred_cb_skew), END_OF_TESTCASES };
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: christos Date: Fri Apr 12 20:00:22 UTC 2013 Modified Files: src/external/bsd/libevent/dist/test: regress_thread.c Log Message: #if 0 more To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libevent/dist/test/regress_thread.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress_thread.c diff -u src/external/bsd/libevent/dist/test/regress_thread.c:1.3 src/external/bsd/libevent/dist/test/regress_thread.c:1.4 --- src/external/bsd/libevent/dist/test/regress_thread.c:1.3 Fri Apr 12 15:59:26 2013 +++ src/external/bsd/libevent/dist/test/regress_thread.c Fri Apr 12 16:00:21 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: regress_thread.c,v 1.3 2013/04/12 19:59:26 christos Exp $ */ +/* $NetBSD: regress_thread.c,v 1.4 2013/04/12 20:00:21 christos Exp $ */ /* * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * @@ -30,7 +30,7 @@ #include event2/event-config.h #include sys/cdefs.h -__RCSID($NetBSD: regress_thread.c,v 1.3 2013/04/12 19:59:26 christos Exp $); +__RCSID($NetBSD: regress_thread.c,v 1.4 2013/04/12 20:00:21 christos Exp $); #include sys/types.h #include stdio.h @@ -99,6 +99,7 @@ wake_all_timeout(evutil_socket_t fd, sho } +#if 0 static void wake_one_timeout(evutil_socket_t fd, short what, void *arg) { @@ -107,6 +108,7 @@ wake_one_timeout(evutil_socket_t fd, sho EVTHREAD_COND_SIGNAL(cw-cond); EVLOCK_UNLOCK(cw-lock, 0); } +#endif #define NUM_THREADS 100 #define NUM_ITERATIONS 100 @@ -282,6 +284,7 @@ struct alerted_record { int timed_out; }; +#if 0 static THREAD_FN wait_for_condition(void *arg) { @@ -304,7 +307,6 @@ wait_for_condition(void *arg) THREAD_RETURN(); } -#if 0 static void thread_conditions_simple(void *arg) {
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: christos Date: Fri Apr 12 21:49:54 UTC 2013 Modified Files: src/external/bsd/libevent/dist/test: regress_rpc.c Log Message: missed one xkill in the rename To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libevent/dist/test/regress_rpc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress_rpc.c diff -u src/external/bsd/libevent/dist/test/regress_rpc.c:1.2 src/external/bsd/libevent/dist/test/regress_rpc.c:1.3 --- src/external/bsd/libevent/dist/test/regress_rpc.c:1.2 Thu Apr 11 12:56:42 2013 +++ src/external/bsd/libevent/dist/test/regress_rpc.c Fri Apr 12 17:49:54 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: regress_rpc.c,v 1.2 2013/04/11 16:56:42 christos Exp $ */ +/* $NetBSD: regress_rpc.c,v 1.3 2013/04/12 21:49:54 christos Exp $ */ /* * Copyright (c) 2003-2007 Niels Provos pro...@citi.umich.edu * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson @@ -36,7 +36,7 @@ #include event2/event-config.h #include sys/cdefs.h -__RCSID($NetBSD: regress_rpc.c,v 1.2 2013/04/11 16:56:42 christos Exp $); +__RCSID($NetBSD: regress_rpc.c,v 1.3 2013/04/12 21:49:54 christos Exp $); #include sys/types.h #include sys/stat.h @@ -500,7 +500,7 @@ rpc_basic_client(void) { struct evrpc_request_wrapper *ctx = EVRPC_MAKE_CTX(Message, msg, kill, - pool, msg, kill, GotKillCb, NULL); + pool, msg, xkill, GotKillCb, NULL); evrpc_make_request(ctx); }
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: christos Date: Thu Apr 11 20:14:44 UTC 2013 Modified Files: src/external/bsd/libevent/dist/test: regress.c regress_dns.c Log Message: fix merge that broke the tests To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/libevent/dist/test/regress.c cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libevent/dist/test/regress_dns.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress.c diff -u src/external/bsd/libevent/dist/test/regress.c:1.5 src/external/bsd/libevent/dist/test/regress.c:1.6 --- src/external/bsd/libevent/dist/test/regress.c:1.5 Thu Apr 11 12:56:42 2013 +++ src/external/bsd/libevent/dist/test/regress.c Thu Apr 11 16:14:44 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: regress.c,v 1.5 2013/04/11 16:56:42 christos Exp $ */ +/* $NetBSD: regress.c,v 1.6 2013/04/11 20:14:44 christos Exp $ */ /* * Copyright (c) 2003-2007 Niels Provos pro...@citi.umich.edu * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson @@ -33,7 +33,7 @@ #include event2/event-config.h #include sys/cdefs.h -__RCSID($NetBSD: regress.c,v 1.5 2013/04/11 16:56:42 christos Exp $); +__RCSID($NetBSD: regress.c,v 1.6 2013/04/11 20:14:44 christos Exp $); #include sys/types.h #include sys/stat.h @@ -580,7 +580,6 @@ end: cleanup_test(); } -#if 0 static void test_simpletimeout(void) { @@ -599,7 +598,6 @@ test_simpletimeout(void) cleanup_test(); } -#endif static void periodic_timeout_cb(evutil_socket_t fd, short event, void *arg) Index: src/external/bsd/libevent/dist/test/regress_dns.c diff -u src/external/bsd/libevent/dist/test/regress_dns.c:1.3 src/external/bsd/libevent/dist/test/regress_dns.c:1.4 --- src/external/bsd/libevent/dist/test/regress_dns.c:1.3 Thu Apr 11 12:56:42 2013 +++ src/external/bsd/libevent/dist/test/regress_dns.c Thu Apr 11 16:14:44 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: regress_dns.c,v 1.3 2013/04/11 16:56:42 christos Exp $ */ +/* $NetBSD: regress_dns.c,v 1.4 2013/04/11 20:14:44 christos Exp $ */ /* * Copyright (c) 2003-2007 Niels Provos pro...@citi.umich.edu * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson @@ -34,7 +34,7 @@ #include event2/event-config.h #include sys/cdefs.h -__RCSID($NetBSD: regress_dns.c,v 1.3 2013/04/11 16:56:42 christos Exp $); +__RCSID($NetBSD: regress_dns.c,v 1.4 2013/04/11 20:14:44 christos Exp $); #include sys/types.h #include sys/stat.h @@ -79,10 +79,8 @@ __RCSID($NetBSD: regress_dns.c,v 1.3 20 static int dns_ok = 0; static int dns_got_cancel = 0; static int dns_err = 0; -#endif -#if 0 static void dns_gethostbyname_cb(int result, char type, int count, int ttl, void *addresses, void *arg) @@ -223,7 +221,6 @@ end: if (base) event_base_free(base); } -#endif static int n_server_responses = 0;
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: jruoho Date: Sun Mar 11 19:03:34 UTC 2012 Modified Files: src/external/bsd/libevent/dist/test: regress.c Log Message: Skip the simple timeout test. This test case is known to fail rather consistently when run in emulated environments such as Qemu. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libevent/dist/test/regress.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress.c diff -u src/external/bsd/libevent/dist/test/regress.c:1.2 src/external/bsd/libevent/dist/test/regress.c:1.3 --- src/external/bsd/libevent/dist/test/regress.c:1.2 Thu Nov 11 14:11:26 2010 +++ src/external/bsd/libevent/dist/test/regress.c Sun Mar 11 19:03:33 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: regress.c,v 1.2 2010/11/11 14:11:26 pgoyette Exp $ */ +/* $NetBSD: regress.c,v 1.3 2012/03/11 19:03:33 jruoho Exp $ */ /* * Copyright (c) 2003, 2004 Niels Provos pro...@citi.umich.edu * All rights reserved. @@ -1699,7 +1699,10 @@ main (int argc, char **argv) test_combined(); +#if 0 test_simpletimeout(); +#endif + #ifndef WIN32 test_simplesignal(); test_multiplesignal();
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: jnemeth Date: Mon Mar 12 02:18:50 UTC 2012 Modified Files: src/external/bsd/libevent/dist/test: regress.c Log Message: Fix build failure caused by previous change. Hi jruoho! To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libevent/dist/test/regress.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress.c diff -u src/external/bsd/libevent/dist/test/regress.c:1.3 src/external/bsd/libevent/dist/test/regress.c:1.4 --- src/external/bsd/libevent/dist/test/regress.c:1.3 Sun Mar 11 19:03:33 2012 +++ src/external/bsd/libevent/dist/test/regress.c Mon Mar 12 02:18:49 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: regress.c,v 1.3 2012/03/11 19:03:33 jruoho Exp $ */ +/* $NetBSD: regress.c,v 1.4 2012/03/12 02:18:49 jnemeth Exp $ */ /* * Copyright (c) 2003, 2004 Niels Provos pro...@citi.umich.edu * All rights reserved. @@ -514,6 +514,7 @@ test_combined(void) cleanup_test(); } +#if 0 static void test_simpletimeout(void) { @@ -532,6 +533,7 @@ test_simpletimeout(void) cleanup_test(); } +#endif #ifndef WIN32 extern struct event_base *current_base;
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: pgoyette Date: Thu Nov 11 14:11:26 UTC 2010 Modified Files: src/external/bsd/libevent/dist/test: regress.c Log Message: Calibrate the amount of time that a sleep() requires, and use that interval instead of assuming that there are exactly 1000 real-time-clock milliseconds per second! On some ports when running under qemu, there can be twice as many RTC milliseconds as expected. This is part 2 of the changes required to make the libevent tests work on port-amd64 under qemu. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/libevent/dist/test/regress.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress.c diff -u src/external/bsd/libevent/dist/test/regress.c:1.1.1.1 src/external/bsd/libevent/dist/test/regress.c:1.2 --- src/external/bsd/libevent/dist/test/regress.c:1.1.1.1 Mon Nov 2 10:01:03 2009 +++ src/external/bsd/libevent/dist/test/regress.c Thu Nov 11 14:11:26 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: regress.c,v 1.1.1.1 2009/11/02 10:01:03 plunky Exp $ */ +/* $NetBSD: regress.c,v 1.2 2010/11/11 14:11:26 pgoyette Exp $ */ /* * Copyright (c) 2003, 2004 Niels Provos pro...@citi.umich.edu * All rights reserved. @@ -78,6 +78,8 @@ static struct timeval tcalled; static struct event_base *global_base; +static int interval; + #define TEST1 this is a test #define SECONDS 1 @@ -183,6 +185,27 @@ } static void +calibrate(void) +{ + struct timeval start, end, diff; + int delta; + + gettimeofday(start, NULL); + sleep(SECONDS); + gettimeofday(end, NULL); + + timersub(end, start, diff); + + delta = diff.tv_sec * 1000 + diff.tv_usec / 1000; + if (delta 0) + delta = -delta; + + interval = delta; + fprintf(stdout, Calibrated interval: %d sec = %d msec\n, SECONDS, + interval); +} + +static void timeout_cb(int fd, short event, void *arg) { struct timeval tv; @@ -194,7 +217,7 @@ else evutil_timersub(tset, tcalled, tv); - diff = tv.tv_sec*1000 + tv.tv_usec/1000 - SECONDS * 1000; + diff = tv.tv_sec*1000 + tv.tv_usec/1000 - interval; if (diff 0) diff = -diff; @@ -924,7 +947,7 @@ evtimer_add(ev, tv); tv.tv_usec = 0; - tv.tv_sec = 1; + tv.tv_sec = SECONDS; event_loopexit(tv); evutil_gettimeofday(tv_start, NULL); @@ -1625,6 +1648,11 @@ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) return (1); #endif + /* + * Calibrate sleep() vs elapsed real-time + */ + calibrate(); + setvbuf(stdout, NULL, _IONBF, 0); /* Initalize the event library */
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: plunky Date: Thu Jun 3 07:08:41 UTC 2010 Modified Files: src/external/bsd/libevent/dist/test: regress_dns.c Log Message: disable the DNS tests which rely on external hosts, as they are not useful with automated testing systems without internet connectivity. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/bsd/libevent/dist/test/regress_dns.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress_dns.c diff -u src/external/bsd/libevent/dist/test/regress_dns.c:1.1.1.1 src/external/bsd/libevent/dist/test/regress_dns.c:1.2 --- src/external/bsd/libevent/dist/test/regress_dns.c:1.1.1.1 Mon Nov 2 10:01:03 2009 +++ src/external/bsd/libevent/dist/test/regress_dns.c Thu Jun 3 07:08:41 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: regress_dns.c,v 1.1.1.1 2009/11/02 10:01:03 plunky Exp $ */ +/* $NetBSD: regress_dns.c,v 1.2 2010/06/03 07:08:41 plunky Exp $ */ /* * Copyright (c) 2003-2006 Niels Provos pro...@citi.umich.edu * All rights reserved. @@ -65,10 +65,13 @@ #include log.h static int dns_ok = 0; +#if 0 static int dns_err = 0; +#endif void dns_suite(void); +#if 0 static void dns_gethostbyname_cb(int result, char type, int count, int ttl, void *addresses, void *arg) @@ -185,6 +188,7 @@ exit(1); } } +#endif static int n_server_responses = 0; @@ -368,10 +372,12 @@ { dns_server(); /* Do this before we call evdns_init. */ +#if 0 evdns_init(); dns_gethostbyname(); dns_gethostbyname6(); dns_gethostbyaddr(); evdns_shutdown(0); +#endif }