Lines Matching defs:value
44 // the statements, you can refer to the value being matched by 'arg',
66 // // Verifies that the value of some_expression is even.
81 // Note that the type of the value being matched (arg_type) is
86 // where the value of "(arg % 2) == 0" can be implicitly converted to
101 // MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
110 // Expected: has absolute value 10
118 // body of MATCHER_P(HasAbsoluteValue, value) above, you can write
119 // 'value_type' to refer to the type of 'value'.
193 // matcher you will see the value of the referenced object but not its
229 // give you more control on the types of the value being matched and
334 // Matcher but is not one yet; for example, Eq(value)) or a value (for
341 // its conversion operator to create Matcher<T>. Or it can be a value
352 // a value).
375 // matcher. It's a value of a type implicitly convertible to T. Use direct
377 static Matcher<T> CastImpl(const M& value,
380 return Matcher<T>(ImplicitCast_<T>(value));
384 // polymorphic matcher Eq(value) in this case.
386 // Note that we first attempt to perform an implicit cast on the value and
393 static Matcher<T> CastImpl(const M& value,
424 (std::is_pointer<typename std::remove_reference<T>::type>::value !=
425 std::is_pointer<typename std::remove_reference<U>::type>::value) ||
426 std::is_same<FromType, ToType>::value ||
427 !std::is_base_of<FromType, ToType>::value,
433 typename std::conditional<std::is_convertible<T&, const U&>::value,
535 static_assert(std::is_convertible<const T&, const U&>::value,
539 static_assert(std::is_reference<T>::value || !std::is_reference<U>::value,
549 (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
554 // A<T>() returns a matcher that matches any value of type T.
571 // This is used to decide whether printing the type of a value might
580 // Matches the value against the given matcher, prints the value and explains
586 bool MatchPrintAndExplain(Value& value, const Matcher<T>& matcher,
591 return matcher.Matches(value);
595 const bool match = matcher.MatchAndExplain(value, &inner_listener);
597 UniversalPrint(value, listener->stream());
639 const Value& value = std::get<N - 1>(values);
641 if (!matcher.MatchAndExplain(value, &listener)) {
646 // universal printer from printing the address of value, which
650 internal::UniversalPrint(value, os);
683 static_assert(std::tuple_size<MatcherTuple>::value ==
684 std::tuple_size<ValueTuple>::value,
685 "matcher and value have different numbers of fields");
686 return TuplePrefix<std::tuple_size<ValueTuple>::value>::Matches(matcher_tuple,
695 TuplePrefix<std::tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(
710 // Returns the final value of 'out' in case the caller needs it.
712 return IterateOverTuple<Tuple, TupleSize::value>()(f, t, out);
719 *out++ = f(::std::get<TupleSize::value - kRemainingSize>(t));
732 // appending each result to the 'out' iterator. Returns the final value
739 // Implements _, a matcher that matches any value of any
1253 // Implements the Not(m) matcher, which matches a value that doesn't
1507 // a value to bool (warning 4800).
1539 // The argument x is passed by reference instead of by value, as
1618 // Implementation detail: 'matcher' is received by-value to force decaying.
1626 // value that is Nan.
1676 bool MatchAndExplain(T value,
1678 const FloatingPoint<FloatType> actual(value), expected(expected_);
1690 // of error bounds. If the result of value - expected_ would result in
1691 // overflow or if either value is inf, the default result is infinity,
1693 if (value == expected_) {
1697 const FloatType diff = value - expected_;
1757 // max_abs_error will be used for value comparison when >= 0.
1782 // max_abs_error will be used for value comparison when >= 0.
1894 *os << "points to a value that ";
1899 *os << "does not point to a value that ";
2072 bool MatchAndExplain(const T& value, MatchResultListener* listener) const {
2077 value, listener);
2108 // (i.e. return value of a getter method) of an object.
2139 bool MatchAndExplain(const T& value, MatchResultListener* listener) const {
2142 value, listener);
2150 // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
2205 // Implements the ResultOf() matcher for matching a return value of a
2246 *os << "is mapped by the given callable to a value that ";
2255 *os << "is mapped by the given callable to a value that ";
2268 // Cannot pass the return value directly to MatchPrintAndExplain, which
2413 static_assert(!std::is_const<Container>::value,
2415 static_assert(!std::is_reference<Container>::value,
2577 !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(RhsContainer)>::value,
2585 static_assert(!std::is_const<RhsContainer>::value,
2587 static_assert(!std::is_reference<RhsContainer>::value,
2598 !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)>::value,
2614 // We pass the LHS value and the RHS value to the inner matcher by
2627 << " values, where each value and its corresponding value in ";
2634 << " values, or contains a value x at some index i"
2635 << " where x and the i-th value of ";
2662 *listener << "where the value pair (";
2968 *listener << "whose first field is a value " << explanation;
3115 *listener << ", where the first field is a value " << first_explanation;
3124 *listener << "the second field is a value " << second_explanation;
3153 static_assert(std::tuple_size<T>::value == sizeof...(I),
3335 *listener << separator << " field #" << index << " is a value " << str;
3708 matchers.reserve(::std::tuple_size<MatcherTuple>::value);
3730 !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>::value ||
3731 ::std::tuple_size<MatcherTuple>::value < 2,
3739 matchers.reserve(::std::tuple_size<MatcherTuple>::value);
3781 !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>::value,
3792 // Given a 2-tuple matcher tm of type Tuple2Matcher and a value second
3794 // second) is a polymorphic matcher that matches a value x if and only if
3857 // Given a 2-tuple matcher tm and a value second,
3859 // value x if and only if tm matches tuple (x, second). Useful for
3876 // Implements a matcher that checks the value of a optional<> type variable.
3897 *os << "value ";
3902 *os << "value ";
3912 const ValueType& value = *optional;
3914 const bool match = value_matcher_.MatchAndExplain(value, &value_listener);
3915 *listener << "whose value " << PrintToString(value)
3936 // Implements a matcher that checks the value of a variant<> type variable.
3944 bool MatchAndExplain(const Variant& value,
3948 return holds_alternative<T>(value) && matcher_.Matches(get<T>(value));
3951 if (!holds_alternative<T>(value)) {
3952 *listener << "whose value is not of type '" << GetTypeName() << "'";
3956 const T& elem = get<T>(value);
3959 *listener << "whose value " << PrintToString(elem)
3966 *os << "is a variant<> with value of type '" << GetTypeName()
3967 << "' and the value ";
3972 *os << "is a variant<> with value of type other than '" << GetTypeName()
3973 << "' or the value ";
3997 // Implements a matcher that any_casts the value.
4005 bool MatchAndExplain(const AnyType& value,
4008 const T* ptr = any_cast<T>(&value);
4012 const T* elem = any_cast<T>(&value);
4014 *listener << "whose value is not of type '" << GetTypeName() << "'";
4020 *listener << "whose value " << PrintToString(*elem)
4027 *os << "is an 'any' type with value of type '" << GetTypeName()
4028 << "' and the value ";
4033 *os << "is an 'any' type with value of type other than '" << GetTypeName()
4034 << "' or the value ";
4236 // Creates a matcher that matches any value of the given type T.
4242 // Creates a matcher that matches any value of the given type T.
4250 const M& value, std::false_type /* convertible_to_matcher */,
4252 return Eq(value);
4336 // to a value that matches inner_matcher.
4656 // Creates a matcher that matches any value of type T that m doesn't
4674 // Note that the parameter 'size' can be a value of type size_type as well as
4794 // least one element matching the given value or matcher.
4948 // elements matching the given value or matcher.
4991 // is >= 5 and whose value equals "foo".
5055 // Returns true if and only if the value matches the matcher.
5057 inline bool Value(const T& value, M matcher) {
5058 return testing::Matches(matcher)(value);
5061 // Matches the value against the given matcher and explains the match
5064 inline bool ExplainMatchResult(M matcher, const T& value,
5066 return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);
5131 // AnyOfArray() verifies whether a given value matches any member of a
5140 // AllOfArray() verifies whether a given value matches all members of a
5229 // Returns a matcher that matches the value of an optional<> type variable.
5236 // optional value contains an optional itself.
5243 // Returns a matcher that matches the value of a absl::any type variable.
5251 // Returns a matcher that matches the value of a variant<> type variable.
5285 *listener << "which contains .what() (of value = " << err.what()
5332 std::exception>::value,
5424 static_assert(std::is_base_of<std::exception, Err>::value,
5433 // tests. ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher)
5434 // succeed if and only if the value matches the matcher. If the assertion
5435 // fails, the value and the description of the matcher will be printed.
5436 #define ASSERT_THAT(value, matcher) \
5438 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
5439 #define EXPECT_THAT(value, matcher) \
5441 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)