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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 CHECK(result->SameValue(expected)); | 543 CHECK(result->SameValue(expected)); |
544 } | 544 } |
545 | 545 |
546 | 546 |
547 static inline void ExpectUndefined(const char* code) { | 547 static inline void ExpectUndefined(const char* code) { |
548 v8::Local<v8::Value> result = CompileRun(code); | 548 v8::Local<v8::Value> result = CompileRun(code); |
549 CHECK(result->IsUndefined()); | 549 CHECK(result->IsUndefined()); |
550 } | 550 } |
551 | 551 |
552 | 552 |
| 553 static inline void ExpectNull(const char* code) { |
| 554 v8::Local<v8::Value> result = CompileRun(code); |
| 555 CHECK(result->IsNull()); |
| 556 } |
| 557 |
| 558 |
553 static inline void CheckDoubleEquals(double expected, double actual) { | 559 static inline void CheckDoubleEquals(double expected, double actual) { |
554 const double kEpsilon = 1e-10; | 560 const double kEpsilon = 1e-10; |
555 CHECK_LE(expected, actual + kEpsilon); | 561 CHECK_LE(expected, actual + kEpsilon); |
556 CHECK_GE(expected, actual - kEpsilon); | 562 CHECK_GE(expected, actual - kEpsilon); |
557 } | 563 } |
558 | 564 |
559 | 565 |
560 static void DummyDebugEventListener( | 566 static void DummyDebugEventListener( |
561 const v8::Debug::EventDetails& event_details) {} | 567 const v8::Debug::EventDetails& event_details) {} |
562 | 568 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 HandleAndZoneScope() {} | 604 HandleAndZoneScope() {} |
599 | 605 |
600 // Prefixing the below with main_ reduces a lot of naming clashes. | 606 // Prefixing the below with main_ reduces a lot of naming clashes. |
601 i::Zone* main_zone() { return &main_zone_; } | 607 i::Zone* main_zone() { return &main_zone_; } |
602 | 608 |
603 private: | 609 private: |
604 i::Zone main_zone_; | 610 i::Zone main_zone_; |
605 }; | 611 }; |
606 | 612 |
607 #endif // ifndef CCTEST_H_ | 613 #endif // ifndef CCTEST_H_ |
OLD | NEW |