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

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

Issue 23548024: Introduce a RandonNumberGenerator class. Refactor the random/private_random uses in Isolate/Context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE 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-strtod.cc ('k') | tools/gyp/v8.gyp » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 printf("diff at offset %d (%p): is %d, should be %d\n", 133 printf("diff at offset %d (%p): is %d, should be %d\n",
134 i, reinterpret_cast<void*>(area2 + i), area2[i], area3[i]); 134 i, reinterpret_cast<void*>(area2 + i), area2[i], area3[i]);
135 } 135 }
136 CHECK(false); 136 CHECK(false);
137 } 137 }
138 } 138 }
139 139
140 140
141 TEST(MemMove) { 141 TEST(MemMove) {
142 v8::V8::Initialize(); 142 v8::V8::Initialize();
143 OS::SetUp();
144 byte* area1 = new byte[kAreaSize]; 143 byte* area1 = new byte[kAreaSize];
145 byte* area2 = new byte[kAreaSize]; 144 byte* area2 = new byte[kAreaSize];
146 byte* area3 = new byte[kAreaSize]; 145 byte* area3 = new byte[kAreaSize];
147 146
148 static const int kMinOffset = 32; 147 static const int kMinOffset = 32;
149 static const int kMaxOffset = 64; 148 static const int kMaxOffset = 64;
150 static const int kMaxLength = 128; 149 static const int kMaxLength = 128;
151 STATIC_ASSERT(kMaxOffset + kMaxLength < kAreaSize); 150 STATIC_ASSERT(kMaxOffset + kMaxLength < kAreaSize);
152 151
153 for (int src_offset = kMinOffset; src_offset <= kMaxOffset; src_offset++) { 152 for (int src_offset = kMinOffset; src_offset <= kMaxOffset; src_offset++) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 TEST(SequenceCollectorRegression) { 226 TEST(SequenceCollectorRegression) {
228 SequenceCollector<char> collector(16); 227 SequenceCollector<char> collector(16);
229 collector.StartSequence(); 228 collector.StartSequence();
230 collector.Add('0'); 229 collector.Add('0');
231 collector.AddBlock( 230 collector.AddBlock(
232 i::Vector<const char>("12345678901234567890123456789012", 32)); 231 i::Vector<const char>("12345678901234567890123456789012", 32));
233 i::Vector<char> seq = collector.EndSequence(); 232 i::Vector<char> seq = collector.EndSequence();
234 CHECK_EQ(0, strncmp("0123456789012345678901234567890123", 233 CHECK_EQ(0, strncmp("0123456789012345678901234567890123",
235 seq.start(), seq.length())); 234 seq.start(), seq.length()));
236 } 235 }
OLDNEW
« no previous file with comments | « test/cctest/test-strtod.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698