[tor-commits] [tor/maint-0.4.0] Merge remote-tracking branch 'nickm/bug27073_029' into bug27073_034
teor at torproject.org
teor at torproject.org
Wed Mar 13 23:06:42 UTC 2019
commit 2840580cf2753ac900b84f604989f9156708cdb3
Merge: 155b0f552 7a0ff5beb
Author: teor <teor at torproject.org>
Date: Thu Mar 14 06:47:32 2019 +1000
Merge remote-tracking branch 'nickm/bug27073_029' into bug27073_034
Replace == with OP_EQ in test macros.
changes/bug27073 | 4 ++++
src/test/test_threads.c | 30 +++++++++++++++++++-----------
2 files changed, 23 insertions(+), 11 deletions(-)
diff --cc src/test/test_threads.c
index ed6d8f04a,448ab2034..4f37a40cc
--- 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);
}
More information about the tor-commits
mailing list