Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
gtest-internal.h File Reference
#include "gtest/internal/gtest-port.h"
#include <ctype.h>
#include <float.h>
#include <string.h>
#include <iomanip>
#include <limits>
#include <map>
#include <set>
#include <string>
#include <type_traits>
#include <vector>
#include "gtest/gtest-message.h"
#include "gtest/internal/gtest-filepath.h"
#include "gtest/internal/gtest-string.h"
#include "gtest/internal/gtest-type-util.h"
Include dependency graph for gtest-internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  testing::internal::CodeLocation
 
struct  testing::internal::CompileAssertTypesEqual< T1, T2 >
 
struct  testing::internal::CompileAssertTypesEqual< T, T >
 
struct  testing::internal::ConstCharPtr
 
struct  testing::internal::DoubleSequence< plus_one, T, sizeofT >
 
struct  testing::internal::DoubleSequence< false, IndexSequence< I... >, sizeofT >
 
struct  testing::internal::DoubleSequence< true, IndexSequence< I... >, sizeofT >
 
struct  testing::internal::ElemFromList< N, I, T >
 
struct  testing::internal::ElemFromList< N, IndexSequence< I... >, T... >
 
struct  testing::internal::ElemFromListImpl< T, size_t, size_t >
 
struct  testing::internal::ElemFromListImpl< T, I, I >
 
struct  testing::internal::EnableIf< bool >
 
struct  testing::internal::EnableIf< true >
 
class  testing::internal::FlatTuple< T >
 
class  testing::internal::FlatTuple< T >
 
struct  testing::internal::FlatTupleBase< Derived, Idx >
 
struct  testing::internal::FlatTupleBase< FlatTuple< T... >, IndexSequence< Idx... > >
 
struct  testing::internal::FlatTupleElemBase< Derived, I >
 
struct  testing::internal::FlatTupleElemBase< FlatTuple< T... >, I >
 
class  testing::internal::FloatingPoint< RawType >
 
union  testing::internal::FloatingPoint< RawType >::FloatingPointUnion
 
class  testing::internal::IgnoredValue
 
struct  testing::internal::IndexSequence< Is >
 
struct  testing::internal::IsAProtocolMessage< T >
 
struct  testing::internal::IsHashTable< T >
 
struct  testing::internal::IsRecursiveContainer< C >
 
struct  testing::internal::IsRecursiveContainerImpl< C, bool >
 
struct  testing::internal::IsRecursiveContainerImpl< C, false >
 
struct  testing::internal::IsRecursiveContainerImpl< C, true >
 
struct  testing::internal::MakeIndexSequence< N >
 
struct  testing::internal::MakeIndexSequence< 0 >
 
class  testing::internal::NativeArray< Element >
 
class  testing::internal::Random
 
struct  testing::internal::RelationToSourceCopy
 
struct  testing::internal::RelationToSourceReference
 
struct  testing::internal::RemoveConst< T >
 
struct  testing::internal::RemoveConst< const T >
 
struct  testing::internal::RemoveConst< const T[N]>
 
struct  testing::internal::RemoveReference< T >
 
struct  testing::internal::RemoveReference< T & >
 
struct  testing::internal::IgnoredValue::Sink
 
struct  testing::internal::SuiteApiResolver< T >
 
class  testing::internal::TestFactoryBase
 
class  testing::internal::TestFactoryImpl< TestClass >
 
class  testing::internal::TypeIdHelper< T >
 

Namespaces

 proto2
 
 testing
 
 testing::internal
 
 testing::internal::edit_distance
 

Macros

#define GTEST_CONCAT_TOKEN_(foo, bar)   GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
 
#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar)   foo ## bar
 
#define GTEST_FATAL_FAILURE_(message)   return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
 
#define GTEST_INTERNAL_DEPRECATED(message)
 
#define GTEST_IS_NULL_LITERAL_(x)
 
#define GTEST_MESSAGE_(message, result_type)   GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
 
#define GTEST_MESSAGE_AT_(file, line, message, result_type)
 
#define GTEST_NONFATAL_FAILURE_(message)   GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
 
#define GTEST_REMOVE_CONST_(T)   typename ::testing::internal::RemoveConst<T>::type
 
#define GTEST_REMOVE_REFERENCE_(T)   typename ::testing::internal::RemoveReference<T>::type
 
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)   GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
 
#define GTEST_SKIP_(message)   return GTEST_MESSAGE_(message, ::testing::TestPartResult::kSkip)
 
#define GTEST_STRINGIFY_(name)   #name
 
#define GTEST_SUCCESS_(message)   GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
 
#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)   if (::testing::internal::AlwaysTrue()) { statement; }
 
