- 3.0.1 core module.
gmock-internal-utils.h
Go to the documentation of this file.
1 // Copyright 2007, Google Inc.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following disclaimer
12 // in the documentation and/or other materials provided with the
13 // distribution.
14 // * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 
31 // Google Mock - a framework for writing C++ mock classes.
32 //
33 // This file defines some utilities useful for implementing Google
34 // Mock. They are subject to change without notice, so please DO NOT
35 // USE THEM IN USER CODE.
36 
37 // GOOGLETEST_CM0002 DO NOT DELETE
38 
39 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
40 #define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
41 
42 #include <stdio.h>
43 #include <ostream> // NOLINT
44 #include <string>
45 #include <type_traits>
47 #include "gtest/gtest.h"
48 
49 namespace testing {
50 
51 template <typename>
52 class Matcher;
53 
54 namespace internal {
55 
56 // Silence MSVC C4100 (unreferenced formal parameter) and
57 // C4805('==': unsafe mix of type 'const int' and type 'const bool')
58 #ifdef _MSC_VER
59 # pragma warning(push)
60 # pragma warning(disable:4100)
61 # pragma warning(disable:4805)
62 #endif
63 
64 // Joins a vector of strings as if they are fields of a tuple; returns
65 // the joined string.
66 GTEST_API_ std::string JoinAsTuple(const Strings& fields);
67 
68 // Converts an identifier name to a space-separated list of lower-case
69 // words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is
70 // treated as one word. For example, both "FooBar123" and
71 // "foo_bar_123" are converted to "foo bar 123".
72 GTEST_API_ std::string ConvertIdentifierNameToWords(const char* id_name);
73 
74 // PointeeOf<Pointer>::type is the type of a value pointed to by a
75 // Pointer, which can be either a smart pointer or a raw pointer. The
76 // following default implementation is for the case where Pointer is a
77 // smart pointer.
78 template <typename Pointer>
79 struct PointeeOf {
80  // Smart pointer classes define type element_type as the type of
81  // their pointees.
82  typedef typename Pointer::element_type type;
83 };
84 // This specialization is for the raw pointer case.
85 template <typename T>
86 struct PointeeOf<T*> { typedef T type; }; // NOLINT
87 
88 // GetRawPointer(p) returns the raw pointer underlying p when p is a
89 // smart pointer, or returns p itself when p is already a raw pointer.
90 // The following default implementation is for the smart pointer case.
91 template <typename Pointer>
92 inline const typename Pointer::element_type* GetRawPointer(const Pointer& p) {
93  return p.get();
94 }
95 // This overloaded version is for the raw pointer case.
96 template <typename Element>
97 inline Element* GetRawPointer(Element* p) { return p; }
98 
99 // MSVC treats wchar_t as a native type usually, but treats it as the
100 // same as unsigned short when the compiler option /Zc:wchar_t- is
101 // specified. It defines _NATIVE_WCHAR_T_DEFINED symbol when wchar_t
102 // is a native type.
103 #if defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED)
104 // wchar_t is a typedef.
105 #else
106 # define GMOCK_WCHAR_T_IS_NATIVE_ 1
107 #endif
108 
109 // signed wchar_t and unsigned wchar_t are NOT in the C++ standard.
110 // Using them is a bad practice and not portable. So DON'T use them.
111 //
112 // Still, Google Mock is designed to work even if the user uses signed
113 // wchar_t or unsigned wchar_t (obviously, assuming the compiler
114 // supports them).
115 //
116 // To gcc,
117 // wchar_t == signed wchar_t != unsigned wchar_t == unsigned int
118 #ifdef __GNUC__
119 #if !defined(__WCHAR_UNSIGNED__)
120 // signed/unsigned wchar_t are valid types.
121 # define GMOCK_HAS_SIGNED_WCHAR_T_ 1
122 #endif
123 #endif
124 
125 // In what follows, we use the term "kind" to indicate whether a type
126 // is bool, an integer type (excluding bool), a floating-point type,
127 // or none of them. This categorization is useful for determining
128 // when a matcher argument type can be safely converted to another
129 // type in the implementation of SafeMatcherCast.
130 enum TypeKind {
132 };
133 
134 // KindOf<T>::value is the kind of type T.
135 template <typename T> struct KindOf {
136  enum { value = kOther }; // The default kind.
137 };
138 
139 // This macro declares that the kind of 'type' is 'kind'.
140 #define GMOCK_DECLARE_KIND_(type, kind) \
141  template <> struct KindOf<type> { enum { value = kind }; }
142 
144 
145 // All standard integer types.
147 GMOCK_DECLARE_KIND_(signed char, kInteger);
148 GMOCK_DECLARE_KIND_(unsigned char, kInteger);
149 GMOCK_DECLARE_KIND_(short, kInteger); // NOLINT
150 GMOCK_DECLARE_KIND_(unsigned short, kInteger); // NOLINT
152 GMOCK_DECLARE_KIND_(unsigned int, kInteger);
153 GMOCK_DECLARE_KIND_(long, kInteger); // NOLINT
154 GMOCK_DECLARE_KIND_(unsigned long, kInteger); // NOLINT
155 
156 #if GMOCK_WCHAR_T_IS_NATIVE_
157 GMOCK_DECLARE_KIND_(wchar_t, kInteger);
158 #endif
159 
160 // Non-standard integer types.
163 
164 // All standard floating-point types.
167 GMOCK_DECLARE_KIND_(long double, kFloatingPoint);
168 
169 #undef GMOCK_DECLARE_KIND_
170 
171 // Evaluates to the kind of 'type'.
172 #define GMOCK_KIND_OF_(type) \
173  static_cast< ::testing::internal::TypeKind>( \
174  ::testing::internal::KindOf<type>::value)
175 
176 // Evaluates to true iff integer type T is signed.
177 #define GMOCK_IS_SIGNED_(T) (static_cast<T>(-1) < 0)
178 
179 // LosslessArithmeticConvertibleImpl<kFromKind, From, kToKind, To>::value
180 // is true iff arithmetic type From can be losslessly converted to
181 // arithmetic type To.
182 //
183 // It's the user's responsibility to ensure that both From and To are
184 // raw (i.e. has no CV modifier, is not a pointer, and is not a
185 // reference) built-in arithmetic types, kFromKind is the kind of
186 // From, and kToKind is the kind of To; the value is
187 // implementation-defined when the above pre-condition is violated.
188 template <TypeKind kFromKind, typename From, TypeKind kToKind, typename To>
190 
191 // Converting bool to bool is lossless.
192 template <>
194  : public true_type {}; // NOLINT
195 
196 // Converting bool to any integer type is lossless.
197 template <typename To>
199  : public true_type {}; // NOLINT
200 
201 // Converting bool to any floating-point type is lossless.
202 template <typename To>
204  : public true_type {}; // NOLINT
205 
206 // Converting an integer to bool is lossy.
207 template <typename From>
209  : public false_type {}; // NOLINT
210 
211 // Converting an integer to another non-bool integer is lossless iff
212 // the target type's range encloses the source type's range.
213 template <typename From, typename To>
215  : public bool_constant<
216  // When converting from a smaller size to a larger size, we are
217  // fine as long as we are not converting from signed to unsigned.
218  ((sizeof(From) < sizeof(To)) &&
219  (!GMOCK_IS_SIGNED_(From) || GMOCK_IS_SIGNED_(To))) ||
220  // When converting between the same size, the signedness must match.
221  ((sizeof(From) == sizeof(To)) &&
222  (GMOCK_IS_SIGNED_(From) == GMOCK_IS_SIGNED_(To)))> {}; // NOLINT
223 
224 #undef GMOCK_IS_SIGNED_
225 
226 // Converting an integer to a floating-point type may be lossy, since
227 // the format of a floating-point number is implementation-defined.
228 template <typename From, typename To>
229 struct LosslessArithmeticConvertibleImpl<kInteger, From, kFloatingPoint, To>
230  : public false_type {}; // NOLINT
231 
232 // Converting a floating-point to bool is lossy.
233 template <typename From>
234 struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kBool, bool>
235  : public false_type {}; // NOLINT
236 
237 // Converting a floating-point to an integer is lossy.
238 template <typename From, typename To>
239 struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
240  : public false_type {}; // NOLINT
241 
242 // Converting a floating-point to another floating-point is lossless
243 // iff the target type is at least as big as the source type.
244 template <typename From, typename To>
245 struct LosslessArithmeticConvertibleImpl<
246  kFloatingPoint, From, kFloatingPoint, To>
247  : public bool_constant<sizeof(From) <= sizeof(To)> {}; // NOLINT
248 
249 // LosslessArithmeticConvertible<From, To>::value is true iff arithmetic
250 // type From can be losslessly converted to arithmetic type To.
251 //
252 // It's the user's responsibility to ensure that both From and To are
253 // raw (i.e. has no CV modifier, is not a pointer, and is not a
254 // reference) built-in arithmetic types; the value is
255 // implementation-defined when the above pre-condition is violated.
256 template <typename From, typename To>
257 struct LosslessArithmeticConvertible
258  : public LosslessArithmeticConvertibleImpl<
259  GMOCK_KIND_OF_(From), From, GMOCK_KIND_OF_(To), To> {}; // NOLINT
260 
261 // This interface knows how to report a Google Mock failure (either
262 // non-fatal or fatal).
263 class FailureReporterInterface {
264  public:
265  // The type of a failure (either non-fatal or fatal).
266  enum FailureType {
267  kNonfatal, kFatal
268  };
269 
270  virtual ~FailureReporterInterface() {}
271 
272  // Reports a failure that occurred at the given source file location.
273  virtual void ReportFailure(FailureType type, const char* file, int line,
274  const std::string& message) = 0;
275 };
276 
277 // Returns the failure reporter used by Google Mock.
278 GTEST_API_ FailureReporterInterface* GetFailureReporter();
279 
280 // Asserts that condition is true; aborts the process with the given
281 // message if condition is false. We cannot use LOG(FATAL) or CHECK()
282 // as Google Mock might be used to mock the log sink itself. We
283 // inline this function to prevent it from showing up in the stack
284 // trace.
285 inline void Assert(bool condition, const char* file, int line,
286  const std::string& msg) {
287  if (!condition) {
288  GetFailureReporter()->ReportFailure(FailureReporterInterface::kFatal,
289  file, line, msg);
290  }
291 }
292 inline void Assert(bool condition, const char* file, int line) {
293  Assert(condition, file, line, "Assertion failed.");
294 }
295 
296 // Verifies that condition is true; generates a non-fatal failure if
297 // condition is false.
298 inline void Expect(bool condition, const char* file, int line,
299  const std::string& msg) {
300  if (!condition) {
301  GetFailureReporter()->ReportFailure(FailureReporterInterface::kNonfatal,
302  file, line, msg);
303  }
304 }
305 inline void Expect(bool condition, const char* file, int line) {
306  Expect(condition, file, line, "Expectation failed.");
307 }
308 
309 // Severity level of a log.
311  kInfo = 0,
313 };
314 
315 // Valid values for the --gmock_verbose flag.
316 
317 // All logs (informational and warnings) are printed.
318 const char kInfoVerbosity[] = "info";
319 // Only warnings are printed.
320 const char kWarningVerbosity[] = "warning";
321 // No logs are printed.
322 const char kErrorVerbosity[] = "error";
323 
324 // Returns true iff a log with the given severity is visible according
325 // to the --gmock_verbose flag.
326 GTEST_API_ bool LogIsVisible(LogSeverity severity);
327 
328 // Prints the given message to stdout iff 'severity' >= the level
329 // specified by the --gmock_verbose flag. If stack_frames_to_skip >=
330 // 0, also prints the stack trace excluding the top
331 // stack_frames_to_skip frames. In opt mode, any positive
332 // stack_frames_to_skip is treated as 0, since we don't know which
333 // function calls will be inlined by the compiler and need to be
334 // conservative.
335 GTEST_API_ void Log(LogSeverity severity, const std::string& message,
336  int stack_frames_to_skip);
337 
338 // A marker class that is used to resolve parameterless expectations to the
339 // correct overload. This must not be instantiable, to prevent client code from
340 // accidentally resolving to the overload; for example:
341 //
342 // ON_CALL(mock, Method({}, nullptr))...
343 //
345  private:
346  WithoutMatchers() {}
348 };
349 
350 // Internal use only: access the singleton instance of WithoutMatchers.
352 
353 // Type traits.
354 
355 // is_reference<T>::value is non-zero iff T is a reference type.
356 template <typename T> struct is_reference : public false_type {};
357 template <typename T> struct is_reference<T&> : public true_type {};
358 
359 // type_equals<T1, T2>::value is non-zero iff T1 and T2 are the same type.
360 template <typename T1, typename T2> struct type_equals : public false_type {};
361 template <typename T> struct type_equals<T, T> : public true_type {};
362 
363 // remove_reference<T>::type removes the reference from type T, if any.
364 template <typename T> struct remove_reference { typedef T type; }; // NOLINT
365 template <typename T> struct remove_reference<T&> { typedef T type; }; // NOLINT
366 
367 // DecayArray<T>::type turns an array type U[N] to const U* and preserves
368 // other types. Useful for saving a copy of a function argument.
369 template <typename T> struct DecayArray { typedef T type; }; // NOLINT
370 template <typename T, size_t N> struct DecayArray<T[N]> {
371  typedef const T* type;
372 };
373 // Sometimes people use arrays whose size is not available at the use site
374 // (e.g. extern const char kNamePrefix[]). This specialization covers that
375 // case.
376 template <typename T> struct DecayArray<T[]> {
377  typedef const T* type;
378 };
379 
380 // Disable MSVC warnings for infinite recursion, since in this case the
381 // the recursion is unreachable.
382 #ifdef _MSC_VER
383 # pragma warning(push)
384 # pragma warning(disable:4717)
385 #endif
386 
387 // Invalid<T>() is usable as an expression of type T, but will terminate
388 // the program with an assertion failure if actually run. This is useful
389 // when a value of type T is needed for compilation, but the statement
390 // will not really be executed (or we don't care if the statement
391 // crashes).
392 template <typename T>
393 inline T Invalid() {
394  Assert(false, "", -1, "Internal error: attempt to return invalid value");
395  // This statement is unreachable, and would never terminate even if it
396  // could be reached. It is provided only to placate compiler warnings
397  // about missing return statements.
398  return Invalid<T>();
399 }
400 
401 #ifdef _MSC_VER
402 # pragma warning(pop)
403 #endif
404 
405 // Given a raw type (i.e. having no top-level reference or const
406 // modifier) RawContainer that's either an STL-style container or a
407 // native array, class StlContainerView<RawContainer> has the
408 // following members:
409 //
410 // - type is a type that provides an STL-style container view to
411 // (i.e. implements the STL container concept for) RawContainer;
412 // - const_reference is a type that provides a reference to a const
413 // RawContainer;
414 // - ConstReference(raw_container) returns a const reference to an STL-style
415 // container view to raw_container, which is a RawContainer.
416 // - Copy(raw_container) returns an STL-style container view of a
417 // copy of raw_container, which is a RawContainer.
418 //
419 // This generic version is used when RawContainer itself is already an
420 // STL-style container.
421 template <class RawContainer>
423  public:
424  typedef RawContainer type;
425  typedef const type& const_reference;
426 
427  static const_reference ConstReference(const RawContainer& container) {
428  // Ensures that RawContainer is not a const type.
429  testing::StaticAssertTypeEq<RawContainer,
430  GTEST_REMOVE_CONST_(RawContainer)>();
431  return container;
432  }
433  static type Copy(const RawContainer& container) { return container; }
434 };
435 
436 // This specialization is used when RawContainer is a native array type.
437 template <typename Element, size_t N>
438 class StlContainerView<Element[N]> {
439  public:
440  typedef GTEST_REMOVE_CONST_(Element) RawElement;
442  // NativeArray<T> can represent a native array either by value or by
443  // reference (selected by a constructor argument), so 'const type'
444  // can be used to reference a const native array. We cannot
445  // 'typedef const type& const_reference' here, as that would mean
446  // ConstReference() has to return a reference to a local variable.
447  typedef const type const_reference;
448 
449  static const_reference ConstReference(const Element (&array)[N]) {
450  // Ensures that Element is not a const type.
451  testing::StaticAssertTypeEq<Element, RawElement>();
452  return type(array, N, RelationToSourceReference());
453  }
454  static type Copy(const Element (&array)[N]) {
455  return type(array, N, RelationToSourceCopy());
456  }
457 };
458 
459 // This specialization is used when RawContainer is a native array
460 // represented as a (pointer, size) tuple.
461 template <typename ElementPointer, typename Size>
462 class StlContainerView< ::std::tuple<ElementPointer, Size> > {
463  public:
464  typedef GTEST_REMOVE_CONST_(
465  typename internal::PointeeOf<ElementPointer>::type) RawElement;
467  typedef const type const_reference;
468 
469  static const_reference ConstReference(
470  const ::std::tuple<ElementPointer, Size>& array) {
471  return type(std::get<0>(array), std::get<1>(array),
473  }
474  static type Copy(const ::std::tuple<ElementPointer, Size>& array) {
475  return type(std::get<0>(array), std::get<1>(array), RelationToSourceCopy());
476  }
477 };
478 
479 // The following specialization prevents the user from instantiating
480 // StlContainer with a reference type.
481 template <typename T> class StlContainerView<T&>;
482 
483 // A type transform to remove constness from the first part of a pair.
484 // Pairs like that are used as the value_type of associative containers,
485 // and this transform produces a similar but assignable pair.
486 template <typename T>
488  typedef T type;
489 };
490 
491 // Partially specialized to remove constness from std::pair<const K, V>.
492 template <typename K, typename V>
493 struct RemoveConstFromKey<std::pair<const K, V> > {
494  typedef std::pair<K, V> type;
495 };
496 
497 // Mapping from booleans to types. Similar to boost::bool_<kValue> and
498 // std::integral_constant<bool, kValue>.
499 template <bool kValue>
500 struct BooleanConstant {};
501 
502 // Emit an assertion failure due to incorrect DoDefault() usage. Out-of-lined to
503 // reduce code size.
504 GTEST_API_ void IllegalDoDefault(const char* file, int line);
505 
506 // Helper types for Apply() below.
507 template <size_t... Is> struct int_pack { typedef int_pack type; };
508 
509 template <class Pack, size_t I> struct append;
510 template <size_t... Is, size_t I>
511 struct append<int_pack<Is...>, I> : int_pack<Is..., I> {};
512 
513 template <size_t C>
514 struct make_int_pack : append<typename make_int_pack<C - 1>::type, C - 1> {};
515 template <> struct make_int_pack<0> : int_pack<> {};
516 
517 template <typename F, typename Tuple, size_t... Idx>
518 auto ApplyImpl(F&& f, Tuple&& args, int_pack<Idx...>) -> decltype(
519  std::forward<F>(f)(std::get<Idx>(std::forward<Tuple>(args))...)) {
520  return std::forward<F>(f)(std::get<Idx>(std::forward<Tuple>(args))...);
521 }
522 
523 // Apply the function to a tuple of arguments.
524 template <typename F, typename Tuple>
525 auto Apply(F&& f, Tuple&& args)
526  -> decltype(ApplyImpl(std::forward<F>(f), std::forward<Tuple>(args),
528  return ApplyImpl(std::forward<F>(f), std::forward<Tuple>(args),
530 }
531 
532 // Template struct Function<F>, where F must be a function type, contains
533 // the following typedefs:
534 //
535 // Result: the function's return type.
536 // Arg<N>: the type of the N-th argument, where N starts with 0.
537 // ArgumentTuple: the tuple type consisting of all parameters of F.
538 // ArgumentMatcherTuple: the tuple type consisting of Matchers for all
539 // parameters of F.
540 // MakeResultVoid: the function type obtained by substituting void
541 // for the return type of F.
542 // MakeResultIgnoredValue:
543 // the function type obtained by substituting Something
544 // for the return type of F.
545 template <typename T>
546 struct Function;
547 
548 template <typename R, typename... Args>
549 struct Function<R(Args...)> {
550  using Result = R;
551  static constexpr size_t ArgumentCount = sizeof...(Args);
552  template <size_t I>
553  using Arg = ElemFromList<I, typename MakeIndexSequence<sizeof...(Args)>::type,
554  Args...>;
555  using ArgumentTuple = std::tuple<Args...>;
556  using ArgumentMatcherTuple = std::tuple<Matcher<Args>...>;
557  using MakeResultVoid = void(Args...);
559 };
560 
561 template <typename R, typename... Args>
562 constexpr size_t Function<R(Args...)>::ArgumentCount;
563 
564 #ifdef _MSC_VER
565 # pragma warning(pop)
566 #endif
567 
568 } // namespace internal
569 } // namespace testing
570 
571 #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
const char * p
Definition: gmock-matchers_test.cc:3613
auto Apply(F &&f, Tuple &&args) -> decltype(ApplyImpl(std::forward< F >(f), std::forward< Tuple >(args), make_int_pack< std::tuple_size< Tuple >::value >()))
Definition: gmock-internal-utils.h:525
Definition: gmock-internal-utils.h:507
Definition: gmock-actions.h:59
Definition: gtest-internal.h:1086
GTEST_API_ void IllegalDoDefault(const char *file, int line)
Definition: gmock-internal-utils.cc:189
Definition: googletest-port-test.cc:192
internal::NativeArray< RawElement > type
Definition: gmock-internal-utils.h:466
tuple message
Definition: googletest-output-test.py:337
static const_reference ConstReference(const RawContainer &container)
Definition: gmock-internal-utils.h:427
Definition: gmock-internal-utils.h:131
Definition: gmock-internal-utils.h:344
Definition: gmock-internal-utils.h:369
Definition: gmock-internal-utils.h:487
T type
Definition: gmock-internal-utils.h:369
const type const_reference
Definition: gmock-internal-utils.h:467
T type
Definition: gmock-internal-utils.h:86
internal::NativeArray< RawElement > type
Definition: gmock-internal-utils.h:441
::std::vector< ::std::string > Strings
Definition: gtest-printers.h:871
Definition: gmock-internal-utils.h:79
Definition: gmock-internal-utils.h:500
auto ApplyImpl(F &&f, Tuple &&args, int_pack< Idx... >) -> decltype(std::forward< F >(f)(std::get< Idx >(std::forward< Tuple >(args))...))
Definition: gmock-internal-utils.h:518
Definition: gtest-internal.h:1193
#define GTEST_API_
Definition: gtest-port.h:759
std::tuple< Args... > ArgumentTuple
Definition: gmock-internal-utils.h:555
static type Copy(const ::std::tuple< ElementPointer, Size > &array)
Definition: gmock-internal-utils.h:474
static const_reference ConstReference(const Element(&array)[N])
Definition: gmock-internal-utils.h:449
const char kInfoVerbosity[]
Definition: gmock-internal-utils.h:318
const char kWarningVerbosity[]
Definition: gmock-internal-utils.h:320
Definition: gmock-internal-utils.h:422
Definition: gmock-internal-utils.h:52
GTEST_API_ std::string ConvertIdentifierNameToWords(const char *id_name)
Definition: gmock-internal-utils.cc:72
TypeKind
Definition: gmock-internal-utils.h:130
GMOCK_DECLARE_KIND_(bool, kBool)
Definition: gmock-internal-utils.h:364
Definition: gmock-internal-utils.h:131
Definition: gmock-internal-utils.h:131
const type const_reference
Definition: gmock-internal-utils.h:447
#define F(i, j)
const T * type
Definition: gmock-internal-utils.h:377
Definition: gmock-internal-utils.h:312
R Result
Definition: gmock-internal-utils.h:550
Definition: gmock-internal-utils.h:189
T type
Definition: gmock-internal-utils.h:364
void(Args...) MakeResultVoid
Definition: gmock-internal-utils.h:557
GTEST_API_ std::string JoinAsTuple(const Strings &fields)
Definition: gmock-internal-utils.cc:51
Definition: gmock-internal-utils.h:509
Definition: gmock-internal-utils.h:135
Definition: gtest-internal.h:1172
Definition: gmock-internal-utils.h:356
Definition: gtest-port.h:1925
T type
Definition: gmock-internal-utils.h:365
LogSeverity
Definition: gmock-internal-utils.h:310
Definition: gmock-internal-utils.h:514
const type & const_reference
Definition: gmock-internal-utils.h:425
GTEST_API_ bool LogIsVisible(LogSeverity severity)
Definition: gmock-internal-utils.cc:128
Pointer::element_type type
Definition: gmock-internal-utils.h:82
int value
Definition: gmock-matchers_test.cc:657
RawContainer type
Definition: gmock-internal-utils.h:424
Definition: gtest-internal.h:1074
void Assert(bool condition, const char *file, int line)
Definition: gmock-internal-utils.h:292
int_pack type
Definition: gmock-internal-utils.h:507
static type Copy(const RawContainer &container)
Definition: gmock-internal-utils.h:433
static const_reference ConstReference(const ::std::tuple< ElementPointer, Size > &array)
Definition: gmock-internal-utils.h:469
const T * type
Definition: gmock-internal-utils.h:371
Definition: gmock-internal-utils.h:546
Definition: gtest-internal.h:1075
IgnoredValue(Args...) MakeResultIgnoredValue
Definition: gmock-internal-utils.h:558
Definition: gmock-internal-utils.h:311
std::pair< K, V > type
Definition: gmock-internal-utils.h:494
TypeWithSize< 8 >::UInt UInt64
Definition: gtest-port.h:2219
bool StaticAssertTypeEq()
Definition: gtest.h:2281
T Invalid()
Definition: gmock-internal-utils.h:393
static type Copy(const Element(&array)[N])
Definition: gmock-internal-utils.h:454
std::tuple< Matcher< Args >... > ArgumentMatcherTuple
Definition: gmock-internal-utils.h:556
#define GTEST_REMOVE_CONST_(T)
Definition: gtest-internal.h:890
TypeWithSize< 8 >::Int Int64
Definition: gtest-port.h:2218
Definition: gmock-internal-utils.h:360
const char kErrorVerbosity[]
Definition: gmock-internal-utils.h:322
const Pointer::element_type * GetRawPointer(const Pointer &p)
Definition: gmock-internal-utils.h:92
void Expect(bool condition, const char *file, int line, const std::string &msg)
Definition: gmock-internal-utils.h:298
GTEST_API_ WithoutMatchers GetWithoutMatchers()
Definition: gmock-internal-utils.cc:187
Definition: gmock-internal-utils.h:131
T type
Definition: gmock-internal-utils.h:488
GTEST_API_ void Log(LogSeverity severity, const std::string &message, int stack_frames_to_skip)
Definition: gmock-internal-utils.cc:149
Definition: gtest-internal.h:110