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

Side by Side Diff: test/cctest/cctest.h

Issue 1474543004: Implement Fast Accessor Builder (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback. Created 5 years 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
OLDNEW
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
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 int LenFromSize(int size) { 566 static int LenFromSize(int size) {
561 return (size - i::FixedArray::kHeaderSize) / i::kPointerSize; 567 return (size - i::FixedArray::kHeaderSize) / i::kPointerSize;
562 } 568 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 HandleAndZoneScope() {} 720 HandleAndZoneScope() {}
715 721
716 // Prefixing the below with main_ reduces a lot of naming clashes. 722 // Prefixing the below with main_ reduces a lot of naming clashes.
717 i::Zone* main_zone() { return &main_zone_; } 723 i::Zone* main_zone() { return &main_zone_; }
718 724
719 private: 725 private:
720 i::Zone main_zone_; 726 i::Zone main_zone_;
721 }; 727 };
722 728
723 #endif // ifndef CCTEST_H_ 729 #endif // ifndef CCTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698