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

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

Issue 2907803002: Fix test OneByteArrayJoin. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 CHECK(string->IsSlicedString()); 1294 CHECK(string->IsSlicedString());
1295 CHECK(SlicedString::cast(*string)->parent()->IsSeqString()); 1295 CHECK(SlicedString::cast(*string)->parent()->IsSeqString());
1296 CHECK_EQ(0, strcmp("cdefghijklmnopqrstuvwx", string->ToCString().get())); 1296 CHECK_EQ(0, strcmp("cdefghijklmnopqrstuvwx", string->ToCString().get()));
1297 } 1297 }
1298 1298
1299 1299
1300 UNINITIALIZED_TEST(OneByteArrayJoin) { 1300 UNINITIALIZED_TEST(OneByteArrayJoin) {
1301 v8::Isolate::CreateParams create_params; 1301 v8::Isolate::CreateParams create_params;
1302 // Set heap limits. 1302 // Set heap limits.
1303 create_params.constraints.set_max_semi_space_size(1); 1303 create_params.constraints.set_max_semi_space_size(1);
1304 create_params.constraints.set_max_old_space_size(6); 1304 create_params.constraints.set_max_old_space_size(7);
1305 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); 1305 create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
1306 v8::Isolate* isolate = v8::Isolate::New(create_params); 1306 v8::Isolate* isolate = v8::Isolate::New(create_params);
1307 isolate->Enter(); 1307 isolate->Enter();
1308 1308
1309 { 1309 {
1310 // String s is made of 2^17 = 131072 'c' characters and a is an array 1310 // String s is made of 2^17 = 131072 'c' characters and a is an array
1311 // starting with 'bad', followed by 2^14 times the string s. That means the 1311 // starting with 'bad', followed by 2^14 times the string s. That means the
1312 // total length of the concatenated strings is 2^31 + 3. So on 32bit systems 1312 // total length of the concatenated strings is 2^31 + 3. So on 32bit systems
1313 // summing the lengths of the strings (as Smis) overflows and wraps. 1313 // summing the lengths of the strings (as Smis) overflows and wraps.
1314 LocalContext context(isolate); 1314 LocalContext context(isolate);
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 CHECK_EQ(1, CompileRun("external.indexOf('', 1)") 1659 CHECK_EQ(1, CompileRun("external.indexOf('', 1)")
1660 ->Int32Value(context.local()) 1660 ->Int32Value(context.local())
1661 .FromJust()); 1661 .FromJust());
1662 CHECK_EQ(-1, CompileRun("external.indexOf('a', 1)") 1662 CHECK_EQ(-1, CompileRun("external.indexOf('a', 1)")
1663 ->Int32Value(context.local()) 1663 ->Int32Value(context.local())
1664 .FromJust()); 1664 .FromJust());
1665 CHECK_EQ(-1, CompileRun("external.indexOf('$')") 1665 CHECK_EQ(-1, CompileRun("external.indexOf('$')")
1666 ->Int32Value(context.local()) 1666 ->Int32Value(context.local())
1667 .FromJust()); 1667 .FromJust());
1668 } 1668 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698