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

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

Issue 2666133002: Added new type of unit test, RAW_UNIT_TEST_CASE, which is used for tests that can be flaky if run w… (Closed)
Patch Set: Fixed name of UNIT_TEST_CASE macro Created 3 years, 10 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
« no previous file with comments | « runtime/vm/flow_graph_builder_test.cc ('k') | runtime/vm/isolate_test.cc » ('j') | 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/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/become.h" 8 #include "vm/become.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 Become::ElementsForwardIdentity(before, after); 306 Become::ElementsForwardIdentity(before, after);
307 307
308 EXPECT(before_obj.raw() == after_obj.raw()); 308 EXPECT(before_obj.raw() == after_obj.raw());
309 309
310 heap->CollectAllGarbage(); 310 heap->CollectAllGarbage();
311 311
312 EXPECT(before_obj.raw() == after_obj.raw()); 312 EXPECT(before_obj.raw() == after_obj.raw());
313 } 313 }
314 314
315 315
316 VM_TEST_CASE(BecomeFowardOldToOld) { 316 ISOLATE_UNIT_TEST_CASE(BecomeFowardOldToOld) {
317 TestBecomeForward(Heap::kOld, Heap::kOld); 317 TestBecomeForward(Heap::kOld, Heap::kOld);
318 } 318 }
319 319
320 320
321 VM_TEST_CASE(BecomeFowardNewToNew) { 321 ISOLATE_UNIT_TEST_CASE(BecomeFowardNewToNew) {
322 TestBecomeForward(Heap::kNew, Heap::kNew); 322 TestBecomeForward(Heap::kNew, Heap::kNew);
323 } 323 }
324 324
325 325
326 VM_TEST_CASE(BecomeFowardOldToNew) { 326 ISOLATE_UNIT_TEST_CASE(BecomeFowardOldToNew) {
327 TestBecomeForward(Heap::kOld, Heap::kNew); 327 TestBecomeForward(Heap::kOld, Heap::kNew);
328 } 328 }
329 329
330 330
331 VM_TEST_CASE(BecomeFowardNewToOld) { 331 ISOLATE_UNIT_TEST_CASE(BecomeFowardNewToOld) {
332 TestBecomeForward(Heap::kNew, Heap::kOld); 332 TestBecomeForward(Heap::kNew, Heap::kOld);
333 } 333 }
334 334
335 335
336 VM_TEST_CASE(BecomeForwardRememberedObject) { 336 ISOLATE_UNIT_TEST_CASE(BecomeForwardRememberedObject) {
337 Isolate* isolate = Isolate::Current(); 337 Isolate* isolate = Isolate::Current();
338 Heap* heap = isolate->heap(); 338 Heap* heap = isolate->heap();
339 339
340 const String& new_element = String::Handle(String::New("new", Heap::kNew)); 340 const String& new_element = String::Handle(String::New("new", Heap::kNew));
341 const String& old_element = String::Handle(String::New("old", Heap::kOld)); 341 const String& old_element = String::Handle(String::New("old", Heap::kOld));
342 const Array& before_obj = Array::Handle(Array::New(1, Heap::kOld)); 342 const Array& before_obj = Array::Handle(Array::New(1, Heap::kOld));
343 const Array& after_obj = Array::Handle(Array::New(1, Heap::kOld)); 343 const Array& after_obj = Array::Handle(Array::New(1, Heap::kOld));
344 before_obj.SetAt(0, new_element); 344 before_obj.SetAt(0, new_element);
345 after_obj.SetAt(0, old_element); 345 after_obj.SetAt(0, old_element);
346 EXPECT(before_obj.raw()->IsRemembered()); 346 EXPECT(before_obj.raw()->IsRemembered());
(...skipping 10 matching lines...) Expand all
357 357
358 EXPECT(before_obj.raw() == after_obj.raw()); 358 EXPECT(before_obj.raw() == after_obj.raw());
359 EXPECT(!after_obj.raw()->IsRemembered()); 359 EXPECT(!after_obj.raw()->IsRemembered());
360 360
361 heap->CollectAllGarbage(); 361 heap->CollectAllGarbage();
362 362
363 EXPECT(before_obj.raw() == after_obj.raw()); 363 EXPECT(before_obj.raw() == after_obj.raw());
364 } 364 }
365 365
366 } // namespace dart 366 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder_test.cc ('k') | runtime/vm/isolate_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698