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

Side by Side Diff: test/cctest/test-symbols.cc

Issue 23534067: bulk replace Isolate::Current in tests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « test/cctest/test-strings.cc ('k') | test/cctest/test-thread-termination.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 2
3 // Check that we can traverse very deep stacks of ConsStrings using 3 // Check that we can traverse very deep stacks of ConsStrings using
4 // StringCharacterStram. Check that Get(int) works on very deep stacks 4 // StringCharacterStram. Check that Get(int) works on very deep stacks
5 // of ConsStrings. These operations may not be very fast, but they 5 // of ConsStrings. These operations may not be very fast, but they
6 // should be possible without getting errors due to too deep recursion. 6 // should be possible without getting errors due to too deep recursion.
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 #include "cctest.h" 10 #include "cctest.h"
11 #include "objects.h" 11 #include "objects.h"
12 12
13 using namespace v8::internal; 13 using namespace v8::internal;
14 14
15 15
16 TEST(Create) { 16 TEST(Create) {
17 CcTest::InitializeVM(); 17 CcTest::InitializeVM();
18 Isolate* isolate = Isolate::Current(); 18 Isolate* isolate = CcTest::i_isolate();
19 HandleScope scope(isolate); 19 HandleScope scope(isolate);
20 20
21 const int kNumSymbols = 30; 21 const int kNumSymbols = 30;
22 Handle<Symbol> symbols[kNumSymbols]; 22 Handle<Symbol> symbols[kNumSymbols];
23 23
24 for (int i = 0; i < kNumSymbols; ++i) { 24 for (int i = 0; i < kNumSymbols; ++i) {
25 symbols[i] = isolate->factory()->NewSymbol(); 25 symbols[i] = isolate->factory()->NewSymbol();
26 CHECK(symbols[i]->IsName()); 26 CHECK(symbols[i]->IsName());
27 CHECK(symbols[i]->IsSymbol()); 27 CHECK(symbols[i]->IsSymbol());
28 CHECK(symbols[i]->HasHashCode()); 28 CHECK(symbols[i]->HasHashCode());
(...skipping 12 matching lines...) Expand all
41 HEAP->CollectAllGarbage(Heap::kNoGCFlags); 41 HEAP->CollectAllGarbage(Heap::kNoGCFlags);
42 42
43 // All symbols should be distinct. 43 // All symbols should be distinct.
44 for (int i = 0; i < kNumSymbols; ++i) { 44 for (int i = 0; i < kNumSymbols; ++i) {
45 CHECK(symbols[i]->SameValue(*symbols[i])); 45 CHECK(symbols[i]->SameValue(*symbols[i]));
46 for (int j = i + 1; j < kNumSymbols; ++j) { 46 for (int j = i + 1; j < kNumSymbols; ++j) {
47 CHECK(!symbols[i]->SameValue(*symbols[j])); 47 CHECK(!symbols[i]->SameValue(*symbols[j]));
48 } 48 }
49 } 49 }
50 } 50 }
OLDNEW
« no previous file with comments | « test/cctest/test-strings.cc ('k') | test/cctest/test-thread-termination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698