Home | History | Annotate | Download | only in test

Lines Matching refs:TEST

30 // A unit test for Google Test itself.  This verifies that the basic
31 // constructs of Google Test work.
38 // Indicates that this translation unit is part of Google Test's
61 // A subroutine used by the following test.
66 // This function calls a test subroutine, catches the fatal failure it
72 // Catches the fatal failure and aborts the test.
74 // The testing::Test:: prefix is necessary when calling
75 // HasFatalFailure() outside of a TEST, TEST_F, or test fixture.
76 if (testing::Test::HasFatalFailure()) return;
82 TEST(PassingTest, PassingTest1) {
85 TEST(PassingTest, PassingTest2) {
89 TEST(FatalFailureTest, FatalFailureInSubroutine) {
96 TEST(FatalFailureTest, FatalFailureInNestedSubroutine) {
102 // Catches the fatal failure and aborts the test.
104 // When calling HasFatalFailure() inside a TEST, TEST_F, or test
105 // fixture, the testing::Test:: prefix is not needed.
113 TEST(FatalFailureTest, NonfatalFailureInSubroutine) {
119 // Tests interleaving user logging and Google Test assertions.
120 TEST(LoggingTest, InterleavingLoggingAndAssertions) {
148 TEST(SCOPED_TRACETest, ObeysScopes) {
167 TEST(SCOPED_TRACETest, WorksInLoop) {
178 TEST(SCOPED_TRACETest, WorksInSubroutine) {
186 TEST(SCOPED_TRACETest, CanBeNested) {
195 TEST(SCOPED_TRACETest, CanBeRepeated) {
217 TEST(DisabledTestsWarningTest,
219 // This test body is intentionally empty. Its sole purpose is for
222 // the test output.
225 // Tests using assertions outside of TEST and TEST_F.
229 printf("The non-test part of the code is expected to have 2 failures.\n\n");
234 // Runs all TESTs, all TEST_Fs, and the ad hoc test.
241 class NonFatalFailureInFixtureConstructorTest : public testing::Test {
245 ADD_FAILURE() << "Expected failure #1, in the test fixture c'tor.";
249 ADD_FAILURE() << "Expected failure #5, in the test fixture d'tor.";
262 ADD_FAILURE() << "Expected failure #3, in the test body.";
266 class FatalFailureInFixtureConstructorTest : public testing::Test {
274 ADD_FAILURE() << "Expected failure #2, in the test fixture d'tor.";
279 << "We should never get here, as the test fixture c'tor "
285 << "We should never get here, as the test fixture c'tor "
290 FAIL() << "Expected failure #1, in the test fixture c'tor.";
295 ADD_FAILURE() << "UNEXPECTED failure in the test body. "
296 << "We should never get here, as the test fixture c'tor "
301 class NonFatalFailureInSetUpTest : public testing::Test {
317 FAIL() << "Expected failure #4, in the test fixture d'tor.";
322 FAIL() << "Expected failure #2, in the test function.";
326 class FatalFailureInSetUpTest : public testing::Test {
342 FAIL() << "Expected failure #3, in the test fixture d'tor.";
347 FAIL() << "UNEXPECTED failure in the test function. "
353 // This group of tests verifies that Google Test handles SEH and C++
362 // Tests exceptions thrown in the test fixture constructor.
363 class ExceptionInFixtureCtorTest : public testing::Test {
367 "in the test fixture's constructor)\n");
378 << "We should never get here, as the test fixture c'tor threw.";
383 << "We should never get here, as the test fixture c'tor threw.";
388 << "We should never get here, as the test fixture c'tor threw.";
393 FAIL() << "UNEXPECTED failure in the test function. "
394 << "We should never get here, as the test fixture c'tor threw.";
398 class ExceptionInSetUpTest : public testing::Test {
415 FAIL() << "Expected failure #3, in the test fixture d'tor.";
420 FAIL() << "UNEXPECTED failure in the test function. "
424 // Tests that TearDown() and the test fixture d'tor are always called,
425 // even when the test function throws an exception.
426 class ExceptionInTestFunctionTest : public testing::Test {
437 FAIL() << "Expected failure #3, in the test fixture d'tor.";
441 // Tests that the test fixture d'tor is always called, even when the
442 // test function throws an SEH exception.
451 // Tests that the test fixture d'tor is always called, even when the
452 // test function throws a C++ exception. We do this only when
459 class ExceptionInTearDownTest : public testing::Test {
470 FAIL() << "Expected failure #2, in the test fixture d'tor.";
482 // The MixedUpTestCaseTest test case verifies that Google Test will fail a
483 // test if it uses a different fixture class than what other tests in
484 // the same test case use. It deliberately contains two fixture
487 // The MixedUpTestCaseWithSameTestNameTest test case verifies that
488 // when the user defines two tests with the same test case name AND
489 // same test name (but in different namespaces), the second test will
494 class MixedUpTestCaseTest : public testing::Test {
500 class MixedUpTestCaseWithSameTestNameTest : public testing::Test {
510 class MixedUpTestCaseTest : public testing::Test {
514 // golden file to check that Google Test generates the right error message.
518 class MixedUpTestCaseWithSameTestNameTest : public testing::Test {
521 // Expected to fail. We rely on the golden file to check that Google Test
528 // The following two test cases verify that Google Test catches the user
529 // error of mixing TEST and TEST_F in the same test case. The first
530 // test case checks the scenario where TEST_F appears before TEST, and
531 // the second one checks where TEST appears before TEST_F.
533 class TEST_F_before_TEST_in_same_test_case : public testing::Test {
538 // Expected to fail. We rely on the golden file to check that Google Test
540 TEST(TEST_F_before_TEST_in_same_test_case, DefinedUsingTESTAndShouldFail) {}
542 class TEST_before_TEST_F_in_same_test_case : public testing::Test {
545 TEST(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST) {}
547 // Expected to fail. We rely on the golden file to check that Google Test
556 TEST
565 TEST(ExpectNonfatalFailureTest, CanReferenceLocalVariables) {
576 TEST(ExpectNonfatalFailureTest, SucceedsWhenThereIsOneNonfatalFailure) {
584 TEST(ExpectNonfatalFailureTest, FailsWhenThereIsNoNonfatalFailure) {
592 TEST(ExpectNonfatalFailureTest, FailsWhenThereAreTwoNonfatalFailures) {
602 TEST(ExpectNonfatalFailureTest, FailsWhenThereIsOneFatalFailure) {
611 TEST(ExpectNonfatalFailureTest, FailsWhenStatementReturns) {
622 TEST(ExpectNonfatalFailureTest, FailsWhenStatementThrows) {
635 TEST(ExpectFatalFailureTest, CanReferenceGlobalVariables) {
644 TEST(ExpectFatalFailureTest, CanReferenceLocalStaticVariables) {
654 TEST(ExpectFatalFailureTest, SucceedsWhenThereIsOneFatalFailure) {
662 TEST(ExpectFatalFailureTest, FailsWhenThereIsNoFatalFailure) {
675 TEST(ExpectFatalFailureTest, FailsWhenThereAreTwoFatalFailures) {
685 TEST(ExpectFatalFailureTest, FailsWhenThereIsOneNonfatalFailure) {
694 TEST(ExpectFatalFailureTest, FailsWhenStatementReturns) {
705 TEST(ExpectFatalFailureTest, FailsWhenStatementThrows) {
721 class TypedTest : public testing::Test {
740 class TypedTestP : public testing::Test {
762 // We rely on the golden file to verify that tests whose test case
765 TEST(ADeathTest, ShouldRunFirst) {
770 // We rely on the golden file to verify that typed tests whose test
774 class ATypedDeathTest : public testing::Test {
789 // whose test case name ends with DeathTest are run first.
792 class ATypeParamDeathTest : public testing::Test {
810 class ExpectFailureTest : public testing::Test {
936 // Two test environments for testing testing::AddGlobalTestEnvironment().
963 "This flag causes the program to skip test environment "
968 // The idea is to use Google Test to run all the tests we have defined (some
969 // of them are intended to fail), and then compare the test results
978 // It's hard to test InitGoogleTest() directly, as it has many
979 // global side effects. The following line serves as a sanity test
989 // process of an threadsafe-style death test.
1002 // Registers two global test environments.