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

Side by Side Diff: runtime/vm/heap_profiler_test.cc

Issue 10534158: Fix flaky test runtime/vm/heap_profiler_test.cc (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/heap_profiler.h" 6 #include "vm/heap_profiler.h"
7 #include "vm/growable_array.h" 7 #include "vm/growable_array.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 EXPECT_EQ('.', array[i++]); 90 EXPECT_EQ('.', array[i++]);
91 EXPECT_EQ('0', array[i++]); 91 EXPECT_EQ('0', array[i++]);
92 EXPECT_EQ('.', array[i++]); 92 EXPECT_EQ('.', array[i++]);
93 EXPECT_EQ('1', array[i++]); 93 EXPECT_EQ('1', array[i++]);
94 EXPECT_EQ('\0', array[i++]); 94 EXPECT_EQ('\0', array[i++]);
95 uint32_t size = Read32(&array, &i); 95 uint32_t size = Read32(&array, &i);
96 EXPECT_EQ(8u, size); 96 EXPECT_EQ(8u, size);
97 uint64_t hi = Read32(&array, &i); 97 uint64_t hi = Read32(&array, &i);
98 uint64_t lo = Read32(&array, &i); 98 uint64_t lo = Read32(&array, &i);
99 uint64_t time = (hi << 32) | lo; 99 uint64_t time = (hi << 32) | lo;
100 EXPECT_GE(before, time); 100 EXPECT_LE(before, time);
101 EXPECT_LE(after, time); 101 EXPECT_GE(after, time);
102 while (i != array.length()) { 102 while (i != array.length()) {
103 // Check tag 103 // Check tag
104 uint8_t tag = Read8(&array, &i); 104 uint8_t tag = Read8(&array, &i);
105 EXPECT(IsTagValid(tag)); 105 EXPECT(IsTagValid(tag));
106 // Check time diff 106 // Check time diff
107 uint32_t time_diff = Read32(&array, &i); 107 uint32_t time_diff = Read32(&array, &i);
108 EXPECT_LE(before, time + time_diff); 108 EXPECT_LE(before, time + time_diff);
109 EXPECT_GE(after, time + time_diff); 109 EXPECT_GE(after, time + time_diff);
110 // Check length diff 110 // Check length diff
111 uint32_t length = Read32(&array, &i); 111 uint32_t length = Read32(&array, &i);
112 EXPECT_LE((intptr_t)length + i , array.length()); 112 EXPECT_LE((intptr_t)length + i , array.length());
113 // skip body 113 // skip body
114 i += length; 114 i += length;
115 } 115 }
116 } 116 }
117 117
118 } // namespace dart 118 } // namespace dart
OLDNEW
« 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