From: teor Date: Wed, 13 Mar 2019 20:47:32 +0000 (+1000) Subject: Merge remote-tracking branch 'nickm/bug27073_029' into bug27073_034 X-Git-Tag: tor-0.4.1.1-alpha~45^2~11^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2840580cf2753ac900b84f604989f9156708cdb3;p=thirdparty%2Ftor.git Merge remote-tracking branch 'nickm/bug27073_029' into bug27073_034 Replace == with OP_EQ in test macros. --- 2840580cf2753ac900b84f604989f9156708cdb3 diff --cc src/test/test_threads.c index ed6d8f04aa,448ab2034b..4f37a40cc7 --- a/src/test/test_threads.c +++ b/src/test/test_threads.c @@@ -275,14 -283,15 +283,15 @@@ test_threads_conditionvar(void *arg SPIN(); tor_mutex_release(ti->mutex); - tt_int_op(ti->value, ==, 1337); + tt_int_op(ti->value, OP_EQ, 1337); if (!timeout) { - tt_int_op(ti->n_shutdown, ==, 4); + tt_int_op(ti->n_shutdown, OP_EQ, 4); } else { - tor_sleep_msec(200); - tor_mutex_acquire(ti->mutex); + const int GIVE_UP_AFTER_SEC = 30; + SPIN_UNTIL((ti->n_timeouts == 2 || + time(NULL) >= started_at + GIVE_UP_AFTER_SEC), 10); - tt_int_op(ti->n_shutdown, ==, 2); - tt_int_op(ti->n_timeouts, ==, 2); + tt_int_op(ti->n_shutdown, OP_EQ, 2); + tt_int_op(ti->n_timeouts, OP_EQ, 2); tor_mutex_release(ti->mutex); }