Forráskód Böngészése

Timer test: Adapt to OSX clock_monotonic

It seems clock_monotonic value 123.456 is not in the past for OS-X systems,
as it is for Linux systems. Maybe it does not start on system startup, but
on process startup. Or maybe the OSX container environment used in
continuous integration testing are just a few seconds faster than Linux, and
this seems to make the difference here.
See https://travis-ci.org/civetweb/civetweb/builds/187029942
bel 8 éve
szülő
commit
bd0d268d35
1 módosított fájl, 4 hozzáadás és 4 törlés
  1. 4 4
      test/timertest.c

+ 4 - 4
test/timertest.c

@@ -261,15 +261,15 @@ START_TEST(test_timer_mixed)
 	c[4] = 3;
 	c[4] = 3;
 	timer_add(&ctx, 2.5, 0.1, 1, action_dec_to_0, c + 4);
 	timer_add(&ctx, 2.5, 0.1, 1, action_dec_to_0, c + 4);
 
 
-	/* 3 --> 2, an absolute timer in the past (123.456) will still
+	/* 3 --> 2, an absolute timer in the past (-123.456) will still
 	 * run once at start, and then with the period */
 	 * run once at start, and then with the period */
 	c[5] = 3;
 	c[5] = 3;
-	timer_add(&ctx, 123.456, 2.5, 0, action_dec_to_0, c + 5);
+	timer_add(&ctx, -123.456, 2.5, 0, action_dec_to_0, c + 5);
 
 
-	/* 3 --> 1, an absolute timer in the past (123.456) will still
+	/* 3 --> 1, an absolute timer in the past (-123.456) will still
 	 * run once at start, and then with the period */
 	 * run once at start, and then with the period */
 	c[6] = 3;
 	c[6] = 3;
-	timer_add(&ctx, 123.456, 0.75, 0, action_dec_to_0, c + 6);
+	timer_add(&ctx, -123.456, 0.75, 0, action_dec_to_0, c + 6);
 
 
 	mark_point();
 	mark_point();