Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Unified Diff: tests/corelib/date_time_test.dart

Issue 759753010: Fix date_time_test to not assume a particular slowness of running code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add print every 1M loops if there is no progress. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/date_time_test.dart
diff --git a/tests/corelib/date_time_test.dart b/tests/corelib/date_time_test.dart
index 62c8ab880b7445fc75edf84a0f3e3ada472d5013..79dcdd95b14607540db79b9eb8e10e6b5a11bd6f 100644
--- a/tests/corelib/date_time_test.dart
+++ b/tests/corelib/date_time_test.dart
@@ -13,14 +13,16 @@ const int _MAX_MILLISECONDS = 8640000000000000;
void testNow() {
var t1 = new DateTime.now();
bool timeMovedForward = false;
- for (int i = 0; i < 1000000; i++) {
- var t2 = new DateTime.now();
- if (t1.millisecondsSinceEpoch < t2.millisecondsSinceEpoch) {
- timeMovedForward = true;
- break;
+ const int N = 1000000;
+ outer: while (true) {
+ for (int i = N; i > 0; i--) {
+ var t2 = new DateTime.now();
+ if (t1.millisecondsSinceEpoch < t2.millisecondsSinceEpoch) {
+ break outer;
+ }
}
+ print("testNow: No Date.now() progress in $N loops. Time: $t1");
}
- Expect.equals(true, timeMovedForward);
Expect.isFalse(t1.isUtc);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698