proxygen
gtest_unittest.cc File Reference
#include "gtest/gtest.h"
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <map>
#include <vector>
#include <ostream>
#include "gtest/gtest-spi.h"
#include "src/gtest-internal-inl.h"

Go to the source code of this file.

Classes

class  testing::internal::TestEventListenersAccessor
 
class  testing::internal::UnitTestRecordPropertyTestHelper
 
class  TestingVector
 
struct  ConvertibleToAssertionResult
 
class  Base
 
class  namespace1::MyTypeInNameSpace1
 
class  namespace2::MyTypeInNameSpace2
 
class  testing::TestInfoTest
 
class  testing::CodeLocationForTESTF
 
class  testing::CodeLocationForTESTP
 
class  testing::CodeLocationForTYPEDTEST< T >
 
class  testing::CodeLocationForTYPEDTESTP< T >
 
class  testing::SetUpTestCaseTest
 
struct  testing::Flags
 
class  testing::InitGoogleTestTest
 
class  testing::CurrentTestInfoTest
 
class  my_namespace::testing::Test
 
class  my_namespace::testing::Message
 
class  my_namespace::testing::AssertionResult
 
class  ProtectedFixtureMethodsTest
 
class  StaticAssertTypeEqTestHelper< T >
 
class  TestListener
 
class  SequenceTestingListener
 
class  ConversionHelperBase
 
class  ConversionHelperDerived
 
class  NonContainer
 

Namespaces

 testing
 
 testing::internal
 
 namespace1
 
 namespace2
 
 my_namespace
 
 my_namespace::testing
 

Macros

#define GTEST_IMPLEMENTATION_   1
 
#define GTEST_USE_UNPROTECTED_COMMA_   global_var++, global_var++
 
#define VERIFY_CODE_LOCATION
 
#define GTEST_TEST_PARSING_FLAGS_(argv1, argv2, expected, should_print_help)
 

Typedefs

typedef int IntAlias
 

Enumerations

enum  NamedEnum
 
enum  
 

Functions

 TEST (CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded)
 
::std::ostream & operator<< (::std::ostream &os, const TestingVector &vector)
 
 testing::TEST (SuccessfulAssertionTest, SUCCEED)
 
 testing::TEST (SuccessfulAssertionTest, EXPECT)
 
 testing::TEST (SuccessfulAssertionTest, EXPECT_STR)
 
 testing::TEST (SuccessfulAssertionTest, ASSERT)
 
 testing::TEST (SuccessfulAssertionTest, ASSERT_STR)
 
 TEST (AssertionResultTest, CopyConstructorWorksWhenNotOptimied)
 
 TEST (AssertionResultTest, ConstructionWorks)
 
 TEST (AssertionResultTest, NegationWorks)
 
 TEST (AssertionResultTest, StreamingWorks)
 
 TEST (AssertionResultTest, CanStreamOstreamManipulators)
 
 TEST (AssertionResultTest, ConstructibleFromImplicitlyConvertible)
 
std::ostream & operator<< (std::ostream &os, const Base &val)
 
std::ostream & operator<< (std::ostream &os, const Base *pointer)
 
 TEST (MessageTest, CanStreamUserTypeInGlobalNameSpace)
 
 TEST (MessageTest, CanStreamUserTypeInUnnamedNameSpace)
 
std::ostream & namespace1::operator<< (std::ostream &os, const MyTypeInNameSpace1 &val)
 
std::ostream & namespace1::operator<< (std::ostream &os, const MyTypeInNameSpace1 *pointer)
 
 TEST (MessageTest, CanStreamUserTypeInUserNameSpace)
 
std::ostream & operator<< (std::ostream &os, const namespace2::MyTypeInNameSpace2 &val)
 
std::ostream & operator<< (std::ostream &os, const namespace2::MyTypeInNameSpace2 *pointer)
 
 TEST (MessageTest, CanStreamUserTypeInUserNameSpaceWithStreamOperatorInGlobal)
 
 TEST (MessageTest, NullPointers)
 
 TEST (MessageTest, WideStrings)
 
 testing::TEST_F (TestInfoTest, Names)
 
 testing::TEST_F (TestInfoTest, result)
 
 testing::TEST (CodeLocationForTEST, Verify)
 
 testing::TEST_F (CodeLocationForTESTF, Verify)
 
 testing::TEST_P (CodeLocationForTESTP, Verify)
 
 testing::INSTANTIATE_TEST_CASE_P (, CodeLocationForTESTP, Values(0))
 
 testing::TYPED_TEST_CASE (CodeLocationForTYPEDTEST, int)
 
 testing::TYPED_TEST (CodeLocationForTYPEDTEST, Verify)
 
 testing::TYPED_TEST_CASE_P (CodeLocationForTYPEDTESTP)
 
 testing::TYPED_TEST_P (CodeLocationForTYPEDTESTP, Verify)
 
 testing::REGISTER_TYPED_TEST_CASE_P (CodeLocationForTYPEDTESTP, Verify)
 
 testing::INSTANTIATE_TYPED_TEST_CASE_P (My, CodeLocationForTYPEDTESTP, int)
 
 testing::TEST_F (SetUpTestCaseTest, Test1)
 
 testing::TEST_F (SetUpTestCaseTest, Test2)
 
 testing::TEST_F (InitGoogleTestTest, Empty)
 
 testing::TEST_F (InitGoogleTestTest, NoFlag)
 
 testing::TEST_F (InitGoogleTestTest, FilterBad)
 
 testing::TEST_F (InitGoogleTestTest, FilterEmpty)
 
 testing::TEST_F (InitGoogleTestTest, FilterNonEmpty)
 
 testing::TEST_F (InitGoogleTestTest, BreakOnFailureWithoutValue)
 
 testing::TEST_F (InitGoogleTestTest, BreakOnFailureFalse_0)
 
 testing::TEST_F (InitGoogleTestTest, BreakOnFailureFalse_f)
 
 testing::TEST_F (InitGoogleTestTest, BreakOnFailureFalse_F)
 
 testing::TEST_F (InitGoogleTestTest, BreakOnFailureTrue)
 
 testing::TEST_F (InitGoogleTestTest, CatchExceptions)
 
 testing::TEST_F (InitGoogleTestTest, DeathTestUseFork)
 
 testing::TEST_F (InitGoogleTestTest, DuplicatedFlags)
 
 testing::TEST_F (InitGoogleTestTest, UnrecognizedFlag)
 
 testing::TEST_F (InitGoogleTestTest, ListTestsFlag)
 
 testing::TEST_F (InitGoogleTestTest, ListTestsTrue)
 
 testing::TEST_F (InitGoogleTestTest, ListTestsFalse)
 
 testing::TEST_F (InitGoogleTestTest, ListTestsFalse_f)
 
 testing::TEST_F (InitGoogleTestTest, ListTestsFalse_F)
 
 testing::TEST_F (InitGoogleTestTest, OutputEmpty)
 
 testing::TEST_F (InitGoogleTestTest, OutputXml)
 
 testing::TEST_F (InitGoogleTestTest, OutputXmlFile)
 
 testing::TEST_F (InitGoogleTestTest, OutputXmlDirectory)
 
 testing::TEST_F (InitGoogleTestTest, PrintTimeFlag)
 
 testing::TEST_F (InitGoogleTestTest, PrintTimeTrue)
 
 testing::TEST_F (InitGoogleTestTest, PrintTimeFalse)
 
 testing::TEST_F (InitGoogleTestTest, PrintTimeFalse_f)
 
 testing::TEST_F (InitGoogleTestTest, PrintTimeFalse_F)
 
 testing::TEST_F (InitGoogleTestTest, RandomSeed)
 
 testing::TEST_F (InitGoogleTestTest, Repeat)
 
 testing::TEST_F (InitGoogleTestTest, AlsoRunDisabledTestsFlag)
 
 testing::TEST_F (InitGoogleTestTest, AlsoRunDisabledTestsTrue)
 
 testing::TEST_F (InitGoogleTestTest, AlsoRunDisabledTestsFalse)
 
 testing::TEST_F (InitGoogleTestTest, ShuffleWithoutValue)
 
 testing::TEST_F (InitGoogleTestTest, ShuffleFalse_0)
 
 testing::TEST_F (InitGoogleTestTest, ShuffleTrue)
 
 testing::TEST_F (InitGoogleTestTest, StackTraceDepth)
 
 testing::TEST_F (InitGoogleTestTest, StreamResultTo)
 
 testing::TEST_F (InitGoogleTestTest, ThrowOnFailureWithoutValue)
 
 testing::TEST_F (InitGoogleTestTest, ThrowOnFailureFalse_0)
 
 testing::TEST_F (InitGoogleTestTest, ThrowOnFailureTrue)
 
 testing::TEST_F (CurrentTestInfoTest, WorksForFirstTestInATestCase)
 
 testing::TEST_F (CurrentTestInfoTest, WorksForSecondTestInATestCase)
 
 my_namespace::testing::TEST (NestedTestingNamespaceTest, Success)
 
 my_namespace::testing::TEST (NestedTestingNamespaceTest, Failure)
 
 TEST (StreamingAssertionsTest, Unconditional)
 
 TEST (StreamingAssertionsTest, Truth)
 
 TEST (StreamingAssertionsTest, Truth2)
 
 TEST (StreamingAssertionsTest, IntegerEquals)
 
 TEST (StreamingAssertionsTest, IntegerLessThan)
 
 TEST (StreamingAssertionsTest, StringsEqual)
 
 TEST (StreamingAssertionsTest, StringsNotEqual)
 
 TEST (StreamingAssertionsTest, StringsEqualIgnoringCase)
 
 TEST (StreamingAssertionsTest, StringNotEqualIgnoringCase)
 
 TEST (StreamingAssertionsTest, FloatingPointEquals)
 
 TEST (ColoredOutputTest, UsesColorsWhenGTestColorFlagIsYes)
 
 TEST (ColoredOutputTest, UsesColorsWhenGTestColorFlagIsAliasOfYes)
 
 TEST (ColoredOutputTest, UsesNoColorWhenGTestColorFlagIsNo)
 
 TEST (ColoredOutputTest, UsesNoColorWhenGTestColorFlagIsInvalid)
 
 TEST (ColoredOutputTest, UsesColorsWhenStdoutIsTty)
 
 TEST (ColoredOutputTest, UsesColorsWhenTermSupportsColors)
 
 TEST (StaticAssertTypeEqTest, WorksInClass)
 
 TEST (StaticAssertTypeEqTest, CompilesForEqualTypes)
 
 TEST (GetCurrentOsStackTraceExceptTopTest, ReturnsTheStackTrace)
 
 TEST (HasNonfatalFailureTest, ReturnsFalseWhenThereIsNoFailure)
 