#define GTEST_TEST_(test_suite_name, test_name, parent_class, parent_id)
 
#define GTEST_TEST_ANY_THROW_(statement, fail)
 
#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail)
 
#define GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)   test_suite_name##_##test_name##_Test
 
#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail)
 
#define GTEST_TEST_NO_THROW_(statement, fail)
 
#define GTEST_TEST_THROW_(statement, expected_exception, fail)
 

Typedefs

typedef FloatingPoint< double > testing::internal::Double
 
typedef FloatingPoint< float > testing::internal::Float
 
typedef int testing::internal::IsContainer
 
typedef char testing::internal::IsNotContainer
 
using testing::internal::SetUpTearDownSuiteFuncType = void(*)()
 
using testing::internal::SetUpTestSuiteFunc = void(*)()
 
using testing::internal::TearDownTestSuiteFunc = void(*)()
 
template<typename T >
using testing::internal::TypeIsValidNullptrConstant = std::integral_constant< bool, std::is_same< typename std::decay< T >::type, std::nullptr_t >::value||!std::is_convertible< T, Secret * >::value >
 

Enumerations

enum  testing::internal::edit_distance::EditType { testing::internal::edit_distance::kMatch, testing::internal::edit_distance::kAdd, testing::internal::edit_distance::kRemove, testing::internal::edit_distance::kReplace }
 

Functions

bool testing::internal::AlwaysFalse ()
 
GTEST_API_ bool testing::internal::AlwaysTrue ()
 
GTEST_API_ std::string testing::internal::AppendUserMessage (const std::string &gtest_msg, const Message &user_msg)
 
template<typename Iter , typename Element >
Iter testing::internal::ArrayAwareFind (Iter begin, Iter end, const Element &elem)
 
template<typename T , typename U >
bool testing::internal::ArrayEq (const T &lhs, const U &rhs)
 
template<typename T , typename U >
bool testing::internal::ArrayEq (const T *lhs, size_t size, const U *rhs)
 
template<typename T , typename U , size_t N>
bool testing::internal::ArrayEq (const T(&lhs)[N], const U(&rhs)[N])
 
GTEST_API_ std::vector< EditType > testing::internal::edit_distance::CalculateOptimalEdits (const std::vector< size_t > &left, const std::vector< size_t > &right)
 
GTEST_API_ std::vector< EditType > testing::internal::edit_distance::CalculateOptimalEdits (const std::vector< std::string > &left, const std::vector< std::string > &right)
 
template<typename T , typename U >
void testing::internal::CopyArray (const T &from, U *to)
 
template<typename T , typename U >
void testing::internal::CopyArray (const T *from, size_t size, U *to)
 
template<typename T , typename U , size_t N>
void testing::internal::CopyArray (const T(&from)[N], U(*to)[N])
 
GTEST_API_ std::string testing::internal::edit_distance::CreateUnifiedDiff (const std::vector< std::string > &left, const std::vector< std::string > &right, size_t context=2)
 
GTEST_API_ std::string testing::internal::DiffStrings (const std::string &left, const std::string &right, size_t *total_line_count)
 
GTEST_API_ AssertionResult testing::internal::EqFailure (const char *expected_expression, const char *actual_expression, const std::string &expected_value, const std::string &actual_value, bool ignoring_case)
 
GTEST_API_ std::string testing::internal::GetBoolAssertionFailureMessage (const AssertionResult &assertion_result, const char *expression_text, const char *actual_predicate_value, const char *expected_predicate_value)
 
GTEST_API_ std::string testing::internal::GetCurrentOsStackTraceExceptTop (UnitTest *unit_test, int skip_count)
 
SetUpTearDownSuiteFuncType testing::internal::GetNotDefaultOrNull (SetUpTearDownSuiteFuncType a, SetUpTearDownSuiteFuncType def)
 
GTEST_API_ TypeId testing::internal::GetTestTypeId ()
 
template<typename T >
TypeId testing::internal::GetTypeId ()
 
template<class C , class Iterator = decltype(::std::declval<const C&>().begin()), class = decltype(::std::declval<const C&>().end()), class = decltype(++::std::declval<Iterator&>()), class = decltype(*::std::declval<Iterator>()), class = typename C::const_iterator>
IsContainer testing::internal::IsContainerTest (int)
 
template<class C >
IsNotContainer testing::internal::IsContainerTest (long)
 
std::false_type testing::internal::IsNullLiteralHelper (IgnoredValue, std::false_type)
 
std::false_type testing::internal::IsNullLiteralHelper (IgnoredValue, std::true_type)
 
std::true_type testing::internal::IsNullLiteralHelper (Secret *, std::true_type)
 
