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

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

Issue 422063005: Contribution of PowerPC port. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: re-upload - catch up to 8/19 level Created 6 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
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 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 1391
1392 #define INVALID_STRING_TEST(FUN, TYPE) \ 1392 #define INVALID_STRING_TEST(FUN, TYPE) \
1393 TEST(StringOOM##FUN) { \ 1393 TEST(StringOOM##FUN) { \
1394 CcTest::InitializeVM(); \ 1394 CcTest::InitializeVM(); \
1395 LocalContext context; \ 1395 LocalContext context; \
1396 Isolate* isolate = CcTest::i_isolate(); \ 1396 Isolate* isolate = CcTest::i_isolate(); \
1397 STATIC_ASSERT(String::kMaxLength < kMaxInt); \ 1397 STATIC_ASSERT(String::kMaxLength < kMaxInt); \
1398 static const int invalid = String::kMaxLength + 1; \ 1398 static const int invalid = String::kMaxLength + 1; \
1399 HandleScope scope(isolate); \ 1399 HandleScope scope(isolate); \
1400 Vector<TYPE> dummy = Vector<TYPE>::New(invalid); \ 1400 Vector<TYPE> dummy = Vector<TYPE>::New(invalid); \
1401 memset(dummy.start(), 0x0, dummy.length() * sizeof(TYPE)); \
1401 CHECK(isolate->factory()->FUN(Vector<const TYPE>::cast(dummy)).is_null()); \ 1402 CHECK(isolate->factory()->FUN(Vector<const TYPE>::cast(dummy)).is_null()); \
1402 memset(dummy.start(), 0x20, dummy.length() * sizeof(TYPE)); \ 1403 memset(dummy.start(), 0x20, dummy.length() * sizeof(TYPE)); \
1403 CHECK(isolate->has_pending_exception()); \ 1404 CHECK(isolate->has_pending_exception()); \
1404 isolate->clear_pending_exception(); \ 1405 isolate->clear_pending_exception(); \
1405 dummy.Dispose(); \ 1406 dummy.Dispose(); \
1406 } 1407 }
1407 1408
1408 INVALID_STRING_TEST(NewStringFromAscii, char) 1409 INVALID_STRING_TEST(NewStringFromAscii, char)
1409 INVALID_STRING_TEST(NewStringFromUtf8, char) 1410 INVALID_STRING_TEST(NewStringFromUtf8, char)
1410 INVALID_STRING_TEST(NewStringFromOneByte, uint8_t) 1411 INVALID_STRING_TEST(NewStringFromOneByte, uint8_t)
1411 1412
1412 #undef INVALID_STRING_TEST 1413 #undef INVALID_STRING_TEST
OLDNEW
« src/hydrogen-bch.cc ('K') | « test/cctest/test-regexp.cc ('k') | test/cctest/test-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698