static void FailFatally ()
 
 TEST (HasNonfatalFailureTest, ReturnsFalseWhenThereIsOnlyFatalFailure)
 
 TEST (HasNonfatalFailureTest, ReturnsTrueWhenThereIsNonfatalFailure)
 
 TEST (HasNonfatalFailureTest, ReturnsTrueWhenThereAreFatalAndNonfatalFailures)
 
static bool HasNonfatalFailureHelper ()
 
 TEST (HasNonfatalFailureTest, WorksOutsideOfTestBody)
 
 TEST (HasNonfatalFailureTest, WorksOutsideOfTestBody2)
 
 TEST (HasFailureTest, ReturnsFalseWhenThereIsNoFailure)
 
 TEST (HasFailureTest, ReturnsTrueWhenThereIsFatalFailure)
 
 TEST (HasFailureTest, ReturnsTrueWhenThereIsNonfatalFailure)
 
 TEST (HasFailureTest, ReturnsTrueWhenThereAreFatalAndNonfatalFailures)
 
static bool HasFailureHelper ()
 
 TEST (HasFailureTest, WorksOutsideOfTestBody)
 
 TEST (HasFailureTest, WorksOutsideOfTestBody2)
 
 TEST (TestEventListenersTest, ConstructionWorks)
 
 TEST (TestEventListenersTest, DestructionWorks)
 
 TEST (TestEventListenersTest, Append)
 
 TEST (EventListenerTest, AppendKeepsOrder)
 
 TEST (TestEventListenersTest, Release)
 
 TEST (EventListenerTest, SuppressEventForwarding)
 
 TEST (EventListenerDeathTest, EventsNotForwardedInDeathTestSubprecesses)
 
 TEST (EventListenerTest, default_result_printer)
 
 TEST (EventListenerTest, RemovingDefaultResultPrinterWorks)
 
 TEST (EventListenerTest, default_xml_generator)
 
 TEST (EventListenerTest, RemovingDefaultXmlGeneratorWorks)
 
 GTEST_TEST (AlternativeNameTest, Works)
 
 TEST (IsAProtocolMessageTest, ValueIsCompileTimeConstant)
 
 TEST (IsAProtocolMessageTest, ValueIsTrueWhenTypeIsAProtocolMessage)
 
 TEST (IsAProtocolMessageTest, ValueIsFalseWhenTypeIsNotAProtocolMessage)
 
 TEST (CompileAssertTypesEqual, CompilesWhenTypesAreEqual)
 
 TEST (RemoveReferenceTest, DoesNotAffectNonReferenceType)
 
 TEST (RemoveReferenceTest, RemovesReference)
 
template<typename T1 , typename T2 >
void TestGTestRemoveReference ()
 
 TEST (RemoveReferenceTest, MacroVersion)
 
 TEST (RemoveConstTest, DoesNotAffectNonConstType)
 
 TEST (RemoveConstTest, RemovesConst)
 
template<typename T1 , typename T2 >
void TestGTestRemoveConst ()
 
 TEST (RemoveConstTest, MacroVersion)
 
template<typename T1 , typename T2 >
void TestGTestRemoveReferenceAndConst ()
 
 TEST (RemoveReferenceToConstTest, Works)
 
 TEST (AddReferenceTest, DoesNotAffectReferenceType)
 
 TEST (AddReferenceTest, AddsReference)
 
template<typename T1 , typename T2 >
void TestGTestAddReference ()
 
 TEST (AddReferenceTest, MacroVersion)
 
template<typename T1 , typename T2 >
void TestGTestReferenceToConst ()
 
 TEST (GTestReferenceToConstTest, Works)
 
 TEST (ImplicitlyConvertibleTest, ValueIsCompileTimeConstant)
 
 TEST (ImplicitlyConvertibleTest, ValueIsTrueWhenConvertible)
 
 TEST (ImplicitlyConvertibleTest, ValueIsFalseWhenNotConvertible)
 
 TEST (IsContainerTestTest, WorksForNonContainer)
 
 TEST (IsContainerTestTest, WorksForContainer)
 
 TEST (ArrayEqTest, WorksForDegeneratedArrays)
 
 TEST (ArrayEqTest, WorksForOneDimensionalArrays)
 
 TEST (ArrayEqTest, WorksForTwoDimensionalArrays)
 
 TEST (ArrayAwareFindTest, WorksForOneDimensionalArray)
 
 TEST (ArrayAwareFindTest, WorksForTwoDimensionalArray)
 
 TEST (CopyArrayTest, WorksForDegeneratedArrays)
 
 TEST (CopyArrayTest, WorksForOneDimensionalArrays)
 
 TEST (CopyArrayTest, WorksForTwoDimensionalArrays)
 
 TEST (NativeArrayTest, ConstructorFromArrayWorks)
 
 TEST (NativeArrayTest, CreatesAndDeletesCopyOfArrayWhenAskedTo)
 
 TEST (NativeArrayTest, TypeMembersAreCorrect)
 
 TEST (NativeArrayTest, MethodsWork)
 
 TEST (NativeArrayTest, WorksForTwoDimensionalArray)
 
 TEST (SkipPrefixTest, SkipsWhenPrefixMatches)
 
 TEST (SkipPrefixTest, DoesNotSkipWhenPrefixDoesNotMatch)
 

Variables

static bool dummy1 GTEST_ATTRIBUTE_UNUSED_ = StaticAssertTypeEq<bool, bool>()
 

Macro Definition Documentation

#define GTEST_IMPLEMENTATION_   1

Definition at line 75 of file gtest_unittest.cc.

#define GTEST_TEST_PARSING_FLAGS_ (   argv1,
  argv2,
  expected,
  should_print_help 
)
Value:
TestParsingFlags(sizeof(argv1)/sizeof(*argv1) - 1, argv1, \
sizeof(argv2)/sizeof(*argv2) - 1, argv2, \
expected, should_print_help)

Definition at line 5705 of file gtest_unittest.cc.

#define GTEST_USE_UNPROTECTED_COMMA_   global_var++, global_var++

Definition at line 1238 of file gtest_unittest.cc.

#define VERIFY_CODE_LOCATION
Value:
const int expected_line = __LINE__ - 1; \
ASSERT_TRUE(test_info); \
EXPECT_STREQ(__FILE__, test_info->file()); \
EXPECT_EQ(expected_line, test_info->line())
class UnitTestImpl * GetUnitTestImpl()
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
const
Definition: upload.py:398
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865

Definition at line 5337 of file gtest_unittest.cc.

Typedef Documentation

typedef int IntAlias

Definition at line 6884 of file gtest_unittest.cc.

Enumeration Type Documentation

anonymous enum

Definition at line 3899 of file gtest_unittest.cc.

3899  {
3900  kCaseA = -1,
3901 
3902 # if GTEST_OS_LINUX
3903 
3904  // We want to test the case where the size of the anonymous enum is
3905  // larger than sizeof(int), to make sure our implementation of the
3906  // assertions doesn't truncate the enums. However, MSVC
3907  // (incorrectly) doesn't allow an enum value to exceed the range of
3908  // an int, so this has to be conditionally compiled.
3909  //
3910  // On Linux, kCaseB and kCaseA have the same value when truncated to
3911  // int size. We want to test whether this will confuse the
3912  // assertions.
3914 
3915 # else
3916 
3917  kCaseB = INT_MAX,
3918 
3919 # endif // GTEST_OS_LINUX
3920 
3921  kCaseC = 42
3922 };
const BiggestInt kMaxBiggestInt
Definition: gtest-port.h:2439
enum NamedEnum

Definition at line 3880 of file gtest_unittest.cc.

3880  {
3881  kE1 = 0,
3882  kE2 = 1
3883 };

Function Documentation

static void FailFatally ( )
static

Definition at line 6903 of file gtest_unittest.cc.

References FAIL.

Referenced by TEST().

6903 { FAIL(); }
#define FAIL()
Definition: gtest.h:1822
GTEST_TEST ( AlternativeNameTest  ,
Works   
)

Definition at line 7305 of file gtest_unittest.cc.

References EXPECT_FATAL_FAILURE, GTEST_ASSERT_EQ, GTEST_ASSERT_GE, GTEST_ASSERT_GT, GTEST_ASSERT_LE, GTEST_ASSERT_LT, GTEST_ASSERT_NE, GTEST_FAIL, and GTEST_SUCCEED.

7305  { // GTEST_TEST is the same as TEST.
7306  GTEST_SUCCEED() << "OK"; // GTEST_SUCCEED is the same as SUCCEED.
7307 
7308  // GTEST_FAIL is the same as FAIL.
7309  EXPECT_FATAL_FAILURE(GTEST_FAIL() << "An expected failure",
7310  "An expected failure");
7311 
7312  // GTEST_ASSERT_XY is the same as ASSERT_XY.
7313 
7314  GTEST_ASSERT_EQ(0, 0);
7315  EXPECT_FATAL_FAILURE(GTEST_ASSERT_EQ(0, 1) << "An expected failure",
7316  "An expected failure");
7317  EXPECT_FATAL_FAILURE(GTEST_ASSERT_EQ(1, 0) << "An expected failure",
7318  "An expected failure");
7319 
7320  GTEST_ASSERT_NE(0, 1);
7321  GTEST_ASSERT_NE(1, 0);
7322  EXPECT_FATAL_FAILURE(GTEST_ASSERT_NE(0, 0) << "An expected failure",
7323  "An expected failure");
7324 
7325  GTEST_ASSERT_LE(0, 0);
7326  GTEST_ASSERT_LE(0, 1);
7327  EXPECT_FATAL_FAILURE(GTEST_ASSERT_LE(1, 0) << "An expected failure",
7328  "An expected failure");
7329 
7330  GTEST_ASSERT_LT(0, 1);
7331  EXPECT_FATAL_FAILURE(GTEST_ASSERT_LT(0, 0) << "An expected failure",
7332  "An expected failure");
7333  EXPECT_FATAL_FAILURE(GTEST_ASSERT_LT(1, 0) << "An expected failure",
7334  "An expected failure");
7335 
7336  GTEST_ASSERT_GE(0, 0);
7337  GTEST_ASSERT_GE(1, 0);
7338  EXPECT_FATAL_FAILURE(GTEST_ASSERT_GE(0, 1) << "An expected failure",
7339  "An expected failure");
7340 
7341  GTEST_ASSERT_GT(1, 0);
7342  EXPECT_FATAL_FAILURE(GTEST_ASSERT_GT(0, 1) << "An expected failure",
7343  "An expected failure");
7344  EXPECT_FATAL_FAILURE(GTEST_ASSERT_GT(1, 1) << "An expected failure",
7345  "An expected failure");
7346 }
#define GTEST_ASSERT_EQ(val1, val2)
Definition: gtest.h:1937
#define GTEST_ASSERT_LT(val1, val2)
Definition: gtest.h:1945
#define GTEST_SUCCEED()
Definition: gtest.h:1826
#define GTEST_ASSERT_GE(val1, val2)
Definition: gtest.h:1947
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define GTEST_ASSERT_GT(val1, val2)
Definition: gtest.h:1949
#define GTEST_ASSERT_LE(val1, val2)
Definition: gtest.h:1943
#define GTEST_FAIL()
Definition: gtest.h:1817
#define GTEST_ASSERT_NE(val1, val2)
Definition: gtest.h:1941
static bool HasFailureHelper ( )
static

