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

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

Issue 10704216: Fix type checking of void type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/object.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/assert.h" 5 #include "platform/assert.h"
6 #include "vm/globals.h" 6 #include "vm/globals.h"
7 #include "vm/heap.h" 7 #include "vm/heap.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 9
10 namespace dart { 10 namespace dart {
11 11
12 // Only ia32 and x64 can run execution tests. 12 // Only ia32 and x64 can run execution tests.
13 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) 13 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
14 TEST_CASE(OldGC) { 14 TEST_CASE(OldGC) {
15 const char* kScriptChars = 15 const char* kScriptChars =
16 "void main() {\n" 16 "main() {\n"
17 " return [1, 2, 3];\n" 17 " return [1, 2, 3];\n"
18 "}\n"; 18 "}\n";
19 FLAG_verbose_gc = true; 19 FLAG_verbose_gc = true;
20 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); 20 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
21 Dart_Handle result = Dart_Invoke(lib, 21 Dart_Handle result = Dart_Invoke(lib,
22 Dart_NewString("main"), 22 Dart_NewString("main"),
23 0, NULL); 23 0, NULL);
24 24
25 EXPECT_VALID(result); 25 EXPECT_VALID(result);
26 EXPECT(!Dart_IsNull(result)); 26 EXPECT(!Dart_IsNull(result));
27 EXPECT(Dart_IsList(result)); 27 EXPECT(Dart_IsList(result));
28 Isolate* isolate = Isolate::Current(); 28 Isolate* isolate = Isolate::Current();
29 Heap* heap = isolate->heap(); 29 Heap* heap = isolate->heap();
30 heap->CollectGarbage(Heap::kOld); 30 heap->CollectGarbage(Heap::kOld);
31 } 31 }
32 32
33 33
34 TEST_CASE(LargeSweep) { 34 TEST_CASE(LargeSweep) {
35 const char* kScriptChars = 35 const char* kScriptChars =
36 "void main() {\n" 36 "main() {\n"
37 " return new List(8 * 1024 * 1024);\n" 37 " return new List(8 * 1024 * 1024);\n"
38 "}\n"; 38 "}\n";
39 FLAG_verbose_gc = true; 39 FLAG_verbose_gc = true;
40 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); 40 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
41 Dart_EnterScope(); 41 Dart_EnterScope();
42 Dart_Handle result = Dart_Invoke(lib, 42 Dart_Handle result = Dart_Invoke(lib,
43 Dart_NewString("main"), 43 Dart_NewString("main"),
44 0, NULL); 44 0, NULL);
45 45
46 EXPECT_VALID(result); 46 EXPECT_VALID(result);
47 EXPECT(!Dart_IsNull(result)); 47 EXPECT(!Dart_IsNull(result));
48 EXPECT(Dart_IsList(result)); 48 EXPECT(Dart_IsList(result));
49 Isolate* isolate = Isolate::Current(); 49 Isolate* isolate = Isolate::Current();
50 Heap* heap = isolate->heap(); 50 Heap* heap = isolate->heap();
51 heap->CollectGarbage(Heap::kOld); 51 heap->CollectGarbage(Heap::kOld);
52 Dart_ExitScope(); 52 Dart_ExitScope();
53 heap->CollectGarbage(Heap::kOld); 53 heap->CollectGarbage(Heap::kOld);
54 } 54 }
55 55
56 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 56 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
57 } 57 }
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698