diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-03-27 12:04:12 +0100 |
---|---|---|
committer | Chris Dickinson <christopher.s.dickinson@gmail.com> | 2015-04-28 14:38:16 -0700 |
commit | 36cd5fb9d27b830320e57213f5b8829ffbb93324 (patch) | |
tree | bbab4215d26f8597019135206426fccf27a3089e /deps/v8/testing/gmock-support.h | |
parent | b57cc51d8d3f4ad279591ae8fa6584ee22773b97 (diff) | |
download | android-node-v8-36cd5fb9d27b830320e57213f5b8829ffbb93324.tar.gz android-node-v8-36cd5fb9d27b830320e57213f5b8829ffbb93324.tar.bz2 android-node-v8-36cd5fb9d27b830320e57213f5b8829ffbb93324.zip |
deps: upgrade v8 to 4.2.77.13
This commit applies some secondary changes in order to make `make test`
pass cleanly:
* disable broken postmortem debugging in common.gypi
* drop obsolete strict mode test in parallel/test-repl
* drop obsolete test parallel/test-v8-features
PR-URL: https://github.com/iojs/io.js/pull/1232
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'deps/v8/testing/gmock-support.h')
-rw-r--r-- | deps/v8/testing/gmock-support.h | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/deps/v8/testing/gmock-support.h b/deps/v8/testing/gmock-support.h index 012775b5cb..d00468e083 100644 --- a/deps/v8/testing/gmock-support.h +++ b/deps/v8/testing/gmock-support.h @@ -7,6 +7,7 @@ #include <cmath> #include <cstring> +#include <string> #include "testing/gmock/include/gmock/gmock.h" @@ -34,25 +35,6 @@ class Capture { namespace internal { -struct AnyBitEq { - template <typename A, typename B> - bool operator()(A const& a, B const& b) const { - if (sizeof(A) != sizeof(B)) return false; - return std::memcmp(&a, &b, sizeof(A)) == 0; - } -}; - - -template <typename Rhs> -class BitEqMatcher : public ComparisonBase<BitEqMatcher<Rhs>, Rhs, AnyBitEq> { - public: - explicit BitEqMatcher(Rhs const& rhs) - : ComparisonBase<BitEqMatcher<Rhs>, Rhs, AnyBitEq>(rhs) {} - static const char* Desc() { return "is bitwise equal to"; } - static const char* NegatedDesc() { return "isn't bitwise equal to"; } -}; - - template <typename T> class CaptureEqMatcher : public MatcherInterface<T> { public: @@ -83,10 +65,11 @@ class CaptureEqMatcher : public MatcherInterface<T> { // Creates a polymorphic matcher that matches anything whose bit representation -// is equal to that of x. -template <typename T> -inline internal::BitEqMatcher<T> BitEq(T const& x) { - return internal::BitEqMatcher<T>(x); +// is equal to that of {x}. +MATCHER_P(BitEq, x, std::string(negation ? "isn't" : "is") + + " bitwise equal to " + PrintToString(x)) { + static_assert(sizeof(x) == sizeof(arg), "Size mismatch"); + return std::memcmp(&arg, &x, sizeof(x)) == 0; } |