Definition at line 6970 of file gtest_unittest.cc.

References testing::Test::HasFailure().

Referenced by TEST().

6970 { return testing::Test::HasFailure(); }
static bool HasFailure()
Definition: gtest.h:407
static bool HasNonfatalFailureHelper ( )
static

Definition at line 6928 of file gtest_unittest.cc.

References testing::Test::HasNonfatalFailure().

Referenced by TEST().

6928  {
6930 }
static bool HasNonfatalFailure()
Definition: gtest.cc:2492
::std::ostream& operator<< ( ::std::ostream &  os,
const TestingVector vector 
)

Definition at line 305 of file gtest_unittest.cc.

References a, ADD_FAILURE, ASSERT_PRED1, ASSERT_TRUE, folly::test::begin(), testing::internal::String::CaseInsensitiveWideCStringEquals(), testing::internal::TestResultAccessor::ClearTestPartResults(), testing::internal::CodePointToUtf8(), testing::internal::CountIf(), folly::test::end(), testing::internal::String::EndsWithCaseInsensitive(), EXPECT_DEATH_IF_SUPPORTED, EXPECT_EQ, EXPECT_FALSE, EXPECT_FATAL_FAILURE, EXPECT_FATAL_FAILURE_ON_ALL_THREADS, EXPECT_LE, EXPECT_LT, EXPECT_NE, EXPECT_PRED3, EXPECT_STREQ, EXPECT_TRUE, FAIL, testing::TestPartResult::fatally_failed(), testing::internal::ForEach(), testing::internal::FormatEpochTimeInMillisAsIso8601(), testing::internal::FormatTimeInMillisAsSeconds(), bm::free(), testing::internal::Random::Generate(), testing::internal::GetElementOr(), testing::internal::GetNextRandomSeed(), testing::internal::GetRandomSeedFromFlag(), testing::TestPartResultArray::GetTestPartResult(), testing::internal::GetTestTypeId(), testing::internal::GetUnitTestImpl(), GTEST_DISABLE_MSC_WARNINGS_POP_, GTEST_DISABLE_MSC_WARNINGS_PUSH_, GTEST_IS_NULL_LITERAL_, i, testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, testing::ScopedFakeTestPartResultReporter::INTERCEPT_ONLY_CURRENT_THREAD, testing::gmock_matchers_test::IsPositive(), testing::TestProperty::key(), testing::internal::kMaxRandomSeed, testing::internal::Random::kMaxRange, kSeed, testing::internal::kTestTypeIdInGoogleTest, testing::TestPartResult::nonfatally_failed(), random(), testing::internal::Random::Reseed(), s, seed, testing::internal::String::ShowWideCString(), testing::internal::Shuffle(), testing::internal::ShuffleRange(), testing::TestPartResultArray::size(), string, testing::internal::TEST(), testing::internal::TEST_F(), v, testing::TestProperty::value(), values(), and testing::internal::WideStringToUtf8().

306  {
307  os << "{ ";
308  for (size_t i = 0; i < vector.size(); i++) {
309  os << vector[i] << " ";
310  }
311  os << "}";
312  return os;
313 }
std::ostream& operator<< ( std::ostream &  os,
const Base val 
)

Definition at line 5162 of file gtest_unittest.cc.

5163  {
5164  return os << val.x();
5165 }
double val
Definition: String.cpp:273
std::ostream& operator<< ( std::ostream &  os,
const Base pointer 
)

Definition at line 5166 of file gtest_unittest.cc.

5167  {
5168  return os << "(" << pointer->x() << ")";
5169 }
std::ostream& operator<< ( std::ostream &  os,
const namespace2::MyTypeInNameSpace2 val 
)

Definition at line 5237 of file gtest_unittest.cc.

5238  {
5239  return os << val.x();
5240 }
std::ostream& operator<< ( std::ostream &  os,
const namespace2::MyTypeInNameSpace2 pointer 
)

Definition at line 5241 of file gtest_unittest.cc.

5242  {
5243  return os << "(" << pointer->x() << ")";
5244 }
TEST ( CommandLineFlagsTest  ,
CanBeAccessedInCodeOnceGTestHIsIncluded   
)

Definition at line 40 of file gtest_unittest.cc.

References dummy(), EXPECT_TRUE, folly::pushmi::operators::filter, GTEST_FLAG, gmock_output_test::output, and repeat().

