OLD | NEW |
---|---|
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 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1401 | 1401 |
1402 #define INVALID_STRING_TEST(FUN, TYPE) \ | 1402 #define INVALID_STRING_TEST(FUN, TYPE) \ |
1403 TEST(StringOOM##FUN) { \ | 1403 TEST(StringOOM##FUN) { \ |
1404 CcTest::InitializeVM(); \ | 1404 CcTest::InitializeVM(); \ |
1405 LocalContext context; \ | 1405 LocalContext context; \ |
1406 Isolate* isolate = CcTest::i_isolate(); \ | 1406 Isolate* isolate = CcTest::i_isolate(); \ |
1407 STATIC_ASSERT(String::kMaxLength < kMaxInt); \ | 1407 STATIC_ASSERT(String::kMaxLength < kMaxInt); \ |
1408 static const int invalid = String::kMaxLength + 1; \ | 1408 static const int invalid = String::kMaxLength + 1; \ |
1409 HandleScope scope(isolate); \ | 1409 HandleScope scope(isolate); \ |
1410 Vector<TYPE> dummy = Vector<TYPE>::New(invalid); \ | 1410 Vector<TYPE> dummy = Vector<TYPE>::New(invalid); \ |
1411 memset(dummy.start(), 0x0, dummy.length() * sizeof(TYPE)); \ | |
Sven Panne
2014/09/16 10:48:40
Why exactly do we need this?
andrew_low
2014/09/22 17:49:18
When we test on AIX there are tests that fail if t
| |
1411 CHECK(isolate->factory()->FUN(Vector<const TYPE>::cast(dummy)).is_null()); \ | 1412 CHECK(isolate->factory()->FUN(Vector<const TYPE>::cast(dummy)).is_null()); \ |
1412 memset(dummy.start(), 0x20, dummy.length() * sizeof(TYPE)); \ | 1413 memset(dummy.start(), 0x20, dummy.length() * sizeof(TYPE)); \ |
1413 CHECK(isolate->has_pending_exception()); \ | 1414 CHECK(isolate->has_pending_exception()); \ |
1414 isolate->clear_pending_exception(); \ | 1415 isolate->clear_pending_exception(); \ |
1415 dummy.Dispose(); \ | 1416 dummy.Dispose(); \ |
1416 } | 1417 } |
1417 | 1418 |
1418 INVALID_STRING_TEST(NewStringFromAscii, char) | 1419 INVALID_STRING_TEST(NewStringFromAscii, char) |
1419 INVALID_STRING_TEST(NewStringFromUtf8, char) | 1420 INVALID_STRING_TEST(NewStringFromUtf8, char) |
1420 INVALID_STRING_TEST(NewStringFromOneByte, uint8_t) | 1421 INVALID_STRING_TEST(NewStringFromOneByte, uint8_t) |
1421 | 1422 |
1422 #undef INVALID_STRING_TEST | 1423 #undef INVALID_STRING_TEST |
OLD | NEW |