The assertions come in pairs that test the same thing but have different effects on the current function. ASSERT_* versions generate fatal failures when they fail, and abort the current function. EXPECT_* versions generate nonfatal failures, which don’t abort the current function. Usually EXPECT_* are preferred, as they allow more than one failure to be reported in a test. However, you should use ASSERT_* if it doesn’t make sense to continue when the assertion in question fails.
$ ./test1 [==========] Running 3 tests from 2 test suites. [----------] Global test environment set-up. [----------] 2 tests from FactorialTest [ RUN ] FactorialTest.HandlesZeroInput [ OK ] FactorialTest.HandlesZeroInput (0 ms) [ RUN ] FactorialTest.HandlesPositiveInput [ OK ] FactorialTest.HandlesPositiveInput (0 ms) [----------] 2 tests from FactorialTest (0 ms total)
[----------] 1 test from FactorialTest1 [ RUN ] FactorialTest1.HandlesPositiveInput1 [ OK ] FactorialTest1.HandlesPositiveInput1 (0 ms) [----------] 1 test from FactorialTest1 (0 ms total)
[----------] Global test environment tear-down [==========] 3 tests from 2 test suites ran. (0 ms total) [ PASSED ] 3 tests.