OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 v8::Local<v8::Value> result = CompileRun(code); | 533 v8::Local<v8::Value> result = CompileRun(code); |
534 CHECK(result->IsUndefined()); | 534 CHECK(result->IsUndefined()); |
535 } | 535 } |
536 | 536 |
537 | 537 |
538 static inline void ExpectNull(const char* code) { | 538 static inline void ExpectNull(const char* code) { |
539 v8::Local<v8::Value> result = CompileRun(code); | 539 v8::Local<v8::Value> result = CompileRun(code); |
540 CHECK(result->IsNull()); | 540 CHECK(result->IsNull()); |
541 } | 541 } |
542 | 542 |
| 543 static inline void ExpectException(const char* code) { |
| 544 v8::TryCatch try_catch; |
| 545 CHECK(CompileRun(code).IsEmpty()); |
| 546 CHECK(try_catch.HasCaught()); |
| 547 } |
543 | 548 |
544 static inline void CheckDoubleEquals(double expected, double actual) { | 549 static inline void CheckDoubleEquals(double expected, double actual) { |
545 const double kEpsilon = 1e-10; | 550 const double kEpsilon = 1e-10; |
546 CHECK_LE(expected, actual + kEpsilon); | 551 CHECK_LE(expected, actual + kEpsilon); |
547 CHECK_GE(expected, actual - kEpsilon); | 552 CHECK_GE(expected, actual - kEpsilon); |
548 } | 553 } |
549 | 554 |
550 | 555 |
551 static void DummyDebugEventListener( | 556 static void DummyDebugEventListener( |
552 const v8::Debug::EventDetails& event_details) {} | 557 const v8::Debug::EventDetails& event_details) {} |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 | 596 |
592 // Prefixing the below with main_ reduces a lot of naming clashes. | 597 // Prefixing the below with main_ reduces a lot of naming clashes. |
593 i::Zone* main_zone() { return main_zone_.get(); } | 598 i::Zone* main_zone() { return main_zone_.get(); } |
594 | 599 |
595 private: | 600 private: |
596 v8::internal::AccountingAllocator allocator_; | 601 v8::internal::AccountingAllocator allocator_; |
597 std::unique_ptr<i::Zone> main_zone_; | 602 std::unique_ptr<i::Zone> main_zone_; |
598 }; | 603 }; |
599 | 604 |
600 #endif // ifndef CCTEST_H_ | 605 #endif // ifndef CCTEST_H_ |
OLD | NEW |