40  {
41  bool dummy = testing::GTEST_FLAG(also_run_disabled_tests)
42  || testing::GTEST_FLAG(break_on_failure)
43  || testing::GTEST_FLAG(catch_exceptions)
44  || testing::GTEST_FLAG(color) != "unknown"
45  || testing::GTEST_FLAG(filter) != "unknown"
46  || testing::GTEST_FLAG(list_tests)
47  || testing::GTEST_FLAG(output) != "unknown"
48  || testing::GTEST_FLAG(print_time)
49  || testing::GTEST_FLAG(random_seed)
51  || testing::GTEST_FLAG(show_internal_stack_frames)
52  || testing::GTEST_FLAG(shuffle)
53  || testing::GTEST_FLAG(stack_trace_depth) > 0
54  || testing::GTEST_FLAG(stream_result_to) != "unknown"
55  || testing::GTEST_FLAG(throw_on_failure);
56  EXPECT_TRUE(dummy || !dummy); // Suppresses warning that dummy is unused.
57 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
void repeat(F const &func)
void dummy()
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TEST ( AssertionResultTest  ,
CopyConstructorWorksWhenNotOptimied   
)

Definition at line 5067 of file gtest_unittest.cc.

References testing::AssertionSuccess(), EXPECT_EQ, EXPECT_STREQ, and testing::AssertionResult::message().

5067  {
5068  // Checks that the copy constructor doesn't try to dereference NULL pointers
5069  // in the source object.
5071  AssertionResult r2 = r1;
5072  // The following line is added to prevent the compiler from optimizing
5073  // away the constructor call.
5074  r1 << "abc";
5075 
5076  AssertionResult r3 = r1;
5077  EXPECT_EQ(static_cast<bool>(r3), static_cast<bool>(r1));
5078  EXPECT_STREQ("abc", r1.message());
5079 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
const char * message() const
Definition: gtest.h:297
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
TEST ( AssertionResultTest  ,
ConstructionWorks   
)

Definition at line 5083 of file gtest_unittest.cc.

References testing::AssertionFailure(), testing::AssertionSuccess(), EXPECT_FALSE, EXPECT_STREQ, EXPECT_TRUE, and testing::AssertionResult::message().

5083  {
5085  EXPECT_TRUE(r1);
5086  EXPECT_STREQ("", r1.message());
5087 
5088  AssertionResult r2 = AssertionSuccess() << "abc";
5089  EXPECT_TRUE(r2);
5090  EXPECT_STREQ("abc", r2.message());
5091 
5093  EXPECT_FALSE(r3);
5094  EXPECT_STREQ("", r3.message());
5095 
5096  AssertionResult r4 = AssertionFailure() << "def";
5097  EXPECT_FALSE(r4);
5098  EXPECT_STREQ("def", r4.message());
5099 
5100  AssertionResult r5 = AssertionFailure(Message() << "ghi");
5101  EXPECT_FALSE(r5);
5102  EXPECT_STREQ("ghi", r5.message());
5103 }
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:1015
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
const char * message() const
Definition: gtest.h:297
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( AssertionResultTest  ,
NegationWorks   
)

Definition at line 5106 of file gtest_unittest.cc.

References testing::AssertionFailure(), testing::AssertionSuccess(), EXPECT_FALSE, EXPECT_STREQ, EXPECT_TRUE, and message.

5106  {
5107  AssertionResult r1 = AssertionSuccess() << "abc";
5108  EXPECT_FALSE(!r1);
5109  EXPECT_STREQ("abc", (!r1).message());
5110 
5111  AssertionResult r2 = AssertionFailure() << "def";
5112  EXPECT_TRUE(!r2);
5113  EXPECT_STREQ("def", (!r2).message());
5114 }
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:1015
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
std::string message
Definition: SPDYCodec.cpp:133
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( AssertionResultTest  ,
StreamingWorks   
)

Definition at line 5116 of file gtest_unittest.cc.

References testing::AssertionSuccess(), EXPECT_STREQ, and testing::AssertionResult::message().

5116  {
5118  r << "abc" << 'd' << 0 << true;
5119  EXPECT_STREQ("abcd0true", r.message());
5120 }
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
const char * message() const
Definition: gtest.h:297
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
TEST ( AssertionResultTest  ,
CanStreamOstreamManipulators   
)

Definition at line 5122 of file gtest_unittest.cc.

References testing::AssertionSuccess(), EXPECT_FALSE, EXPECT_STREQ, EXPECT_TRUE, testing::AssertionResult::message(), testing::internal::TEST(), and value.

5122  {
5124  r << "Data" << std::endl << std::flush << std::ends << "Will be visible";
5125  EXPECT_STREQ("Data\n\\0Will be visible", r.message());
5126 }
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
const char * message() const
Definition: gtest.h:297
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:1010
TEST ( AssertionResultTest  ,
ConstructibleFromImplicitlyConvertible   
)

Definition at line 5148 of file gtest_unittest.cc.

References EXPECT_TRUE.

5148  {
5150  EXPECT_TRUE(obj);
5151 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TEST ( MessageTest  ,
CanStreamUserTypeInGlobalNameSpace   
)

Definition at line 5171 of file gtest_unittest.cc.

References a, EXPECT_STREQ, testing::Message::GetString(), testing::operator<<(), and val.

5171  {
5172  Message msg;
5173  Base a(1);
5174 
5175  msg << a << &a; // Uses ::operator<<.
5176  EXPECT_STREQ("1(1)", msg.GetString().c_str());
5177 }
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
AtomicCounter< T, DeterministicAtomic > Base
char a
std::string GetString() const
Definition: gtest.cc:981
TEST ( MessageTest  ,
CanStreamUserTypeInUnnamedNameSpace   
)

Definition at line 5196 of file gtest_unittest.cc.

References a, EXPECT_STREQ, and testing::Message::GetString().

5196  {
5197  Message msg;
5198  MyTypeInUnnamedNameSpace a(1);
5199 
5200  msg << a << &a; // Uses <unnamed_namespace>::operator<<.
5201  EXPECT_STREQ("1(1)", msg.GetString().c_str());
5202 }
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
char a
std::string GetString() const
Definition: gtest.cc:981
TEST ( MessageTest  ,
CanStreamUserTypeInUserNameSpace   
)

Definition at line 5221 of file gtest_unittest.cc.

References a, EXPECT_STREQ, and testing::Message::GetString().

5221  {
5222  Message msg;
5224 
5225  msg << a << &a; // Uses namespace1::operator<<.
5226  EXPECT_STREQ("1(1)", msg.GetString().c_str());
5227 }
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
char a
std::string GetString() const
Definition: gtest.cc:981
TEST ( MessageTest  ,
CanStreamUserTypeInUserNameSpaceWithStreamOperatorInGlobal   
)

Definition at line 5246 of file gtest_unittest.cc.

References a, EXPECT_STREQ, and testing::Message::GetString().

5246  {
5247  Message msg;
5249 
5250  msg << a << &a; // Uses ::operator<<.
5251  EXPECT_STREQ("1(1)", msg.GetString().c_str());
5252 }
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
char a
std::string GetString() const
Definition: gtest.cc:981
TEST ( MessageTest  ,
NullPointers   
)

Definition at line 5255 of file gtest_unittest.cc.

References ASSERT_STREQ, and testing::Message::GetString().

5255  {
5256  Message msg;
5257  char* const p1 = NULL;
5258  unsigned char* const p2 = NULL;
5259  int* p3 = NULL;
5260  double* p4 = NULL;
5261  bool* p5 = NULL;
5262  Message* p6 = NULL;
5263 
5264  msg << p1 << p2 << p3 << p4 << p5 << p6;
5265  ASSERT_STREQ("(null)(null)(null)(null)(null)(null)",
5266  msg.GetString().c_str());
5267 }
#define ASSERT_STREQ(s1, s2)
Definition: gtest.h:2004
std::string GetString() const
Definition: gtest.cc:981
TEST ( MessageTest  ,
WideStrings   
)

Definition at line 5270 of file gtest_unittest.cc.

References EXPECT_STREQ.

5270  {
5271  // Streams a NULL of type const wchar_t*.
5272  const wchar_t* const_wstr = NULL;
5273  EXPECT_STREQ("(null)",
5274  (Message() << const_wstr).GetString().c_str());
5275 
5276  // Streams a NULL of type wchar_t*.
5277  wchar_t* wstr = NULL;
5278  EXPECT_STREQ("(null)",
5279  (Message() << wstr).GetString().c_str());
5280 
5281  // Streams a non-NULL of type const wchar_t*.
5282  const_wstr = L"abc\x8119";
5283  EXPECT_STREQ("abc\xe8\x84\x99",
5284  (Message() << const_wstr).GetString().c_str());
5285 
5286  // Streams a non-NULL of type wchar_t*.
5287  wstr = const_cast<wchar_t*>(const_wstr);
5288  EXPECT_STREQ("abc\xe8\x84\x99",
5289  (Message() << wstr).GetString().c_str());
5290 }
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
TEST ( StreamingAssertionsTest  ,
Unconditional   
)

Definition at line 6609 of file gtest_unittest.cc.

References ADD_FAILURE, EXPECT_FATAL_FAILURE, EXPECT_NONFATAL_FAILURE, FAIL, and SUCCEED.

6609  {
6610  SUCCEED() << "expected success";
6611  EXPECT_NONFATAL_FAILURE(ADD_FAILURE() << "expected failure",
6612  "expected failure");
6613  EXPECT_FATAL_FAILURE(FAIL() << "expected failure",
6614  "expected failure");
6615 }
#define FAIL()
Definition: gtest.h:1822
#define SUCCEED()
Definition: gtest.h:1831
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:204
#define ADD_FAILURE()
Definition: gtest.h:1808
TEST ( StreamingAssertionsTest  ,
Truth   
)

Definition at line 6622 of file gtest_unittest.cc.

References ASSERT_TRUE, EXPECT_FATAL_FAILURE, EXPECT_NONFATAL_FAILURE, and EXPECT_TRUE.

6622  {
6623  EXPECT_TRUE(true) << "unexpected failure";
6624  ASSERT_TRUE(true) << "unexpected failure";
6625  EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(false) << "expected failure",
6626  "expected failure");
6627  EXPECT_FATAL_FAILURE(ASSERT_TRUE(false) << "expected failure",
6628  "expected failure");
6629 }
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:204
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865
TEST ( StreamingAssertionsTest  ,
Truth2   
)

Definition at line 6631 of file gtest_unittest.cc.

References ASSERT_FALSE, EXPECT_FALSE, EXPECT_FATAL_FAILURE, and EXPECT_NONFATAL_FAILURE.

6631  {
6632  EXPECT_FALSE(false) << "unexpected failure";
6633  ASSERT_FALSE(false) << "unexpected failure";
6634  EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(true) << "expected failure",
6635  "expected failure");
6636  EXPECT_FATAL_FAILURE(ASSERT_FALSE(true) << "expected failure",
6637  "expected failure");
6638 }
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:204
#define ASSERT_FALSE(condition)
Definition: gtest.h:1868
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( StreamingAssertionsTest  ,
IntegerEquals   
)

Definition at line 6645 of file gtest_unittest.cc.

References ASSERT_EQ, EXPECT_EQ, EXPECT_FATAL_FAILURE, and EXPECT_NONFATAL_FAILURE.

6645  {
6646  EXPECT_EQ(1, 1) << "unexpected failure";
6647  ASSERT_EQ(1, 1) << "unexpected failure";
6648  EXPECT_NONFATAL_FAILURE(EXPECT_EQ(1, 2) << "expected failure",
6649  "expected failure");
6650  EXPECT_FATAL_FAILURE(ASSERT_EQ(1, 2) << "expected failure",
6651  "expected failure");
6652 }
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:204
TEST ( StreamingAssertionsTest  ,
IntegerLessThan   
)

Definition at line 6654 of file gtest_unittest.cc.

References ASSERT_LT, EXPECT_FATAL_FAILURE, EXPECT_LT, and EXPECT_NONFATAL_FAILURE.

6654  {
6655  EXPECT_LT(1, 2) << "unexpected failure";
6656  ASSERT_LT(1, 2) << "unexpected failure";
6657  EXPECT_NONFATAL_FAILURE(EXPECT_LT(2, 1) << "expected failure",
6658  "expected failure");
6659  EXPECT_FATAL_FAILURE(ASSERT_LT(2, 1) << "expected failure",
6660  "expected failure");
6661 }
#define ASSERT_LT(val1, val2)
Definition: gtest.h:1968
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:204
#define EXPECT_LT(val1, val2)
Definition: gtest.h:1930
TEST ( StreamingAssertionsTest  ,
StringsEqual   
)

Definition at line 6663 of file gtest_unittest.cc.

References ASSERT_STREQ, EXPECT_FATAL_FAILURE, EXPECT_NONFATAL_FAILURE, and EXPECT_STREQ.

6663  {
6664  EXPECT_STREQ("foo", "foo") << "unexpected failure";
6665  ASSERT_STREQ("foo", "foo") << "unexpected failure";
6666  EXPECT_NONFATAL_FAILURE(EXPECT_STREQ("foo", "bar") << "expected failure",
6667  "expected failure");
6668  EXPECT_FATAL_FAILURE(ASSERT_STREQ("foo", "bar") << "expected failure",
6669  "expected failure");
6670 }
#define ASSERT_STREQ(s1, s2)
Definition: gtest.h:2004
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:204
TEST ( StreamingAssertionsTest  ,
StringsNotEqual   
)

Definition at line 6672 of file gtest_unittest.cc.

References ASSERT_STRNE, EXPECT_FATAL_FAILURE, EXPECT_NONFATAL_FAILURE, and EXPECT_STRNE.

6672  {
6673  EXPECT_STRNE("foo", "bar") << "unexpected failure";
6674  ASSERT_STRNE("foo", "bar") << "unexpected failure";
6675  EXPECT_NONFATAL_FAILURE(EXPECT_STRNE("foo", "foo") << "expected failure",
6676  "expected failure");
6677  EXPECT_FATAL_FAILURE(ASSERT_STRNE("foo", "foo") << "expected failure",
6678  "expected failure");
6679 }
#define EXPECT_STRNE(s1, s2)
Definition: gtest.h:1997
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:204
#define ASSERT_STRNE(s1, s2)
Definition: gtest.h:2006
TEST ( StreamingAssertionsTest  ,
StringsEqualIgnoringCase   
)

Definition at line 6681 of file gtest_unittest.cc.

References ASSERT_STRCASEEQ, EXPECT_FATAL_FAILURE, EXPECT_NONFATAL_FAILURE, and EXPECT_STRCASEEQ.

6681  {
6682  EXPECT_STRCASEEQ("foo", "FOO") << "unexpected failure";
6683  ASSERT_STRCASEEQ("foo", "FOO") << "unexpected failure";
6684  EXPECT_NONFATAL_FAILURE(EXPECT_STRCASEEQ("foo", "bar") << "expected failure",
6685  "expected failure");
6686  EXPECT_FATAL_FAILURE(ASSERT_STRCASEEQ("foo", "bar") << "expected failure",
6687  "expected failure");
6688 }
#define ASSERT_STRCASEEQ(s1, s2)
Definition: gtest.h:2008
#define EXPECT_STRCASEEQ(s1, s2)
Definition: gtest.h:1999
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:204
TEST ( StreamingAssertionsTest  ,
StringNotEqualIgnoringCase   
)

Definition at line 6690 of file gtest_unittest.cc.

References ASSERT_STRCASENE, EXPECT_FATAL_FAILURE, EXPECT_NONFATAL_FAILURE, and EXPECT_STRCASENE.

6690  {
6691  EXPECT_STRCASENE("foo", "bar") << "unexpected failure";
6692  ASSERT_STRCASENE("foo", "bar") << "unexpected failure";
6693  EXPECT_NONFATAL_FAILURE(EXPECT_STRCASENE("foo", "FOO") << "expected failure",
6694  "expected failure");
6695  EXPECT_FATAL_FAILURE(ASSERT_STRCASENE("bar", "BAR") << "expected failure",
6696  "expected failure");
6697 }
#define EXPECT_STRCASENE(s1, s2)
Definition: gtest.h:2001
#define ASSERT_STRCASENE(s1, s2)
Definition: gtest.h:2010
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:204
TEST ( StreamingAssertionsTest  ,
FloatingPointEquals   
)

Definition at line 6699 of file gtest_unittest.cc.

References ASSERT_ANY_THROW, ASSERT_FLOAT_EQ, ASSERT_NO_THROW, ASSERT_THROW, EXPECT_ANY_THROW, EXPECT_FATAL_FAILURE, EXPECT_FLOAT_EQ, EXPECT_NO_THROW, EXPECT_NONFATAL_FAILURE, EXPECT_THROW, and testing::internal::TEST().

6699  {
6700  EXPECT_FLOAT_EQ(1.0, 1.0) << "unexpected failure";
6701  ASSERT_FLOAT_EQ(1.0, 1.0) << "unexpected failure";
6702  EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(0.0, 1.0) << "expected failure",
6703  "expected failure");
6704  EXPECT_FATAL_FAILURE(ASSERT_FLOAT_EQ(0.0, 1.0) << "expected failure",
6705  "expected failure");
6706 }
#define EXPECT_FLOAT_EQ(val1, val2)
Definition: gtest.h:2027
#define ASSERT_FLOAT_EQ(val1, val2)
Definition: gtest.h:2035
#define EXPECT_FATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:138
#define EXPECT_NONFATAL_FAILURE(statement, substr)
Definition: gtest-spi.h:204
TEST ( ColoredOutputTest  ,
UsesColorsWhenGTestColorFlagIsYes   
)

