Lines Matching defs:Test
32 // Tests for Google Test itself. This verifies that the basic constructs of
33 // Google Test work.
40 TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
70 // Indicates that this translation unit is part of Google Test's
83 // that are needed to test it.
138 using testing::Test;
226 TEST(GetRandomSeedFromFlagTest, HandlesZero) {
232 TEST(GetRandomSeedFromFlagTest, PreservesValidSeed) {
240 TEST(GetRandomSeedFromFlagTest, NormalizesInvalidSeed) {
250 TEST(GetNextRandomSeedTest, WorksForValidInput) {
257 // We deliberately don't test GetNextRandomSeed() with invalid
270 TEST(GetTypeIdTest, ReturnsSameValueForSameType) {
272 EXPECT_EQ(GetTypeId<Test>(), GetTypeId<Test>());
275 class SubClassOfTest : public Test {};
276 class AnotherSubClassOfTest : public Test {};
278 TEST(GetTypeIdTest, ReturnsDifferentValuesForDifferentTypes) {
288 // is called from inside Google Test or outside of it.
289 TEST(GetTestTypeIdTest, ReturnsTheSameValueInsideOrOutsideOfGoogleTest) {
295 TEST(FormatTimeInMillisAsSecondsTest, FormatsZero) {
299 TEST(FormatTimeInMillisAsSecondsTest, FormatsPositiveNumber) {
307 TEST(FormatTimeInMillisAsSecondsTest, FormatsNegativeNumber) {
321 class FormatEpochTimeInMillisAsIso8601Test : public Test {
421 TEST(NullLiteralTest, IsTrueForNullLiterals) {
439 TEST(NullLiteralTest, IsFalseForNonNullLiterals) {
456 TEST(CodePointToUtf8Test, CanEncodeNul) {
462 TEST(CodePointToUtf8Test, CanEncodeAscii) {
472 TEST(CodePointToUtf8Test, CanEncode8To11Bits) {
487 TEST(CodePointToUtf8Test, CanEncode12To16Bits) {
505 TEST(CodePointToUtf8Test, CanEncode17To21Bits) {
518 TEST(CodePointToUtf8Test, CanEncodeInvalidCodePoint) {
529 TEST(WideStringToUtf8Test, CanEncodeNul) {
535 TEST(WideStringToUtf8Test, CanEncodeAscii) {
544 TEST(WideStringToUtf8Test, CanEncode8To11Bits) {
557 TEST(WideStringToUtf8Test, CanEncode12To16Bits) {
570 TEST(WideStringToUtf8Test, StopsOnNulCharacter) {
576 TEST(WideStringToUtf8Test, StopsWhenLengthLimitReached) {
584 TEST(WideStringToUtf8Test, CanEncode17To21Bits) {
595 TEST(WideStringToUtf8Test, CanEncodeInvalidCodePoint) {
602 TEST(WideStringToUtf8Test, CanEncodeValidUtf16SUrrogatePairs) {
609 TEST(WideStringToUtf8Test, CanEncodeInvalidUtf16SurrogatePair) {
624 TEST(WideStringToUtf8Test, ConcatenatesCodepointsCorrectly) {
636 TEST(WideStringToUtf8Test, ConcatenatesCodepointsCorrectly) {
646 TEST(RandomDeathTest, GeneratesCrashesOnInvalidRange) {
657 TEST(RandomTest, GeneratesNumbersWithinRange) {
670 TEST(RandomTest, RepeatsWhenReseeded) {
693 TEST(ContainerUtilityTest, CountIf) {
712 TEST(ContainerUtilityTest, ForEach) {
731 TEST(ContainerUtilityTest, GetElementOr) {
743 TEST(ContainerUtilityDeathTest, ShuffleRange) {
764 class VectorShuffleTest : public Test {
928 TEST(AssertHelperTest, AssertHelperIsSmall) {
937 TEST(StringTest, Constructors) {
987 TEST(StringTest, ConvertsFromStdString) {
1009 TEST(StringTest, ConvertsToStdString) {
1028 TEST(StringTest, ConvertsFromGlobalString) {
1050 TEST(StringTest, ConvertsToGlobalString) {
1069 TEST(StringTest, ShowCStringQuoted) {
1079 TEST(StringTest, Empty) {
1088 TEST(StringTest, Compare) {
1126 TEST(StringTest, Equals) {
1148 TEST(StringTest, NotEquals) {
1170 TEST(StringTest, Length) {
1178 TEST(StringTest, EndsWith) {
1188 TEST(StringTest, EndsWithCaseInsensitive) {
1205 TEST(StringTest, CaseInsensitiveWideCStringEquals) {
1217 TEST(StringTest, CanBeAssignedNULL) {
1226 TEST(StringTest, CanBeAssignedEmpty) {
1235 TEST(StringTest, CanBeAssignedNonEmpty) {
1252 TEST(StringTest, CanBeAssignedSelf) {
1264 TEST(StringTest, Streams) {
1272 TEST(StringTest, FormatWorks) {
1301 TEST(StringTest, ShowWideCString) {
1309 TEST(StringTest, ShowWideCStringQuoted) {
1319 TEST(StringTest, AnsiAndUtf16Null) {
1324 TEST(StringTest, AnsiAndUtf16ConvertBasic) {
1333 TEST(StringTest, AnsiAndUtf16ConvertPathChars) {
1346 TEST(TestPropertyTest, StringValue) {
1353 TEST(TestPropertyTest, ReplaceStringValue) {
1371 class ScopedFakeTestPartResultReporterTest : public Test {
1386 // Tests that ScopedFakeTestPartResultReporter intercepts test
1467 // We have another test below to verify that the macro catches fatal
1556 // We have another test below to verify that the macro catches
1596 TEST(TestPropertyTest, ConstructorWorks) {
1602 TEST(TestPropertyTest, SetValue) {
1612 // The test fixture for testing TestResult.
1613 class TestResultTest : public Test {
1641 // In order to test TestResult, we need to modify its internal
1718 TEST(TestResultPropertyTest, NoPropertiesFoundWhenNoneAreAdded) {
1724 TEST(TestResultPropertyTest, OnePropertyFoundWhenAdded) {
1735 TEST(TestResultPropertyTest, MultiplePropertiesFoundWhenAdded) {
1752 TEST(TestResultPropertyTest, OverridesValuesForDuplicateKeys) {
1774 TEST(TestResultPropertyDeathTest, GetTestProperty) {
1814 TEST(TestResultPropertyTest, AddFailureWhenUsingReservedKeyCalledName) {
1820 TEST(TestResultPropertyTest, AddFailureWhenUsingReservedKeyCalledStatus) {
1826 TEST(TestResultPropertyTest, AddFailureWhenUsingReservedKeyCalledTime) {
1832 TEST(TestResultPropertyTest, AddFailureWhenUsingReservedKeyCalledClassname) {
1838 class GTestFlagSaverTest : public Test {
1840 // Saves the Google Test flags such that we can restore them later, and
1842 // before the first test in this test case is run.
1863 // Restores the Google Test flags that the tests have modified. This will
1864 // be called after the last test in this test case is run.
1870 // Verifies that the Google Test flags have their default values, and then
1907 // For saving Google Test flags during this test case.
1913 // Google Test doesn't guarantee the order of tests. The following two
1916 // Modifies the Google Test flags in the test body.
1921 // Verifies that the Google Test flags in the body of the previous test were
1973 TEST(Int32FromGTestEnvTest, ReturnsDefaultWhenVariableIsNotSet) {
1980 TEST(Int32FromGTestEnvTest, ReturnsDefaultWhenValueOverflows) {
1992 TEST(Int32FromGTestEnvTest, ReturnsDefaultWhenValueIsInvalid) {
2005 TEST(Int32FromGTestEnvTest, ParsesAndReturnsValidValue) {
2018 TEST(ParseInt32FlagTest, ReturnsFalseForInvalidFlag) {
2029 TEST(ParseInt32FlagTest, ReturnsDefaultWhenValueOverflows) {
2043 TEST(ParseInt32FlagTest, ReturnsDefaultWhenValueIsInvalid) {
2057 TEST(ParseInt32FlagTest, ParsesAndReturnsValidValue) {
2071 TEST(Int32FromEnvOrDieTest, ParsesAndReturnsValidValue) {
2082 TEST(Int32FromEnvOrDieDeathTest, AbortsOnFailure) {
2091 TEST(Int32FromEnvOrDieDeathTest, AbortsOnInt32Overflow) {
2100 TEST(ShouldRunTestOnShardTest, IsPartitionWhenThereIsOneShard) {
2108 class ShouldShardTest : public testing::Test {
2143 // we are not in a death test subprocess.
2188 TEST(ShouldRunTestOnShardTest, IsPartitionWhenThereAreFiveShards) {
2193 // Check partitioning: each test should be on exactly 1 shard.
2202 << shard_index << " are both selected to run test " << test_id;
2221 // Test class, there are no separate tests for the following classes
2228 // TEST, TEST_F, RUN_ALL_TESTS
2230 TEST(UnitTestTest, CanGetOriginalWorkingDir) {
2235 TEST(UnitTestTest, ReturnsPlausibleTimestamp) {
2351 TEST(Pred1Test, WithoutFormat) {
2365 TEST(Pred1Test, WithFormat) {
2382 TEST(Pred1Test, SingleEvaluationOnFailure) {
2400 TEST(PredTest, WithoutFormat) {
2417 TEST(PredTest, WithFormat) {
2439 TEST(PredTest, SingleEvaluationOnFailure) {
2502 TEST(PredicateAssertionTest, AcceptsOverloadedFunction) {
2510 TEST(PredicateAssertionTest, AcceptsTemplateFunction) {
2546 TEST(PredicateFormatAssertionTest, AcceptsOverloadedFunction) {
2553 TEST(PredicateFormatAssertionTest, AcceptsTemplateFunction) {
2562 TEST(StringAssertionTest, ASSERT_STREQ) {
2575 TEST(StringAssertionTest, ASSERT_STREQ_Null) {
2582 TEST(StringAssertionTest, ASSERT_STREQ_Null2) {
2588 TEST(StringAssertionTest, ASSERT_STRNE) {
2601 TEST(StringAssertionTest, ASSERT_STRCASEEQ) {
2611 TEST(StringAssertionTest, ASSERT_STRCASENE) {
2624 TEST(StringAssertionTest, STREQ_Wide) {
2653 TEST(StringAssertionTest, STRNE_Wide) {
2685 TEST(IsSubstringTest, ReturnsCorrectResultForCString) {
2696 TEST(IsSubstringTest, ReturnsCorrectResultForWideCString) {
2707 TEST(IsSubstringTest, GeneratesCorrectMessageForCString) {
2718 TEST(IsSubstringTest, ReturnsCorrectResultsForStdString) {
2726 TEST(IsSubstringTest, ReturnsCorrectResultForStdWstring) {
2733 TEST(IsSubstringTest, GeneratesCorrectMessageForWstring) {
2749 TEST(IsNotSubstringTest, ReturnsCorrectResultForCString) {
2756 TEST(IsNotSubstringTest, ReturnsCorrectResultForWideCString) {
2763 TEST(IsNotSubstringTest, GeneratesCorrectMessageForWideCString) {
2775 TEST(IsNotSubstringTest, ReturnsCorrectResultsForStdString) {
2782 TEST(IsNotSubstringTest, GeneratesCorrectMessageForStdString) {
2796 TEST(IsNotSubstringTest, ReturnsCorrectResultForStdWstring) {
2807 class FloatingPointTest : public Test {
3229 // Verifies that a test or test case whose name starts with DISABLED_ is
3232 // A test whose name starts with DISABLED_.
3234 TEST(DisabledTest, DISABLED_TestShouldNotRun) {
3235 FAIL() << "Unexpected failure: Disabled test should not be run.";
3238 // A test whose name does not start with DISABLED_.
3240 TEST(DisabledTest, NotDISABLED_TestShouldRun) {
3244 // A test case whose name starts with DISABLED_.
3246 TEST(DISABLED_TestCase, TestShouldNotRun) {
3247 FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
3250 // A test case and test whose names start with DISABLED_.
3252 TEST(DISABLED_TestCase, DISABLED_TestShouldNotRun) {
3253 FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
3256 // Check that when all tests in a test case are disabled, SetupTestCase() and
3258 class DisabledTestsTest : public Test {
3261 FAIL() << "Unexpected failure: All tests disabled in test case. "
3266 FAIL() << "Unexpected failure: All tests disabled in test case. "
3272 FAIL() << "Unexpected failure: Disabled test should not be run.";
3276 FAIL() << "Unexpected failure: Disabled test should not be run.";
3284 class TypedTest : public Test {
3291 FAIL() << "Unexpected failure: Disabled typed test should not run.";
3295 class DISABLED_TypedTest : public Test {
3301 FAIL() << "Unexpected failure: Disabled typed test should not run.";
3311 class TypedTestP : public Test {
3318 << "Disabled type-parameterized test should not run.";
3326 class DISABLED_TypedTestP : public Test {
3333 << "Disabled type-parameterized test should not run.";
3344 class SingleEvaluationTest : public Test {
3346 // This helper function is needed by the FailedASSERT_STREQ test
3353 // This helper function is needed by the FailedASSERT_NE test below. It's
3497 class NoFatalFailureTest : public Test {
3590 TEST(AssertionTest, EqFailure) {
3640 TEST(AssertionTest, AppendUserMessage) {
3658 TEST(AssertionTest, ASSERT_TRUE) {
3665 TEST(AssertionTest, AssertTrueWithAssertionResult) {
3682 TEST(AssertionTest, ASSERT_FALSE) {
3691 TEST(AssertionTest, AssertFalseWithAssertionResult) {
3715 TEST(ExpectTest, ASSERT_EQ_Double) {
3725 TEST(AssertionTest, ASSERT_EQ) {
3735 TEST(AssertionTest, ASSERT_EQ_NULL) {
3740 // static_cast since the test verifies the ability to use bare NULL as the
3753 // that ASSERT_EQ(0, non_pointer) isn't interpreted by Google Test as
3755 TEST(ExpectTest, ASSERT_EQ_0) {
3767 TEST(AssertionTest, ASSERT_NE) {
3775 TEST(AssertionTest, ASSERT_LE) {
3783 TEST(AssertionTest, ASSERT_LT) {
3790 TEST(AssertionTest, ASSERT_GE) {
3798 TEST(AssertionTest, ASSERT_GT) {
3809 TEST(AssertionTest, ASSERT_THROW) {
3828 TEST(AssertionTest, ASSERT_NO_THROW) {
3836 TEST(AssertionTest, ASSERT_ANY_THROW) {
3846 // Makes sure we deal with the precedence of <<. This test should
3848 TEST(AssertionTest, AssertPrecedence) {
3854 // A subroutine used by the following test.
3859 // Tests calling a test subroutine that's not part of a fixture.
3860 TEST(AssertionTest, NonFixtureSubroutine) {
3891 // A subroutine used by the following test.
3896 // A subroutine used by the following test.
3904 TEST(AssertionTest, AssertWorksWithUncopyableObject) {
3915 TEST(AssertionTest, ExpectWorksWithUncopyableObject) {
3931 TEST(AssertionTest, NamedEnum) {
3939 // anonymous enums in assertions. Therefore the following test is not
3950 // We want to test the case where the size of the anonymous enum is
3957 // int size. We want to test whether this will confuse the
3970 TEST(AssertionTest, AnonymousEnum) {
4024 // HRESULT assertion tests test both zero and non-zero
4028 TEST(HRESULTAssertionTest, EXPECT_HRESULT_SUCCEEDED) {
4037 TEST(HRESULTAssertionTest, ASSERT_HRESULT_SUCCEEDED) {
4046 TEST(HRESULTAssertionTest, EXPECT_HRESULT_FAILED) {
4057 TEST(HRESULTAssertionTest, ASSERT_HRESULT_FAILED) {
4074 TEST(HRESULTAssertionTest, Streaming) {
4109 TEST(AssertionSyntaxTest, BasicAssertionsBehavesLikeSingleStatement) {
4112 "It's a compilation test only.";
4131 TEST(ExpectThrowTest, DoesNotGenerateUnreachableCodeWarning) {
4143 TEST(AssertionSyntaxTest, ExceptionAssertionsBehavesLikeSingleStatement) {
4170 TEST(AssertionSyntaxTest, NoFatalFailureAssertionsBehavesLikeSingleStatement) {
4173 << "It's a compilation test only.";
4194 TEST(AssertionSyntaxTest, WorksWithSwitch) {
4207 // than the Boolean assertions. Hence we test them separately.
4225 // Test that the exception assertion macros compile and work with const
4227 TEST(AssertionSyntaxTest, WorksWithConst) {
4239 // Tests that Google Test tracks SUCCEED*.
4240 TEST(SuccessfulAssertionTest, SUCCEED) {
4246 // Tests that Google Test doesn't track successful EXPECT_*.
4247 TEST(SuccessfulAssertionTest, EXPECT) {
4252 // Tests that Google Test doesn't track successful EXPECT_STR*.
4253 TEST(SuccessfulAssertionTest, EXPECT_STR) {
4258 // Tests that Google Test doesn't track successful ASSERT_*.
4259 TEST(SuccessfulAssertionTest, ASSERT) {
4264 // Tests that Google Test doesn't track successful ASSERT_STR*.
4265 TEST(SuccessfulAssertionTest, ASSERT_STR) {
4276 TEST(AssertionWithMessageTest, EXPECT) {
4300 TEST(AssertionWithMessageTest, ASSERT) {
4310 TEST(AssertionWithMessageTest, ASSERT_STR) {
4318 TEST(AssertionWithMessageTest, ASSERT_FLOATING) {
4328 TEST(AssertionWithMessageTest, ASSERT_FALSE) {
4337 TEST(AssertionWithMessageTest, FAIL) {
4343 TEST(AssertionWithMessageTest, SUCCEED) {
4348 TEST(AssertionWithMessageTest, ASSERT_TRUE) {
4359 TEST(AssertionWithMessageTest, WideStringMessage) {
4371 TEST(ExpectTest, EXPECT_TRUE) {
4387 TEST(ExpectTest, ExpectTrueWithAssertionResult) {
4401 TEST(ExpectTest, EXPECT_FALSE) {
4417 TEST(ExpectTest, ExpectFalseWithAssertionResult) {
4436 TEST(ExpectTest, EXPECT_EQ) {
4449 TEST(ExpectTest, EXPECT_EQ_Double) {
4460 TEST(ExpectTest, EXPECT_EQ_NULL) {
4465 // static_cast since the test verifies the ability to use bare NULL as the
4478 // that EXPECT_EQ(0, non_pointer) isn't interpreted by Google Test as
4480 TEST(ExpectTest, EXPECT_EQ_0) {
4492 TEST(ExpectTest, EXPECT_NE) {
4514 TEST(ExpectTest, EXPECT_LE) {
4524 TEST(ExpectTest, EXPECT_LT) {
4533 TEST(ExpectTest, EXPECT_GE) {
4543 TEST(ExpectTest, EXPECT_GT) {
4554 TEST(ExpectTest, EXPECT_THROW) {
4566 TEST(ExpectTest, EXPECT_NO_THROW) {
4574 TEST(ExpectTest, EXPECT_ANY_THROW) {
4585 TEST(ExpectTest, ExpectPrecedence) {
4595 TEST(StreamableToStringTest, Scalar) {
4600 TEST(StreamableToStringTest, Pointer) {
4607 TEST(StreamableToStringTest, NullPointer) {
4613 TEST(StreamableToStringTest, CString) {
4618 TEST(StreamableToStringTest, NullCString) {
4626 TEST(StreamableTest, string) {
4635 TEST(StreamableTest, stringWithEmbeddedNUL) {
4646 TEST(StreamableTest, NULChar) {
4653 TEST(StreamableTest, int) {
4660 // In MSVC, streaming a NULL char * causes access violation. Google Test
4663 TEST(StreamableTest, NullCharPtr) {
4670 TEST(StreamableTest, BasicIoManip) {
4686 TEST(MacroTest, ADD_FAILURE) {
4694 TEST(MacroTest, ADD_FAILURE_AT) {
4709 TEST(MacroTest, FAIL) {
4717 TEST(MacroTest, SUCCEED) {
4730 TEST(EqAssertionTest, Bool) {
4739 TEST(EqAssertionTest, Int) {
4746 TEST(EqAssertionTest, Time_T) {
4755 TEST(EqAssertionTest, Char) {
4765 TEST(EqAssertionTest, WideChar) {
4784 TEST(EqAssertionTest, StdString) {
4787 ASSERT_EQ("Test", ::std::string("Test"));
4796 EXPECT_NONFATAL_FAILURE(EXPECT_EQ("Test", ::std::string("test")),
4797 "::std::string(\"test\")");
4816 TEST(EqAssertionTest, StdWideString) {
4852 TEST(EqAssertionTest, GlobalString) {
4854 EXPECT_EQ("Test", ::string("Test"));
4862 EXPECT_NONFATAL_FAILURE(EXPECT_EQ(::string("Test"), "test"),
4863 "test");
4883 TEST(EqAssertionTest, GlobalWideString) {
4898 }, "Test\\x8119");
4917 TEST(EqAssertionTest, CharPointer) {
4939 TEST(EqAssertionTest, WideCharPointer) {
4964 TEST(EqAssertionTest, OtherPointer) {
5002 TEST(ComparisonAssertionTest, AcceptsUnprintableArgs) {
5036 // This class has a private member we want to test. We will test it
5037 // both in a TEST and in a TEST_F.
5047 FRIEND_TEST(FRIEND_TEST_Test, TEST);
5051 // Tests that the FRIEND_TEST declaration allows a TEST to access a
5053 TEST(FRIEND_TEST_Test, TEST) {
5057 // The fixture needed to test using FRIEND_TEST with TEST_F.
5058 class FRIEND_TEST_Test2 : public Test {
5069 // Tests the life cycle of Test objects.
5071 // The test fixture for testing the life cycle of Test objects.
5073 // This class counts the number of live test objects that uses this
5075 class TestLifeCycleTest : public Test {
5077 // Constructor. Increments the number of test objects that uses
5081 // Destructor. Decrements the number of test objects that uses this
5085 // Returns the number of live test objects that uses this fixture.
5094 // Tests the life cycle of test objects.
5096 // There should be only one test object in this test case that's
5101 // Tests the life cycle of test objects.
5104 // only one live test object, as the object for Test1 should've been
5113 TEST(AssertionResultTest, CopyConstructorWorksWhenNotOptimied) {
5129 TEST(AssertionResultTest, ConstructionWorks) {
5152 TEST(AssertionResultTest, NegationWorks) {
5162 TEST(AssertionResultTest, StreamingWorks) {
5168 TEST(AssertionResultTest, CanStreamOstreamManipulators) {
5192 TEST(MessageTest, CanStreamUserTypeInGlobalNameSpace) {
5217 TEST(MessageTest, CanStreamUserTypeInUnnamedNameSpace) {
5242 TEST(MessageTest, CanStreamUserTypeInUserNameSpace) {
5267 TEST(MessageTest, CanStreamUserTypeInUserNameSpaceWithStreamOperatorInGlobal) {
5276 TEST(MessageTest, NullPointers) {
5291 TEST(MessageTest, WideStrings) {
5319 class TestInfoTest : public Test {
5351 // Initially, there is no TestPartResult for this test.
5358 // Tests setting up and tearing down a test case.
5360 class SetUpTestCaseTest : public Test {
5362 // This will be called once before the first test in this test case
5365 printf("Setting up the test case . . .\n");
5372 // Increments the number of test cases that have been set up.
5379 // This will be called once after the last test in this test case is
5382 printf("Tearing down the test case . . .\n");
5384 // Decrements the number of test cases that have been set up.
5394 // This will be called before each test in this test case.
5401 // Number of test cases that have been set up.
5404 // Some resource to be shared by all tests in this test case.
5411 // A test that uses the shared resource.
5416 // Another test that uses the shared resource.
5421 // The InitGoogleTestTest test case tests testing::InitGoogleTest().
5423 // The Flags struct stores a copy of all Google Test flags.
5573 class InitGoogleTestTest : public Test {
5575 // Clears the flags before each test.
5892 "bar", // Unrecognized by Google Test.
6376 class CurrentTestInfoTest : public Test {
6378 // Tests that current_test_info() returns NULL before the first test in
6379 // the test case is run.
6388 // Tests that current_test_info() returns NULL after the last test in
6389 // the test case has run.
6399 // test by checking the expected test name against the actual one.
6404 << "There is a test running so we should have a valid TestInfo.";
6406 << "Expected the name of the currently running test case.";
6408 << "Expected the name of the currently running test.";
6412 // test by checking the expected test name against the actual one. We
6413 // use this test to see that the TestInfo object actually changed from
6419 << "There is a test running so we should have a valid TestInfo.";
6421 << "Expected the name of the currently running test case.";
6423 << "Expected the name of the currently running test.";
6428 // These two lines test that we can define tests in a namespace that
6433 // Makes sure that TEST knows to use ::testing::Test instead of
6434 // ::my_namespace::testing::Test.
6435 class Test {};
6447 TEST(NestedTestingNamespaceTest, Success) {
6452 TEST(NestedTestingNamespaceTest, Failure) {
6462 // No tests are based on this fixture; the test "passes" if it compiles
6464 class ProtectedFixtureMethodsTest : public Test {
6467 Test::SetUp();
6470 Test::TearDown();
6476 TEST(StreamingAssertionsTest, Unconditional) {
6489 TEST(StreamingAssertionsTest, Truth) {
6498 TEST(StreamingAssertionsTest, Truth2) {
6512 TEST(StreamingAssertionsTest, IntegerEquals) {
6521 TEST(StreamingAssertionsTest, IntegerLessThan) {
6530 TEST(StreamingAssertionsTest, StringsEqual) {
6539 TEST(StreamingAssertionsTest, StringsNotEqual) {
6548 TEST(StreamingAssertionsTest, StringsEqualIgnoringCase) {
6557 TEST(StreamingAssertionsTest, StringNotEqualIgnoringCase) {
6566 TEST(StreamingAssertionsTest, FloatingPointEquals) {
6577 TEST(StreamingAssertionsTest, Throw) {
6586 TEST(StreamingAssertionsTest, NoThrow) {
6595 TEST(StreamingAssertionsTest, AnyThrow) {
6606 // Tests that Google Test correctly decides whether to use colors in the output.
6608 TEST(ColoredOutputTest, UsesColorsWhenGTestColorFlagIsYes) {
6620 TEST(ColoredOutputTest, UsesColorsWhenGTestColorFlagIsAliasOfYes) {
6633 TEST(ColoredOutputTest, UsesNoColorWhenGTestColorFlagIsNo) {
6645 TEST(ColoredOutputTest, UsesNoColorWhenGTestColorFlagIsInvalid) {
6658 TEST(ColoredOutputTest, UsesColorsWhenStdoutIsTty) {
6666 TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
6730 TEST(StaticAssertTypeEqTest, WorksInClass) {
6738 TEST(StaticAssertTypeEqTest, CompilesForEqualTypes) {
6743 TEST(GetCurrentOsStackTraceExceptTopTest, ReturnsTheStackTrace) {
6746 // We don't have a stack walker in Google Test yet.
6751 TEST(HasNonfatalFailureTest, ReturnsFalseWhenThereIsNoFailure) {
6757 TEST(HasNonfatalFailureTest, ReturnsFalseWhenThereIsOnlyFatalFailure) {
6764 TEST(HasNonfatalFailureTest, ReturnsTrueWhenThereIsNonfatalFailure) {
6771 TEST(HasNonfatalFailureTest, ReturnsTrueWhenThereAreFatalAndNonfatalFailures) {
6779 // A wrapper for calling HasNonfatalFailure outside of a test body.
6781 return testing::Test::HasNonfatalFailure();
6784 TEST(HasNonfatalFailureTest, WorksOutsideOfTestBody) {
6788 TEST(HasNonfatalFailureTest, WorksOutsideOfTestBody2) {
6795 TEST(HasFailureTest, ReturnsFalseWhenThereIsNoFailure) {
6799 TEST(HasFailureTest, ReturnsTrueWhenThereIsFatalFailure) {
6806 TEST(HasFailureTest, ReturnsTrueWhenThereIsNonfatalFailure) {
6813 TEST(HasFailureTest, ReturnsTrueWhenThereAreFatalAndNonfatalFailures) {
6821 // A wrapper for calling HasFailure outside of a test body.
6822 static bool HasFailureHelper() { return testing::Test::HasFailure(); }
6824 TEST(HasFailureTest, WorksOutsideOfTestBody) {
6828 TEST(HasFailureTest, WorksOutsideOfTestBody2) {
6859 TEST(TestEventListenersTest, ConstructionWorks) {
6869 TEST(TestEventListenersTest, DestructionWorks) {
6895 TEST(TestEventListenersTest, Append) {
6949 TEST(EventListenerTest, AppendKeepsOrder) {
6990 TEST(TestEventListenersTest, Release) {
6995 // test ends.
7011 TEST(EventListenerTest, SuppressEventForwarding) {
7025 // Tests that events generated by Google Test are not forwarded in
7026 // death test subprocesses.
7027 TEST(EventListenerDeathTest, EventsNotForwardedInDeathTestSubprecesses) {
7037 TEST(EventListenerTest, default_result_printer) {
7068 TEST(EventListenerTest, RemovingDefaultResultPrinterWorks) {
7073 // test ends.
7096 TEST(EventListenerTest, default_xml_generator) {
7127 TEST(EventListenerTest, RemovingDefaultXmlGeneratorWorks) {
7132 // test ends.
7153 // some of the macros work. We don't test them thoroughly as that
7157 GTEST_TEST(AlternativeNameTest, Works) { // GTEST_TEST is the same as TEST.
7208 TEST(IsAProtocolMessageTest, ValueIsCompileTimeConstant) {
7216 TEST(IsAProtocolMessageTest, ValueIsTrueWhenTypeIsAProtocolMessage) {
7223 TEST(IsAProtocolMessageTest, ValueIsFalseWhenTypeIsNotAProtocolMessage) {
7230 TEST(CompileAssertTypesEqual, CompilesWhenTypesAreEqual) {
7236 TEST(RemoveReferenceTest, DoesNotAffectNonReferenceType) {
7242 TEST(RemoveReferenceTest, RemovesReference) {
7254 TEST(RemoveReferenceTest, MacroVersion) {
7261 TEST(RemoveConstTest, DoesNotAffectNonConstType) {
7267 TEST(RemoveConstTest, RemovesConst) {
7280 TEST(RemoveConstTest, MacroVersion) {
7293 TEST(RemoveReferenceToConstTest, Works) {
7302 TEST(AddReferenceTest, DoesNotAffectReferenceType) {
7308 TEST(AddReferenceTest, AddsReference) {
7320 TEST(AddReferenceTest, MacroVersion) {
7332 TEST(GTestReferenceToConstTest, Works) {
7340 TEST(ImplicitlyConvertibleTest, ValueIsCompileTimeConstant) {
7348 TEST(ImplicitlyConvertibleTest, ValueIsTrueWhenConvertible) {
7361 TEST(ImplicitlyConvertibleTest, ValueIsFalseWhenNotConvertible) {
7373 TEST(IsContainerTestTest, WorksForNonContainer) {
7379 TEST(IsContainerTestTest, WorksForContainer) {
7388 TEST(ArrayEqTest, WorksForDegeneratedArrays) {
7393 TEST(ArrayEqTest, WorksForOneDimensionalArrays) {
7405 TEST(ArrayEqTest, WorksForTwoDimensionalArrays) {
7419 TEST(ArrayAwareFindTest, WorksForOneDimensionalArray) {
7425 TEST(ArrayAwareFindTest, WorksForTwoDimensionalArray) {
7436 TEST(CopyArrayTest, WorksForDegeneratedArrays) {
7442 TEST(CopyArrayTest, WorksForOneDimensionalArrays) {
7455 TEST(CopyArrayTest, WorksForTwoDimensionalArrays) {
7470 TEST(NativeArrayTest, ConstructorFromArrayWorks) {
7477 TEST(NativeArrayTest, CreatesAndDeletesCopyOfArrayWhenAskedTo) {
7492 TEST(NativeArrayTest, TypeMembersAreCorrect) {
7500 TEST(NativeArrayTest, MethodsWork) {
7526 TEST(NativeArrayTest, WorksForTwoDimensionalArray) {
7535 TEST(SkipPrefixTest, SkipsWhenPrefixMatches) {
7547 TEST(SkipPrefixTest, DoesNotSkipWhenPrefixDoesNotMatch) {