GTEST_API_ TestInfo * testing::internal::MakeAndRegisterTestInfo (const char *test_suite_name, const char *name, const char *type_param, const char *value_param, CodeLocation code_location, TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc, TearDownTestSuiteFunc tear_down_tc, TestFactoryBase *factory)
 
template<typename T >
::std::string testing::PrintToString (const T &value)
 
GTEST_API_ bool testing::internal::SkipPrefix (const char *prefix, const char **pstr)
 

Variables

const GTEST_API_ char testing::internal::kStackTraceMarker [] = "\nStack trace:\n"
 
const typedef voidtesting::internal::TypeId
 

Macro Definition Documentation

◆ GTEST_CONCAT_TOKEN_

#define GTEST_CONCAT_TOKEN_ (   foo,
  bar 
)    GTEST_CONCAT_TOKEN_IMPL_(foo, bar)

Definition at line 77 of file gtest-internal.h.

◆ GTEST_CONCAT_TOKEN_IMPL_

#define GTEST_CONCAT_TOKEN_IMPL_ (   foo,
  bar 
)    foo ## bar

Definition at line 78 of file gtest-internal.h.

◆ GTEST_FATAL_FAILURE_

#define GTEST_FATAL_FAILURE_ (   message)    return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)

Definition at line 1295 of file gtest-internal.h.

◆ GTEST_INTERNAL_DEPRECATED

#define GTEST_INTERNAL_DEPRECATED (   message)

Definition at line 1442 of file gtest-internal.h.

◆ GTEST_IS_NULL_LITERAL_

#define GTEST_IS_NULL_LITERAL_ (   x)
Value:

Definition at line 153 of file gtest-internal.h.

◆ GTEST_MESSAGE_

#define GTEST_MESSAGE_ (   message,
  result_type 
)    GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)

Definition at line 1292 of file gtest-internal.h.

◆ GTEST_MESSAGE_AT_

#define GTEST_MESSAGE_AT_ (   file,
  line,
  message,
  result_type 
)
Value:

Definition at line 1288 of file gtest-internal.h.

◆ GTEST_NONFATAL_FAILURE_

#define GTEST_NONFATAL_FAILURE_ (   message)    GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)

Definition at line 1298 of file gtest-internal.h.

◆ GTEST_REMOVE_CONST_

#define GTEST_REMOVE_CONST_ (   T)    typename ::testing::internal::RemoveConst<T>::type

Definition at line 916 of file gtest-internal.h.

◆ GTEST_REMOVE_REFERENCE_

#define GTEST_REMOVE_REFERENCE_ (   T)    typename ::testing::internal::RemoveReference<T>::type

Definition at line 895 of file gtest-internal.h.

◆ GTEST_REMOVE_REFERENCE_AND_CONST_

#define GTEST_REMOVE_REFERENCE_AND_CONST_ (   T)    GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))

Definition at line 920 of file gtest-internal.h.

◆ GTEST_SKIP_

#define GTEST_SKIP_ (   message)    return GTEST_MESSAGE_(message, ::testing::TestPartResult::kSkip)

Definition at line 1304 of file gtest-internal.h.

◆ GTEST_STRINGIFY_

#define GTEST_STRINGIFY_ (   name)    #name

Definition at line 81 of file gtest-internal.h.

◆ GTEST_SUCCESS_

#define GTEST_SUCCESS_ (   message)    GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)

Definition at line 1301 of file gtest-internal.h.

◆ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_

#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ (   statement)    if (::testing::internal::AlwaysTrue()) { statement; }

Definition at line 1310 of file gtest-internal.h.

◆ GTEST_TEST_

#define GTEST_TEST_ (   test_suite_name,
  test_name,
  parent_class,
  parent_id 
)
Value:
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
: public parent_class { \
public: \
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \
\
private: \
virtual void TestBody(); \
static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_; \
GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
test_name)); \
}; \
\
::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_suite_name, \
test_name)::test_info_ = \
#test_suite_name, #test_name, nullptr, nullptr, \
::testing::internal::CodeLocation(__FILE__, __LINE__), (parent_id), \
::testing::internal::SuiteApiResolver< \
parent_class>::GetSetUpCaseOrSuite(), \
::testing::internal::SuiteApiResolver< \
parent_class>::GetTearDownCaseOrSuite(), \
new ::testing::internal::TestFactoryImpl<GTEST_TEST_CLASS_NAME_( \
test_suite_name, test_name)>); \
void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody()

Definition at line 1403 of file gtest-internal.h.

◆ GTEST_TEST_ANY_THROW_

#define GTEST_TEST_ANY_THROW_ (   statement,
  fail 
)
Value:
bool gtest_caught_any = false; \
try { \
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
} \
catch (...) { \
gtest_caught_any = true; \
} \
if (!gtest_caught_any) { \
goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
} \
GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
fail("Expected: " #statement " throws an exception.\n" \
" Actual: it doesn't.")

