diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-09-25 14:31:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-14 11:05:56 -0500 |
commit | c51f7c23e3af71466f9bd2ae57ae7a2b998ee3e2 (patch) | |
tree | b146849ad5003a3397063482bbca8054b5ce50ef /src/test/test_workqueue.c | |
parent | 3868b5d210f8bccbfb88464f62089447cb3330ed (diff) | |
download | tor-c51f7c23e3af71466f9bd2ae57ae7a2b998ee3e2.tar.gz tor-c51f7c23e3af71466f9bd2ae57ae7a2b998ee3e2.zip |
Test a little more of compat_threads.c
Diffstat (limited to 'src/test/test_workqueue.c')
-rw-r--r-- | src/test/test_workqueue.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/test/test_workqueue.c b/src/test/test_workqueue.c index 4077fb27a8..7ef54ef22b 100644 --- a/src/test/test_workqueue.c +++ b/src/test/test_workqueue.c @@ -249,8 +249,10 @@ help(void) " -N <items> Run this many items of work\n" " -T <threads> Use this many threads\n" " -I <inflight> Have no more than this many requests queued at once\n" - " -L <lowwater> Add items whenever fewer than this many are pending.\n" - " -R <ratio> Make one out of this many items be a slow (RSA) one"); + " -L <lowwater> Add items whenever fewer than this many are pending\n" + " -R <ratio> Make one out of this many items be a slow (RSA) one\n" + " --no-{eventfd2,eventfd,pipe2,pipe,socketpair}\n" + " Disable one of the alert_socket backends."); } int @@ -261,6 +263,7 @@ main(int argc, char **argv) int i; tor_libevent_cfg evcfg; struct event *ev; + uint32_t as_flags = 0; for (i = 1; i < argc; ++i) { if (!strcmp(argv[i], "-v")) { @@ -275,6 +278,16 @@ main(int argc, char **argv) opt_n_lowwater = atoi(argv[++i]); } else if (!strcmp(argv[i], "-R") && i+1<argc) { opt_ratio_rsa = atoi(argv[++i]); + } else if (!strcmp(argv[i], "--no-eventfd2")) { + as_flags |= ASOCKS_NOEVENTFD2; + } else if (!strcmp(argv[i], "--no-eventfd")) { + as_flags |= ASOCKS_NOEVENTFD; + } else if (!strcmp(argv[i], "--no-pipe2")) { + as_flags |= ASOCKS_NOPIPE2; + } else if (!strcmp(argv[i], "--no-pipe")) { + as_flags |= ASOCKS_NOPIPE; + } else if (!strcmp(argv[i], "--no-socketpair")) { + as_flags |= ASOCKS_NOSOCKETPAIR; } else if (!strcmp(argv[i], "-h")) { help(); return 0; @@ -294,7 +307,7 @@ main(int argc, char **argv) crypto_global_init(1, NULL, NULL); crypto_seed_rng(1); - rq = replyqueue_new(); + rq = replyqueue_new(as_flags); tor_assert(rq); tp = threadpool_new(opt_n_threads, rq, new_state, free_state, NULL); |