aboutsummaryrefslogtreecommitdiff
path: root/googletest/test/gtest_premature_exit_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'googletest/test/gtest_premature_exit_test.cc')
-rw-r--r--googletest/test/gtest_premature_exit_test.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/googletest/test/gtest_premature_exit_test.cc b/googletest/test/gtest_premature_exit_test.cc
index 1d1187ef..1a0c5ea4 100644
--- a/googletest/test/gtest_premature_exit_test.cc
+++ b/googletest/test/gtest_premature_exit_test.cc
@@ -81,15 +81,17 @@ TEST_F(PrematureExitDeathTest, FileExistsDuringExecutionOfDeathTest) {
return;
}
- EXPECT_DEATH_IF_SUPPORTED({
- // If the file exists, crash the process such that the main test
- // process will catch the (expected) crash and report a success;
- // otherwise don't crash, which will cause the main test process
- // to report that the death test has failed.
- if (PrematureExitFileExists()) {
- exit(1);
- }
- }, "");
+ EXPECT_DEATH_IF_SUPPORTED(
+ {
+ // If the file exists, crash the process such that the main test
+ // process will catch the (expected) crash and report a success;
+ // otherwise don't crash, which will cause the main test process
+ // to report that the death test has failed.
+ if (PrematureExitFileExists()) {
+ exit(1);
+ }
+ },
+ "");
}
// Tests that the premature-exit file exists during the execution of a
@@ -106,7 +108,7 @@ TEST_F(PrematureExitTest, PrematureExitFileExistsDuringTestExecution) {
} // namespace
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
InitGoogleTest(&argc, argv);
const int exit_code = RUN_ALL_TESTS();