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

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

Issue 271843005: Simplify ConfigureHeap and change --max_new_space_size to --max_semi_space_size. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 CHECK(result->IsString()); 1194 CHECK(result->IsString());
1195 string = v8::Utils::OpenHandle(v8::String::Cast(*result)); 1195 string = v8::Utils::OpenHandle(v8::String::Cast(*result));
1196 CHECK(string->IsSlicedString()); 1196 CHECK(string->IsSlicedString());
1197 CHECK(SlicedString::cast(*string)->parent()->IsSeqString()); 1197 CHECK(SlicedString::cast(*string)->parent()->IsSeqString());
1198 CHECK_EQ("cdefghijklmnopqrstuvwx", string->ToCString().get()); 1198 CHECK_EQ("cdefghijklmnopqrstuvwx", string->ToCString().get());
1199 } 1199 }
1200 1200
1201 1201
1202 TEST(AsciiArrayJoin) { 1202 TEST(AsciiArrayJoin) {
1203 // Set heap limits. 1203 // Set heap limits.
1204 static const int K = 1024;
1205 v8::ResourceConstraints constraints; 1204 v8::ResourceConstraints constraints;
1206 constraints.set_max_new_space_size(2 * K * K); 1205 constraints.set_max_semi_space_size(1);
1207 constraints.set_max_old_space_size(4 * K * K); 1206 constraints.set_max_old_space_size(4);
1208 v8::SetResourceConstraints(CcTest::isolate(), &constraints); 1207 v8::SetResourceConstraints(CcTest::isolate(), &constraints);
1209 1208
1210 // String s is made of 2^17 = 131072 'c' characters and a is an array 1209 // String s is made of 2^17 = 131072 'c' characters and a is an array
1211 // starting with 'bad', followed by 2^14 times the string s. That means the 1210 // starting with 'bad', followed by 2^14 times the string s. That means the
1212 // total length of the concatenated strings is 2^31 + 3. So on 32bit systems 1211 // total length of the concatenated strings is 2^31 + 3. So on 32bit systems
1213 // summing the lengths of the strings (as Smis) overflows and wraps. 1212 // summing the lengths of the strings (as Smis) overflows and wraps.
1214 LocalContext context; 1213 LocalContext context;
1215 v8::HandleScope scope(CcTest::isolate()); 1214 v8::HandleScope scope(CcTest::isolate());
1216 v8::TryCatch try_catch; 1215 v8::TryCatch try_catch;
1217 CHECK(CompileRun( 1216 CHECK(CompileRun(
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 CHECK(isolate->has_pending_exception()); \ 1403 CHECK(isolate->has_pending_exception()); \
1405 isolate->clear_pending_exception(); \ 1404 isolate->clear_pending_exception(); \
1406 dummy.Dispose(); \ 1405 dummy.Dispose(); \
1407 } 1406 }
1408 1407
1409 INVALID_STRING_TEST(NewStringFromAscii, char) 1408 INVALID_STRING_TEST(NewStringFromAscii, char)
1410 INVALID_STRING_TEST(NewStringFromUtf8, char) 1409 INVALID_STRING_TEST(NewStringFromUtf8, char)
1411 INVALID_STRING_TEST(NewStringFromOneByte, uint8_t) 1410 INVALID_STRING_TEST(NewStringFromOneByte, uint8_t)
1412 1411
1413 #undef INVALID_STRING_TEST 1412 #undef INVALID_STRING_TEST
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698