Definition at line 6741 of file gtest_unittest.cc.

References EXPECT_TRUE, GTEST_FLAG, and testing::internal::ShouldUseColor().

6741  {
6742  GTEST_FLAG(color) = "yes";
6743 
6744  SetEnv("TERM", "xterm"); // TERM supports colors.
6745  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6746  EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
6747 
6748  SetEnv("TERM", "dumb"); // TERM doesn't support colors.
6749  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6750  EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
6751 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
GTEST_API_ bool ShouldUseColor(bool stdout_is_tty)
Definition: gtest.cc:2916
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TEST ( ColoredOutputTest  ,
UsesColorsWhenGTestColorFlagIsAliasOfYes   
)

Definition at line 6753 of file gtest_unittest.cc.

References EXPECT_TRUE, GTEST_FLAG, and testing::internal::ShouldUseColor().

6753  {
6754  SetEnv("TERM", "dumb"); // TERM doesn't support colors.
6755 
6756  GTEST_FLAG(color) = "True";
6757  EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
6758 
6759  GTEST_FLAG(color) = "t";
6760  EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
6761 
6762  GTEST_FLAG(color) = "1";
6763  EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
6764 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
GTEST_API_ bool ShouldUseColor(bool stdout_is_tty)
Definition: gtest.cc:2916
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TEST ( ColoredOutputTest  ,
UsesNoColorWhenGTestColorFlagIsNo   
)

Definition at line 6766 of file gtest_unittest.cc.

References EXPECT_FALSE, GTEST_FLAG, and testing::internal::ShouldUseColor().

6766  {
6767  GTEST_FLAG(color) = "no";
6768 
6769  SetEnv("TERM", "xterm"); // TERM supports colors.
6770  EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
6771  EXPECT_FALSE(ShouldUseColor(false)); // Stdout is not a TTY.
6772 
6773  SetEnv("TERM", "dumb"); // TERM doesn't support colors.
6774  EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
6775  EXPECT_FALSE(ShouldUseColor(false)); // Stdout is not a TTY.
6776 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
GTEST_API_ bool ShouldUseColor(bool stdout_is_tty)
Definition: gtest.cc:2916
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( ColoredOutputTest  ,
UsesNoColorWhenGTestColorFlagIsInvalid   
)

Definition at line 6778 of file gtest_unittest.cc.

References EXPECT_FALSE, GTEST_FLAG, and testing::internal::ShouldUseColor().

6778  {
6779  SetEnv("TERM", "xterm"); // TERM supports colors.
6780 
6781  GTEST_FLAG(color) = "F";
6782  EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
6783 
6784  GTEST_FLAG(color) = "0";
6785  EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
6786 
6787  GTEST_FLAG(color) = "unknown";
6788  EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
6789 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
GTEST_API_ bool ShouldUseColor(bool stdout_is_tty)
Definition: gtest.cc:2916
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( ColoredOutputTest  ,
UsesColorsWhenStdoutIsTty   
)

Definition at line 6791 of file gtest_unittest.cc.

References EXPECT_FALSE, EXPECT_TRUE, GTEST_FLAG, and testing::internal::ShouldUseColor().

6791  {
6792  GTEST_FLAG(color) = "auto";
6793 
6794  SetEnv("TERM", "xterm"); // TERM supports colors.
6795  EXPECT_FALSE(ShouldUseColor(false)); // Stdout is not a TTY.
6796  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6797 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
GTEST_API_ bool ShouldUseColor(bool stdout_is_tty)
Definition: gtest.cc:2916
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( ColoredOutputTest  ,
UsesColorsWhenTermSupportsColors   
)

Definition at line 6799 of file gtest_unittest.cc.

References EXPECT_FALSE, EXPECT_TRUE, GTEST_FLAG, and testing::internal::ShouldUseColor().

6799  {
6800  GTEST_FLAG(color) = "auto";
6801 
6802 #if GTEST_OS_WINDOWS
6803  // On Windows, we ignore the TERM variable as it's usually not set.
6804 
6805  SetEnv("TERM", "dumb");
6806  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6807 
6808  SetEnv("TERM", "");
6809  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6810 
6811  SetEnv("TERM", "xterm");
6812  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6813 #else
6814  // On non-Windows platforms, we rely on TERM to determine if the
6815  // terminal supports colors.
6816 
6817  SetEnv("TERM", "dumb"); // TERM doesn't support colors.
6818  EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
6819 
6820  SetEnv("TERM", "emacs"); // TERM doesn't support colors.
6821  EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
6822 
6823  SetEnv("TERM", "vt100"); // TERM doesn't support colors.
6824  EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
6825 
6826  SetEnv("TERM", "xterm-mono"); // TERM doesn't support colors.
6827  EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
6828 
6829  SetEnv("TERM", "xterm"); // TERM supports colors.
6830  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6831 
6832  SetEnv("TERM", "xterm-color"); // TERM supports colors.
6833  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6834 
6835  SetEnv("TERM", "xterm-256color"); // TERM supports colors.
6836  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6837 
6838  SetEnv("TERM", "screen"); // TERM supports colors.
6839  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6840 
6841  SetEnv("TERM", "screen-256color"); // TERM supports colors.
6842  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6843 
6844  SetEnv("TERM", "tmux"); // TERM supports colors.
6845  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6846 
6847  SetEnv("TERM", "tmux-256color"); // TERM supports colors.
6848  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6849 
6850  SetEnv("TERM", "rxvt-unicode"); // TERM supports colors.
6851  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6852 
6853  SetEnv("TERM", "rxvt-unicode-256color"); // TERM supports colors.
6854  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6855 
6856  SetEnv("TERM", "linux"); // TERM supports colors.
6857  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6858 
6859  SetEnv("TERM", "cygwin"); // TERM supports colors.
6860  EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6861 #endif // GTEST_OS_WINDOWS
6862 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
GTEST_API_ bool ShouldUseColor(bool stdout_is_tty)
Definition: gtest.cc:2916
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( StaticAssertTypeEqTest  ,
WorksInClass   
)

Definition at line 6878 of file gtest_unittest.cc.

TEST ( StaticAssertTypeEqTest  ,
CompilesForEqualTypes   
)

Definition at line 6886 of file gtest_unittest.cc.

6886  {
6887  StaticAssertTypeEq<int, IntAlias>();
6888  StaticAssertTypeEq<int*, IntAlias*>();
6889 }
TEST ( GetCurrentOsStackTraceExceptTopTest  ,
ReturnsTheStackTrace   
)

Definition at line 6891 of file gtest_unittest.cc.

References EXPECT_STREQ, testing::internal::GetCurrentOsStackTraceExceptTop(), and testing::UnitTest::GetInstance().

6891  {
6893 
6894  // We don't have a stack walker in Google Test yet.
6895  EXPECT_STREQ("", GetCurrentOsStackTraceExceptTop(unit_test, 0).c_str());
6896  EXPECT_STREQ("", GetCurrentOsStackTraceExceptTop(unit_test, 1).c_str());
6897 }
GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(UnitTest *unit_test, int skip_count)
Definition: gtest.cc:4973
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
static UnitTest * GetInstance()
Definition: gtest.cc:3972
TEST ( HasNonfatalFailureTest  ,
ReturnsFalseWhenThereIsNoFailure   
)

Definition at line 6899 of file gtest_unittest.cc.

References EXPECT_FALSE.

6899  {
6900  EXPECT_FALSE(HasNonfatalFailure());
6901 }
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( HasNonfatalFailureTest  ,
ReturnsFalseWhenThereIsOnlyFatalFailure   
)

Definition at line 6905 of file gtest_unittest.cc.

References EXPECT_FALSE, and FailFatally().

6905  {
6906  FailFatally();
6907  const bool has_nonfatal_failure = HasNonfatalFailure();
6908  ClearCurrentTestPartResults();
6909  EXPECT_FALSE(has_nonfatal_failure);
6910 }
static void FailFatally()
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( HasNonfatalFailureTest  ,
ReturnsTrueWhenThereIsNonfatalFailure   
)

Definition at line 6912 of file gtest_unittest.cc.

References ADD_FAILURE, and EXPECT_TRUE.

6912  {
6913  ADD_FAILURE();
6914  const bool has_nonfatal_failure = HasNonfatalFailure();
6915  ClearCurrentTestPartResults();
6916  EXPECT_TRUE(has_nonfatal_failure);
6917 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define ADD_FAILURE()
Definition: gtest.h:1808
TEST ( HasNonfatalFailureTest  ,
ReturnsTrueWhenThereAreFatalAndNonfatalFailures   
)

Definition at line 6919 of file gtest_unittest.cc.

References ADD_FAILURE, EXPECT_TRUE, and FailFatally().

6919  {
6920  FailFatally();
6921  ADD_FAILURE();
6922  const bool has_nonfatal_failure = HasNonfatalFailure();
6923  ClearCurrentTestPartResults();
6924  EXPECT_TRUE(has_nonfatal_failure);
6925 }
static void FailFatally()
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define ADD_FAILURE()
Definition: gtest.h:1808
TEST ( HasNonfatalFailureTest  ,
WorksOutsideOfTestBody   
)

Definition at line 6932 of file gtest_unittest.cc.

References EXPECT_FALSE, and HasNonfatalFailureHelper().

6932  {
6934 }
static bool HasNonfatalFailureHelper()
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( HasNonfatalFailureTest  ,
WorksOutsideOfTestBody2   
)

Definition at line 6936 of file gtest_unittest.cc.

References ADD_FAILURE, EXPECT_TRUE, and HasNonfatalFailureHelper().

6936  {
6937  ADD_FAILURE();
6938  const bool has_nonfatal_failure = HasNonfatalFailureHelper();
6939  ClearCurrentTestPartResults();
6940  EXPECT_TRUE(has_nonfatal_failure);
6941 }
static bool HasNonfatalFailureHelper()
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define ADD_FAILURE()
Definition: gtest.h:1808
TEST ( HasFailureTest  ,
ReturnsFalseWhenThereIsNoFailure   
)

Definition at line 6943 of file gtest_unittest.cc.

References EXPECT_FALSE.

6943  {
6944  EXPECT_FALSE(HasFailure());
6945 }
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( HasFailureTest  ,
ReturnsTrueWhenThereIsFatalFailure   
)

Definition at line 6947 of file gtest_unittest.cc.

References EXPECT_TRUE, and FailFatally().

6947  {
6948  FailFatally();
6949  const bool has_failure = HasFailure();
6950  ClearCurrentTestPartResults();
6951  EXPECT_TRUE(has_failure);
6952 }
static void FailFatally()
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TEST ( HasFailureTest  ,
ReturnsTrueWhenThereIsNonfatalFailure   
)

Definition at line 6954 of file gtest_unittest.cc.

References ADD_FAILURE, and EXPECT_TRUE.

6954  {
6955  ADD_FAILURE();
6956  const bool has_failure = HasFailure();
6957  ClearCurrentTestPartResults();
6958  EXPECT_TRUE(has_failure);
6959 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define ADD_FAILURE()
Definition: gtest.h:1808
TEST ( HasFailureTest  ,
ReturnsTrueWhenThereAreFatalAndNonfatalFailures   
)

Definition at line 6961 of file gtest_unittest.cc.

References ADD_FAILURE, EXPECT_TRUE, and FailFatally().

6961  {
6962  FailFatally();
6963  ADD_FAILURE();
6964  const bool has_failure = HasFailure();
6965  ClearCurrentTestPartResults();
6966  EXPECT_TRUE(has_failure);
6967 }
static void FailFatally()
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define ADD_FAILURE()
Definition: gtest.h:1808
TEST ( HasFailureTest  ,
WorksOutsideOfTestBody   
)

Definition at line 6972 of file gtest_unittest.cc.

References EXPECT_FALSE, and HasFailureHelper().

6972  {
6974 }
static bool HasFailureHelper()
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( HasFailureTest  ,
WorksOutsideOfTestBody2   
)

Definition at line 6976 of file gtest_unittest.cc.

References ADD_FAILURE, EXPECT_TRUE, and HasFailureHelper().

6976  {
6977  ADD_FAILURE();
6978  const bool has_failure = HasFailureHelper();
6979  ClearCurrentTestPartResults();
6980  EXPECT_TRUE(has_failure);
6981 }
static bool HasFailureHelper()
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define ADD_FAILURE()
Definition: gtest.h:1808
TEST ( TestEventListenersTest  ,
ConstructionWorks   
)

Definition at line 7007 of file gtest_unittest.cc.

References testing::TestEventListeners::default_result_printer(), testing::TestEventListeners::default_xml_generator(), EXPECT_TRUE, and testing::internal::TestEventListenersAccessor::GetRepeater().

7007  {
7008  TestEventListeners listeners;
7009 
7010  EXPECT_TRUE(TestEventListenersAccessor::GetRepeater(&listeners) != NULL);
7011  EXPECT_TRUE(listeners.default_result_printer() == NULL);
7012  EXPECT_TRUE(listeners.default_xml_generator() == NULL);
7013 }
TestEventListener * default_xml_generator() const
Definition: gtest.h:1095
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TestEventListener * default_result_printer() const
Definition: gtest.h:1084
TEST ( TestEventListenersTest  ,
DestructionWorks   
)

Definition at line 7017 of file gtest_unittest.cc.

References testing::TestEventListeners::Append(), EXPECT_TRUE, testing::internal::TestEventListenersAccessor::SetDefaultResultPrinter(), and testing::internal::TestEventListenersAccessor::SetDefaultXmlGenerator().

7017  {
7018  bool default_result_printer_is_destroyed = false;
7019  bool default_xml_printer_is_destroyed = false;
7020  bool extra_listener_is_destroyed = false;
7021  TestListener* default_result_printer = new TestListener(
7022  NULL, &default_result_printer_is_destroyed);
7023  TestListener* default_xml_printer = new TestListener(
7024  NULL, &default_xml_printer_is_destroyed);
7025  TestListener* extra_listener = new TestListener(
7026  NULL, &extra_listener_is_destroyed);
7027 
7028  {
7029  TestEventListeners listeners;
7030  TestEventListenersAccessor::SetDefaultResultPrinter(&listeners,
7031  default_result_printer);
7032  TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners,
7033  default_xml_printer);
7034  listeners.Append(extra_listener);
7035  }
7036  EXPECT_TRUE(default_result_printer_is_destroyed);
7037  EXPECT_TRUE(default_xml_printer_is_destroyed);
7038  EXPECT_TRUE(extra_listener_is_destroyed);
7039 }
void Append(TestEventListener *listener)
Definition: gtest.cc:3902
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TEST ( TestEventListenersTest  ,
Append   
)

Definition at line 7043 of file gtest_unittest.cc.

References testing::TestEventListeners::Append(), EXPECT_EQ, EXPECT_TRUE, testing::UnitTest::GetInstance(), testing::internal::TestEventListenersAccessor::GetRepeater(), and testing::TestEventListener::OnTestProgramStart().

7043  {
7044  int on_start_counter = 0;
7045  bool is_destroyed = false;
7046  TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
7047  {
7048  TestEventListeners listeners;
7049  listeners.Append(listener);
7050  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
7051  *UnitTest::GetInstance());
7052  EXPECT_EQ(1, on_start_counter);
7053  }
7054  EXPECT_TRUE(is_destroyed);
7055 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
void Append(TestEventListener *listener)
Definition: gtest.cc:3902
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TEST ( EventListenerTest  ,
AppendKeepsOrder   
)

Definition at line 7097 of file gtest_unittest.cc.

References testing::TestEventListeners::Append(), ASSERT_EQ, EXPECT_STREQ, testing::UnitTest::GetInstance(), testing::internal::TestEventListenersAccessor::GetRepeater(), testing::TestEventListener::OnTestIterationEnd(), testing::TestEventListener::OnTestIterationStart(), testing::TestEventListener::OnTestProgramEnd(), and testing::TestEventListener::OnTestProgramStart().

7097  {
7098  std::vector<std::string> vec;
7099  TestEventListeners listeners;
7100  listeners.Append(new SequenceTestingListener(&vec, "1st"));
7101  listeners.Append(new SequenceTestingListener(&vec, "2nd"));
7102  listeners.Append(new SequenceTestingListener(&vec, "3rd"));
7103 
7104  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
7105  *UnitTest::GetInstance());
7106  ASSERT_EQ(3U, vec.size());
7107  EXPECT_STREQ("1st.OnTestProgramStart", vec[0].c_str());
7108  EXPECT_STREQ("2nd.OnTestProgramStart", vec[1].c_str());
7109  EXPECT_STREQ("3rd.OnTestProgramStart", vec[2].c_str());
7110 
7111  vec.clear();
7112  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramEnd(
7113  *UnitTest::GetInstance());
7114  ASSERT_EQ(3U, vec.size());
7115  EXPECT_STREQ("3rd.OnTestProgramEnd", vec[0].c_str());
7116  EXPECT_STREQ("2nd.OnTestProgramEnd", vec[1].c_str());
7117  EXPECT_STREQ("1st.OnTestProgramEnd", vec[2].c_str());
7118 
7119  vec.clear();
7120  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestIterationStart(
7121  *UnitTest::GetInstance(), 0);
7122  ASSERT_EQ(3U, vec.size());
7123  EXPECT_STREQ("1st.OnTestIterationStart", vec[0].c_str());
7124  EXPECT_STREQ("2nd.OnTestIterationStart", vec[1].c_str());
7125  EXPECT_STREQ("3rd.OnTestIterationStart", vec[2].c_str());
7126 
7127  vec.clear();
7128  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestIterationEnd(
7129  *UnitTest::GetInstance(), 0);
7130  ASSERT_EQ(3U, vec.size());
7131  EXPECT_STREQ("3rd.OnTestIterationEnd", vec[0].c_str());
7132  EXPECT_STREQ("2nd.OnTestIterationEnd", vec[1].c_str());
7133  EXPECT_STREQ("1st.OnTestIterationEnd", vec[2].c_str());
7134 }
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
void Append(TestEventListener *listener)
Definition: gtest.cc:3902
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
vector< string > vec
Definition: StringTest.cpp:35
TEST ( TestEventListenersTest  ,
Release   
)

Definition at line 7138 of file gtest_unittest.cc.

References testing::TestEventListeners::Append(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, testing::UnitTest::GetInstance(), testing::internal::TestEventListenersAccessor::GetRepeater(), testing::TestEventListener::OnTestProgramStart(), and testing::TestEventListeners::Release().

7138  {
7139  int on_start_counter = 0;
7140  bool is_destroyed = false;
7141  // Although Append passes the ownership of this object to the list,
7142  // the following calls release it, and we need to delete it before the
7143  // test ends.
7144  TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
7145  {
7146  TestEventListeners listeners;
7147  listeners.Append(listener);
7148  EXPECT_EQ(listener, listeners.Release(listener));
7149  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
7150  *UnitTest::GetInstance());
7151  EXPECT_TRUE(listeners.Release(listener) == NULL);
7152  }
7153  EXPECT_EQ(0, on_start_counter);
7154  EXPECT_FALSE(is_destroyed);
7155  delete listener;
7156 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TestEventListener * Release(TestEventListener *listener)
Definition: gtest.cc:3909
void Append(TestEventListener *listener)
Definition: gtest.cc:3902
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( EventListenerTest  ,
SuppressEventForwarding   
)

Definition at line 7159 of file gtest_unittest.cc.

References testing::TestEventListeners::Append(), ASSERT_FALSE, ASSERT_TRUE, testing::internal::TestEventListenersAccessor::EventForwardingEnabled(), EXPECT_EQ, testing::UnitTest::GetInstance(), testing::internal::TestEventListenersAccessor::GetRepeater(), testing::TestEventListener::OnTestProgramStart(), and testing::internal::TestEventListenersAccessor::SuppressEventForwarding().

7159  {
7160  int on_start_counter = 0;
7161  TestListener* listener = new TestListener(&on_start_counter, NULL);
7162 
7163  TestEventListeners listeners;
7164  listeners.Append(listener);
7165  ASSERT_TRUE(TestEventListenersAccessor::EventForwardingEnabled(listeners));
7166  TestEventListenersAccessor::SuppressEventForwarding(&listeners);
7167  ASSERT_FALSE(TestEventListenersAccessor::EventForwardingEnabled(listeners));
7168  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
7169  *UnitTest::GetInstance());
7170  EXPECT_EQ(0, on_start_counter);
7171 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
void Append(TestEventListener *listener)
Definition: gtest.cc:3902
#define ASSERT_FALSE(condition)
Definition: gtest.h:1868
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865
TEST ( EventListenerDeathTest  ,
EventsNotForwardedInDeathTestSubprecesses   
)

Definition at line 7175 of file gtest_unittest.cc.

References testing::internal::TestEventListenersAccessor::EventForwardingEnabled(), EXPECT_DEATH_IF_SUPPORTED, testing::internal::GetUnitTestImpl(), and GTEST_CHECK_.

7175  {
7177  GTEST_CHECK_(TestEventListenersAccessor::EventForwardingEnabled(
7178  *GetUnitTestImpl()->listeners())) << "expected failure";},
7179  "expected failure");
7180 }
class UnitTestImpl * GetUnitTestImpl()
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1295
#define EXPECT_DEATH_IF_SUPPORTED(statement, regex)
TEST ( EventListenerTest  ,
default_result_printer   
)

Definition at line 7185 of file gtest_unittest.cc.

References testing::TestEventListeners::default_result_printer(), EXPECT_EQ, EXPECT_TRUE, testing::UnitTest::GetInstance(), testing::internal::TestEventListenersAccessor::GetRepeater(), testing::TestEventListener::OnTestProgramStart(), and testing::internal::TestEventListenersAccessor::SetDefaultResultPrinter().

7185  {
7186  int on_start_counter = 0;
7187  bool is_destroyed = false;
7188  TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
7189 
7190  TestEventListeners listeners;
7191  TestEventListenersAccessor::SetDefaultResultPrinter(&listeners, listener);
7192 
7193  EXPECT_EQ(listener, listeners.default_result_printer());
7194 
7195  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
7196  *UnitTest::GetInstance());
7197 
7198  EXPECT_EQ(1, on_start_counter);
7199 
7200  // Replacing default_result_printer with something else should remove it
7201  // from the list and destroy it.
7202  TestEventListenersAccessor::SetDefaultResultPrinter(&listeners, NULL);
7203 
7204  EXPECT_TRUE(listeners.default_result_printer() == NULL);
7205  EXPECT_TRUE(is_destroyed);
7206 
7207  // After broadcasting an event the counter is still the same, indicating
7208  // the listener is not in the list anymore.
7209  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
7210  *UnitTest::GetInstance());
7211  EXPECT_EQ(1, on_start_counter);
7212 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TestEventListener * default_result_printer() const
Definition: gtest.h:1084
TEST ( EventListenerTest  ,
RemovingDefaultResultPrinterWorks   
)

Definition at line 7216 of file gtest_unittest.cc.

References testing::TestEventListeners::default_result_printer(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, testing::UnitTest::GetInstance(), testing::internal::TestEventListenersAccessor::GetRepeater(), testing::TestEventListener::OnTestProgramStart(), testing::TestEventListeners::Release(), and testing::internal::TestEventListenersAccessor::SetDefaultResultPrinter().

7216  {
7217  int on_start_counter = 0;
7218  bool is_destroyed = false;
7219  // Although Append passes the ownership of this object to the list,
7220  // the following calls release it, and we need to delete it before the
7221  // test ends.
7222  TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
7223  {
7224  TestEventListeners listeners;
7225  TestEventListenersAccessor::SetDefaultResultPrinter(&listeners, listener);
7226 
7227  EXPECT_EQ(listener, listeners.Release(listener));
7228  EXPECT_TRUE(listeners.default_result_printer() == NULL);
7229  EXPECT_FALSE(is_destroyed);
7230 
7231  // Broadcasting events now should not affect default_result_printer.
7232  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
7233  *UnitTest::GetInstance());
7234  EXPECT_EQ(0, on_start_counter);
7235  }
7236  // Destroying the list should not affect the listener now, too.
7237  EXPECT_FALSE(is_destroyed);
7238  delete listener;
7239 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TestEventListener * Release(TestEventListener *listener)
Definition: gtest.cc:3909
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TestEventListener * default_result_printer() const
Definition: gtest.h:1084
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( EventListenerTest  ,
default_xml_generator   
)

Definition at line 7244 of file gtest_unittest.cc.

References testing::TestEventListeners::default_xml_generator(), EXPECT_EQ, EXPECT_TRUE, testing::UnitTest::GetInstance(), testing::internal::TestEventListenersAccessor::GetRepeater(), testing::TestEventListener::OnTestProgramStart(), and testing::internal::TestEventListenersAccessor::SetDefaultXmlGenerator().

7244  {
7245  int on_start_counter = 0;
7246  bool is_destroyed = false;
7247  TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
7248 
7249  TestEventListeners listeners;
7250  TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners, listener);
7251 
7252  EXPECT_EQ(listener, listeners.default_xml_generator());
7253 
7254  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
7255  *UnitTest::GetInstance());
7256 
7257  EXPECT_EQ(1, on_start_counter);
7258 
7259  // Replacing default_xml_generator with something else should remove it
7260  // from the list and destroy it.
7261  TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners, NULL);
7262 
7263  EXPECT_TRUE(listeners.default_xml_generator() == NULL);
7264  EXPECT_TRUE(is_destroyed);
7265 
7266  // After broadcasting an event the counter is still the same, indicating
7267  // the listener is not in the list anymore.
7268  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
7269  *UnitTest::GetInstance());
7270  EXPECT_EQ(1, on_start_counter);
7271 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TestEventListener * default_xml_generator() const
Definition: gtest.h:1095
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TEST ( EventListenerTest  ,
RemovingDefaultXmlGeneratorWorks   
)

Definition at line 7275 of file gtest_unittest.cc.

References testing::TestEventListeners::default_xml_generator(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, testing::UnitTest::GetInstance(), testing::internal::TestEventListenersAccessor::GetRepeater(), testing::TestEventListener::OnTestProgramStart(), testing::TestEventListeners::Release(), and testing::internal::TestEventListenersAccessor::SetDefaultXmlGenerator().

7275  {
7276  int on_start_counter = 0;
7277  bool is_destroyed = false;
7278  // Although Append passes the ownership of this object to the list,
7279  // the following calls release it, and we need to delete it before the
7280  // test ends.
7281  TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
7282  {
7283  TestEventListeners listeners;
7284  TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners, listener);
7285 
7286  EXPECT_EQ(listener, listeners.Release(listener));
7287  EXPECT_TRUE(listeners.default_xml_generator() == NULL);
7288  EXPECT_FALSE(is_destroyed);
7289 
7290  // Broadcasting events now should not affect default_xml_generator.
7291  TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
7292  *UnitTest::GetInstance());
7293  EXPECT_EQ(0, on_start_counter);
7294  }
7295  // Destroying the list should not affect the listener now, too.
7296  EXPECT_FALSE(is_destroyed);
7297  delete listener;
7298 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TestEventListener * Release(TestEventListener *listener)
Definition: gtest.cc:3909
TestEventListener * default_xml_generator() const
Definition: gtest.h:1095
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( IsAProtocolMessageTest  ,
ValueIsCompileTimeConstant   
)

Definition at line 7356 of file gtest_unittest.cc.

References GTEST_COMPILE_ASSERT_.

TEST ( IsAProtocolMessageTest  ,
ValueIsTrueWhenTypeIsAProtocolMessage   
)
TEST ( IsAProtocolMessageTest  ,
ValueIsFalseWhenTypeIsNotAProtocolMessage   
)
TEST ( CompileAssertTypesEqual  ,
CompilesWhenTypesAreEqual   
)
TEST ( RemoveReferenceTest  ,
DoesNotAffectNonReferenceType   
)
TEST ( RemoveReferenceTest  ,
MacroVersion   
)

Definition at line 7402 of file gtest_unittest.cc.

7402  {
7403  TestGTestRemoveReference<int, int>();
7404  TestGTestRemoveReference<const char, const char&>();
7405 }
TEST ( RemoveConstTest  ,
DoesNotAffectNonConstType   
)
TEST ( RemoveConstTest  ,
MacroVersion   
)

Definition at line 7428 of file gtest_unittest.cc.

7428  {
7429  TestGTestRemoveConst<int, int>();
7430  TestGTestRemoveConst<double&, double&>();
7431  TestGTestRemoveConst<char, const char>();
7432 }
TEST ( RemoveReferenceToConstTest  ,
Works   
)

Definition at line 7441 of file gtest_unittest.cc.

7441  {
7442  TestGTestRemoveReferenceAndConst<int, int>();
7443  TestGTestRemoveReferenceAndConst<double, double&>();
7444  TestGTestRemoveReferenceAndConst<char, const char>();
7445  TestGTestRemoveReferenceAndConst<char, const char&>();
7446  TestGTestRemoveReferenceAndConst<const char*, const char*>();
7447 }
TEST ( AddReferenceTest  ,
DoesNotAffectReferenceType   
)
TEST ( AddReferenceTest  ,
MacroVersion   
)

Definition at line 7468 of file gtest_unittest.cc.

7468  {
7469  TestGTestAddReference<int&, int>();
7470  TestGTestAddReference<const char&, const char&>();
7471 }
TEST ( GTestReferenceToConstTest  ,
Works   
)

Definition at line 7480 of file gtest_unittest.cc.

7480  {
7481  TestGTestReferenceToConst<const char&, char>();
7482  TestGTestReferenceToConst<const int&, const int>();
7483  TestGTestReferenceToConst<const double&, double>();
7484  TestGTestReferenceToConst<const std::string&, const std::string&>();
7485 }
TEST ( ImplicitlyConvertibleTest  ,
ValueIsCompileTimeConstant   
)

Definition at line 7488 of file gtest_unittest.cc.

References GTEST_COMPILE_ASSERT_.

TEST ( ImplicitlyConvertibleTest  ,
ValueIsFalseWhenNotConvertible   
)
TEST ( IsContainerTestTest  ,
WorksForNonContainer   
)

Definition at line 7521 of file gtest_unittest.cc.

References EXPECT_EQ, and testing::internal::IsContainerTest().

7521  {
7522  EXPECT_EQ(sizeof(IsNotContainer), sizeof(IsContainerTest<int>(0)));
7523  EXPECT_EQ(sizeof(IsNotContainer), sizeof(IsContainerTest<char[5]>(0)));
7524  EXPECT_EQ(sizeof(IsNotContainer), sizeof(IsContainerTest<NonContainer>(0)));
7525 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
IsContainer IsContainerTest(int, typename C::iterator *=NULL, typename C::const_iterator *=NULL)
TEST ( IsContainerTestTest  ,
WorksForContainer   
)

Definition at line 7527 of file gtest_unittest.cc.

References EXPECT_EQ, and testing::internal::IsContainerTest().

7527  {
7528  EXPECT_EQ(sizeof(IsContainer),
7529  sizeof(IsContainerTest<std::vector<bool> >(0)));
7530  EXPECT_EQ(sizeof(IsContainer),
7531  sizeof(IsContainerTest<std::map<int, double> >(0)));
7532 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
IsContainer IsContainerTest(int, typename C::iterator *=NULL, typename C::const_iterator *=NULL)
TEST ( ArrayEqTest  ,
WorksForDegeneratedArrays   
)

Definition at line 7536 of file gtest_unittest.cc.

References testing::internal::ArrayEq(), EXPECT_FALSE, and EXPECT_TRUE.

7536  {
7537  EXPECT_TRUE(ArrayEq(5, 5L));
7538  EXPECT_FALSE(ArrayEq('a', 0));
7539 }
bool ArrayEq(const T *lhs, size_t size, const U *rhs)
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( ArrayEqTest  ,
WorksForOneDimensionalArrays   
)

Definition at line 7541 of file gtest_unittest.cc.

References a, testing::internal::ArrayEq(), b, EXPECT_FALSE, and EXPECT_TRUE.

7541  {
7542  // Note that a and b are distinct but compatible types.
7543  const int a[] = { 0, 1 };
7544  long b[] = { 0, 1 };
7545  EXPECT_TRUE(ArrayEq(a, b));
7546  EXPECT_TRUE(ArrayEq(a, 2, b));
7547 
7548  b[0] = 2;
7549  EXPECT_FALSE(ArrayEq(a, b));
7550  EXPECT_FALSE(ArrayEq(a, 1, b));
7551 }
char b
bool ArrayEq(const T *lhs, size_t size, const U *rhs)
char a
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( ArrayEqTest  ,
WorksForTwoDimensionalArrays   
)

Definition at line 7553 of file gtest_unittest.cc.

References a, testing::internal::ArrayEq(), b, c, EXPECT_FALSE, and EXPECT_TRUE.

7553  {
7554  const char a[][3] = { "hi", "lo" };
7555  const char b[][3] = { "hi", "lo" };
7556  const char c[][3] = { "hi", "li" };
7557 
7558  EXPECT_TRUE(ArrayEq(a, b));
7559  EXPECT_TRUE(ArrayEq(a, 2, b));
7560 
7561  EXPECT_FALSE(ArrayEq(a, c));
7562  EXPECT_FALSE(ArrayEq(a, 2, c));
7563 }
char b
bool ArrayEq(const T *lhs, size_t size, const U *rhs)
char a
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
char c
TEST ( ArrayAwareFindTest  ,
WorksForOneDimensionalArray   
)

Definition at line 7567 of file gtest_unittest.cc.

References a, testing::internal::ArrayAwareFind(), and EXPECT_EQ.

7567  {
7568  const char a[] = "hello";
7569  EXPECT_EQ(a + 4, ArrayAwareFind(a, a + 5, 'o'));
7570  EXPECT_EQ(a + 5, ArrayAwareFind(a, a + 5, 'x'));
7571 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
char a
Iter ArrayAwareFind(Iter begin, Iter end, const Element &elem)
TEST ( ArrayAwareFindTest  ,
WorksForTwoDimensionalArray   
)

Definition at line 7573 of file gtest_unittest.cc.

References a, testing::internal::ArrayAwareFind(), b, c, and EXPECT_EQ.

7573  {
7574  int a[][2] = { { 0, 1 }, { 2, 3 }, { 4, 5 } };
7575  const int b[2] = { 2, 3 };
7576  EXPECT_EQ(a + 1, ArrayAwareFind(a, a + 3, b));
7577 
7578  const int c[2] = { 6, 7 };
7579  EXPECT_EQ(a + 3, ArrayAwareFind(a, a + 3, c));
7580 }
char b
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
char a
Iter ArrayAwareFind(Iter begin, Iter end, const Element &elem)
char c
TEST ( CopyArrayTest  ,
WorksForDegeneratedArrays   
)

Definition at line 7584 of file gtest_unittest.cc.

References testing::internal::CopyArray(), and EXPECT_EQ.

7584  {
7585  int n = 0;
7586  CopyArray('a', &n);
7587  EXPECT_EQ('a', n);
7588 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
void CopyArray(const T *from, size_t size, U *to)
TEST ( CopyArrayTest  ,
WorksForOneDimensionalArrays   
)

Definition at line 7590 of file gtest_unittest.cc.

References a, testing::internal::ArrayEq(), b, c, testing::internal::CopyArray(), and EXPECT_TRUE.

7590  {
7591  const char a[3] = "hi";
7592  int b[3];
7593 #ifndef __BORLANDC__ // C++Builder cannot compile some array size deductions.
7594  CopyArray(a, &b);
7595  EXPECT_TRUE(ArrayEq(a, b));
7596 #endif
7597 
7598  int c[3];
7599  CopyArray(a, 3, c);
7600  EXPECT_TRUE(ArrayEq(a, c));
7601 }
char b
bool ArrayEq(const T *lhs, size_t size, const U *rhs)
char a
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
void CopyArray(const T *from, size_t size, U *to)
char c
TEST ( CopyArrayTest  ,
WorksForTwoDimensionalArrays   
)

Definition at line 7603 of file gtest_unittest.cc.

References a, testing::internal::ArrayEq(), b, c, testing::internal::CopyArray(), and EXPECT_TRUE.

7603  {
7604  const int a[2][3] = { { 0, 1, 2 }, { 3, 4, 5 } };
7605  int b[2][3];
7606 #ifndef __BORLANDC__ // C++Builder cannot compile some array size deductions.
7607  CopyArray(a, &b);
7608  EXPECT_TRUE(ArrayEq(a, b));
7609 #endif
7610 
7611  int c[2][3];
7612  CopyArray(a, 2, c);
7613  EXPECT_TRUE(ArrayEq(a, c));
7614 }
char b
bool ArrayEq(const T *lhs, size_t size, const U *rhs)
char a
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
void CopyArray(const T *from, size_t size, U *to)
char c
TEST ( NativeArrayTest  ,
ConstructorFromArrayWorks   
)

Definition at line 7618 of file gtest_unittest.cc.

References a, testing::internal::NativeArray< Element >::begin(), EXPECT_EQ, and testing::internal::NativeArray< Element >::size().

7618  {
7619  const int a[3] = { 0, 1, 2 };
7621  EXPECT_EQ(3U, na.size());
7622  EXPECT_EQ(a, na.begin());
7623 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
char a
TEST ( NativeArrayTest  ,
CreatesAndDeletesCopyOfArrayWhenAskedTo   
)

Definition at line 7625 of file gtest_unittest.cc.

References a, testing::internal::NativeArray< Element >::begin(), EXPECT_EQ, and EXPECT_NE.

7625  {
7626  typedef int Array[2];
7627  Array* a = new Array[1];
7628  (*a)[0] = 0;
7629  (*a)[1] = 1;
7631  EXPECT_NE(*a, na.begin());
7632  delete[] a;
7633  EXPECT_EQ(0, na.begin()[0]);
7634  EXPECT_EQ(1, na.begin()[1]);
7635 
7636  // We rely on the heap checker to verify that na deletes the copy of
7637  // array.
7638 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
char a
#define EXPECT_NE(val1, val2)
Definition: gtest.h:1926
TEST ( NativeArrayTest  ,
TypeMembersAreCorrect   
)

Definition at line 7640 of file gtest_unittest.cc.

7640  {
7641  StaticAssertTypeEq<char, NativeArray<char>::value_type>();
7642  StaticAssertTypeEq<int[2], NativeArray<int[2]>::value_type>();
7643 
7644  StaticAssertTypeEq<const char*, NativeArray<char>::const_iterator>();
7645  StaticAssertTypeEq<const bool(*)[2], NativeArray<bool[2]>::const_iterator>();
7646 }
TEST ( NativeArrayTest  ,
MethodsWork   
)

Definition at line 7648 of file gtest_unittest.cc.

References a, ASSERT_EQ, testing::internal::NativeArray< Element >::begin(), testing::internal::NativeArray< Element >::end(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, and testing::internal::NativeArray< Element >::size().

7648  {
7649  const int a[3] = { 0, 1, 2 };
7651  ASSERT_EQ(3U, na.size());
7652  EXPECT_EQ(3, na.end() - na.begin());
7653 
7655  EXPECT_EQ(0, *it);
7656  ++it;
7657  EXPECT_EQ(1, *it);
7658  it++;
7659  EXPECT_EQ(2, *it);
7660  ++it;
7661  EXPECT_EQ(na.end(), it);
7662 
7663  EXPECT_TRUE(na == na);
7664 
7666  EXPECT_TRUE(na == na2);
7667 
7668  const int b1[3] = { 0, 1, 1 };
7669  const int b2[4] = { 0, 1, 2, 3 };
7672 }
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
const_iterator begin() const
char a
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
TEST ( NativeArrayTest  ,
WorksForTwoDimensionalArray   
)

Definition at line 7674 of file gtest_unittest.cc.

References a, ASSERT_EQ, testing::internal::NativeArray< Element >::begin(), EXPECT_EQ, and testing::internal::NativeArray< Element >::size().

7674  {
7675  const char a[2][3] = { "hi", "lo" };
7677  ASSERT_EQ(2U, na.size());
7678  EXPECT_EQ(a, na.begin());
7679 }
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
char a
TEST ( SkipPrefixTest  ,
SkipsWhenPrefixMatches   
)

Definition at line 7683 of file gtest_unittest.cc.

References EXPECT_EQ, EXPECT_TRUE, and testing::internal::SkipPrefix().

7683  {
7684  const char* const str = "hello";
7685 
7686  const char* p = str;
7687  EXPECT_TRUE(SkipPrefix("", &p));
7688  EXPECT_EQ(str, p);
7689 
7690  p = str;
7691  EXPECT_TRUE(SkipPrefix("hell", &p));
7692  EXPECT_EQ(str + 4, p);
7693 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
GTEST_API_ bool SkipPrefix(const char *prefix, const char **pstr)
Definition: gtest.cc:5001
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
TEST ( SkipPrefixTest  ,
DoesNotSkipWhenPrefixDoesNotMatch   
)

Definition at line 7695 of file gtest_unittest.cc.

References EXPECT_EQ, EXPECT_FALSE, and testing::internal::SkipPrefix().

7695  {
7696  const char* const str = "world";
7697 
7698  const char* p = str;
7699  EXPECT_FALSE(SkipPrefix("W", &p));
7700  EXPECT_EQ(str, p);
7701 
7702  p = str;
7703  EXPECT_FALSE(SkipPrefix("world!", &p));
7704  EXPECT_EQ(str, p);
7705 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
GTEST_API_ bool SkipPrefix(const char *prefix, const char **pstr)
Definition: gtest.cc:5001
#define EXPECT_FALSE(condition)
Definition: gtest.h:1862
template<typename T1 , typename T2 >
void TestGTestAddReference ( )
template<typename T1 , typename T2 >
void TestGTestReferenceToConst ( )
template<typename T1 , typename T2 >
void TestGTestRemoveConst ( )
template<typename T1 , typename T2 >
void TestGTestRemoveReference ( )
template<typename T1 , typename T2 >
void TestGTestRemoveReferenceAndConst ( )

Variable Documentation

bool dummy2 GTEST_ATTRIBUTE_UNUSED_ = StaticAssertTypeEq<bool, bool>()
static

Definition at line 6866 of file gtest_unittest.cc.