]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'nickm/bug27073_029' into bug27073_034
authorteor <teor@torproject.org>
Wed, 13 Mar 2019 20:47:32 +0000 (06:47 +1000)
committerteor <teor@torproject.org>
Wed, 13 Mar 2019 20:47:32 +0000 (06:47 +1000)
Replace == with OP_EQ in test macros.

1  2 
src/test/test_threads.c

index ed6d8f04aafa4414b492cd2f717e105650a6451e,448ab2034bcb4aa2e531de914a26965392ef52aa..4f37a40cc7f7fbe03c755c7b753196afb64f3d90
@@@ -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);
    }