#include "gtest/internal/gtest-port.h"
#include <ctype.h>
#include <string.h>
#include <iomanip>
#include <limits>
#include <set>
#include "gtest/internal/gtest-string.h"
#include "gtest/internal/gtest-filepath.h"
#include "gtest/internal/gtest-type-util.h"
Go to the source code of this file.
#define GTEST_ADD_REFERENCE_ | ( | T | ) | typename ::testing::internal::AddReference<T>::type |
Definition at line 828 of file gtest-internal.h.
#define GTEST_CONCAT_TOKEN_ | ( | foo, | |
bar | |||
) | GTEST_CONCAT_TOKEN_IMPL_(foo, bar) |
Definition at line 67 of file gtest-internal.h.
#define GTEST_CONCAT_TOKEN_IMPL_ | ( | foo, | |
bar | |||
) | foo ## bar |
Definition at line 68 of file gtest-internal.h.
#define GTEST_CREF_WORKAROUND_ |
Definition at line 206 of file gtest-internal.h.
#define GTEST_FATAL_FAILURE_ | ( | message | ) | return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure) |
Definition at line 1099 of file gtest-internal.h.
#define GTEST_FORMAT_CHAR_PTR_IMPL_ | ( | CharType | ) |
template <typename T> \ String FormatForComparisonFailureMessage(CharType* GTEST_CREF_WORKAROUND_ p, \ const T&) { \ return PrintToString(static_cast<const void*>(p)); \ }
Definition at line 245 of file gtest-internal.h.
#define GTEST_FORMAT_IMPL_ | ( | operand2_type, | |
operand1_printer | |||
) |
inline String FormatForComparisonFailureMessage(\ operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \ const operand2_type& /*operand2*/) {\ return operand1_printer(str);\ }\ inline String FormatForComparisonFailureMessage(\ const operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \ const operand2_type& /*operand2*/) {\ return operand1_printer(str);\ }
Definition at line 215 of file gtest-internal.h.
#define GTEST_IS_NULL_LITERAL_ | ( | x | ) | (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1) |
Definition at line 161 of file gtest-internal.h.
#define GTEST_MESSAGE_ | ( | message, | |
result_type | |||
) | GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type) |
Definition at line 1096 of file gtest-internal.h.
#define GTEST_MESSAGE_AT_ | ( | file, | |
line, | |||
message, | |||
result_type | |||
) |
::testing::internal::AssertHelper(result_type, file, line, message) \ = ::testing::Message()
Definition at line 1092 of file gtest-internal.h.
#define GTEST_NONFATAL_FAILURE_ | ( | message | ) | GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure) |
Definition at line 1102 of file gtest-internal.h.
#define GTEST_REFERENCE_TO_CONST_ | ( | T | ) | GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T)) |
Definition at line 840 of file gtest-internal.h.
#define GTEST_REMOVE_CONST_ | ( | T | ) | typename ::testing::internal::RemoveConst<T>::type |
Definition at line 811 of file gtest-internal.h.
#define GTEST_REMOVE_REFERENCE_ | ( | T | ) | typename ::testing::internal::RemoveReference<T>::type |
Definition at line 786 of file gtest-internal.h.
#define GTEST_REMOVE_REFERENCE_AND_CONST_ | ( | T | ) | GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T)) |
Definition at line 815 of file gtest-internal.h.
#define GTEST_SUCCESS_ | ( | message | ) | GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess) |
Definition at line 1105 of file gtest-internal.h.
#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ | ( | statement | ) | if (::testing::internal::AlwaysTrue()) { statement; } |
Definition at line 1111 of file gtest-internal.h.
#define GTEST_TEST_ | ( | test_case_name, | |
test_name, | |||
parent_class, | |||
parent_id | |||
) |
class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\ public:\ GTEST_TEST_CLASS_NAME_(test_case_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_case_name, test_name));\ };\ \ ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\ ::test_info_ =\ ::testing::internal::MakeAndRegisterTestInfo(\ #test_case_name, #test_name, NULL, NULL, \ (parent_id), \ parent_class::SetUpTestCase, \ parent_class::TearDownTestCase, \ new ::testing::internal::TestFactoryImpl<\ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
Definition at line 1204 of file gtest-internal.h.
#define GTEST_TEST_ANY_THROW_ | ( | statement, | |
fail | |||
) |
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::AlwaysTrue()) { \ 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__); \ } \ } else \ GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \ fail("Expected: " #statement " throws an exception.\n" \ " Actual: it doesn't.")
Definition at line 1154 of file gtest-internal.h.
#define GTEST_TEST_BOOLEAN_ | ( | expression, | |
text, | |||
actual, | |||
expected, | |||
fail | |||
) |
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (const ::testing::AssertionResult gtest_ar_ = \ ::testing::AssertionResult(expression)) \ ; \ else \ fail(::testing::internal::GetBoolAssertionFailureMessage(\ gtest_ar_, text, #actual, #expected).c_str())
Definition at line 1176 of file gtest-internal.h.
#define GTEST_TEST_CLASS_NAME_ | ( | test_case_name, | |
test_name | |||
) | test_case_name##_##test_name##_Test |
Definition at line 1200 of file gtest-internal.h.
#define GTEST_TEST_NO_FATAL_FAILURE_ | ( | statement, | |
fail | |||
) |
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::AlwaysTrue()) { \ ::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__); \ } \ } else \ 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 1185 of file gtest-internal.h.
#define GTEST_TEST_NO_THROW_ | ( | statement, | |
fail | |||
) |
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (::testing::internal::AlwaysTrue()) { \ try { \ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ } \ catch (...) { \ goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \ } \ } else \ GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \ fail("Expected: " #statement " doesn't throw an exception.\n" \ " Actual: it throws.")
Definition at line 1140 of file gtest-internal.h.
#define GTEST_TEST_THROW_ | ( | statement, | |
expected_exception, | |||
fail | |||
) |
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ 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 1114 of file gtest-internal.h.
void GTestStreamToHelper | ( | std::ostream * | os, |
const T & | val | ||
) | [inline] |
Definition at line 96 of file gtest-internal.h.