Definition at line 1353 of file gtest-internal.h.

◆ GTEST_TEST_BOOLEAN_

#define GTEST_TEST_BOOLEAN_ (   expression,
  text,
  actual,
  expected,
  fail 
)
Value:
if (const ::testing::AssertionResult gtest_ar_ = \
::testing::AssertionResult(expression)) \
; \
else \
gtest_ar_, text, #actual, #expected).c_str())

Definition at line 1375 of file gtest-internal.h.

◆ GTEST_TEST_CLASS_NAME_

#define GTEST_TEST_CLASS_NAME_ (   test_suite_name,
  test_name 
)    test_suite_name##_##test_name##_Test

Definition at line 1399 of file gtest-internal.h.

◆ GTEST_TEST_NO_FATAL_FAILURE_

#define GTEST_TEST_NO_FATAL_FAILURE_ (   statement,
  fail 
)
Value:
::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
} \
GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
fail("Expected: " #statement " doesn't generate new fatal " \
"failures in the current thread.\n" \
" Actual: it does.")

Definition at line 1384 of file gtest-internal.h.

◆ GTEST_TEST_NO_THROW_

#define GTEST_TEST_NO_THROW_ (   statement,
  fail 
)
Value:
try { \
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
} \
catch (...) { \
goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
} \
GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
fail("Expected: " #statement " doesn't throw an exception.\n" \
" Actual: it throws.")

Definition at line 1339 of file gtest-internal.h.

◆ GTEST_TEST_THROW_

#define GTEST_TEST_THROW_ (   statement,
  expected_exception,
  fail 
)
Value:
if (::testing::internal::ConstCharPtr gtest_msg = "") { \
bool gtest_caught_expected = false; \
try { \
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
} \
catch (expected_exception const&) { \
gtest_caught_expected = true; \
} \
catch (...) { \
gtest_msg.value = \
"Expected: " #statement " throws an exception of type " \
#expected_exception ".\n Actual: it throws a different type."; \
goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
} \
if (!gtest_caught_expected) { \
gtest_msg.value = \
"Expected: " #statement " throws an exception of type " \
#expected_exception ".\n Actual: it throws nothing."; \
goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
} \
} else \
GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
fail(gtest_msg.value)

Definition at line 1313 of file gtest-internal.h.

testing
Definition: gmock-actions.h:59
testing::TestInfo
Definition: gtest.h:695
testing::internal::AssertHelper
Definition: gtest.h:1793
if
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END if(!upb_strtable_init(&intern->table, UPB_CTYPE_UINT64))
Definition: php/ext/google/protobuf/map.c:232
x
GLint GLenum GLint x
Definition: glcorearb.h:2834
GTEST_TEST_CLASS_NAME_
#define GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)
Definition: gtest-internal.h:1399
testing::Message
Definition: gtest-message.h:90
testing::internal::AlwaysTrue
GTEST_API_ bool AlwaysTrue()
Definition: gtest.cc:5611
testing::internal::MakeAndRegisterTestInfo
GTEST_API_ TestInfo * MakeAndRegisterTestInfo(const char *test_suite_name, const char *name, const char *type_param, const char *value_param, CodeLocation code_location, TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc, TearDownTestSuiteFunc tear_down_tc, TestFactoryBase *factory)
Definition: gtest.cc:2572
testing::internal::GetBoolAssertionFailureMessage
GTEST_API_ std::string GetBoolAssertionFailureMessage(const AssertionResult &assertion_result, const char *expression_text, const char *actual_predicate_value, const char *expected_predicate_value)
Definition: gtest.cc:1368
testing::internal::TypeIsValidNullptrConstant
std::integral_constant< bool, std::is_same< typename std::decay< T >::type, std::nullptr_t >::value||!std::is_convertible< T, Secret * >::value > TypeIsValidNullptrConstant
Definition: gtest-internal.h:133
testing::internal::IsNullLiteralHelper
std::true_type IsNullLiteralHelper(Secret *, std::true_type)
result_type
const typedef int * result_type
Definition: gmock-matchers_test.cc:4572
internal
Definition: any.pb.h:40
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
GTEST_ATTRIBUTE_UNUSED_
#define GTEST_ATTRIBUTE_UNUSED_
Definition: gtest-port.h:665
GTEST_CONCAT_TOKEN_
#define GTEST_CONCAT_TOKEN_(foo, bar)
Definition: gtest-internal.h:77
message
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glcorearb.h:2695
testing::internal::ConstCharPtr
Definition: gtest-internal.h:848


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:03