aboutsummaryrefslogtreecommitdiff
path: root/googletest/test/googletest-break-on-failure-unittest_.cc
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-13 19:35:45 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-13 19:35:45 +0000
commitdc45d51ba1d0edb09318627aa368ae2a37a823ee (patch)
tree41e03b6df9bfba33adc57cd9b3ae093dbdac32b9 /googletest/test/googletest-break-on-failure-unittest_.cc
parent525b72a0dc9d16e8f9fd9b5be88c1b72715a4681 (diff)
parent05911fd931cde55ea86bdb12b5706fb5aa570544 (diff)
downloadgoogletest-android-games-sdk-game-activity-release.tar.gz
Snap for 11443790 from 05911fd931cde55ea86bdb12b5706fb5aa570544 to android-games-sdk-game-activity-releaseandroid-games-sdk-game-activity-release
Change-Id: I41e5f388a6eb080093d38ac9f2639d2c26520914
Diffstat (limited to 'googletest/test/googletest-break-on-failure-unittest_.cc')
-rw-r--r--googletest/test/googletest-break-on-failure-unittest_.cc25
1 files changed, 11 insertions, 14 deletions
diff --git a/googletest/test/googletest-break-on-failure-unittest_.cc b/googletest/test/googletest-break-on-failure-unittest_.cc
index f84957a2..337e34c3 100644
--- a/googletest/test/googletest-break-on-failure-unittest_.cc
+++ b/googletest/test/googletest-break-on-failure-unittest_.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
// Unit test for Google Test's break-on-failure mode.
//
// A user can ask Google Test to seg-fault when an assertion fails, using
@@ -40,35 +39,33 @@
#include "gtest/gtest.h"
-#if GTEST_OS_WINDOWS
-# include <windows.h>
-# include <stdlib.h>
+#ifdef GTEST_OS_WINDOWS
+#include <stdlib.h>
+#include <windows.h>
#endif
namespace {
// A test that's expected to fail.
-TEST(Foo, Bar) {
- EXPECT_EQ(2, 3);
-}
+TEST(Foo, Bar) { EXPECT_EQ(2, 3); }
-#if GTEST_HAS_SEH && !GTEST_OS_WINDOWS_MOBILE
+#if GTEST_HAS_SEH && !defined(GTEST_OS_WINDOWS_MOBILE)
// On Windows Mobile global exception handlers are not supported.
-LONG WINAPI ExitWithExceptionCode(
- struct _EXCEPTION_POINTERS* exception_pointers) {
+LONG WINAPI
+ExitWithExceptionCode(struct _EXCEPTION_POINTERS* exception_pointers) {
exit(exception_pointers->ExceptionRecord->ExceptionCode);
}
#endif
} // namespace
-int main(int argc, char **argv) {
-#if GTEST_OS_WINDOWS
+int main(int argc, char** argv) {
+#ifdef GTEST_OS_WINDOWS
// Suppresses display of the Windows error dialog upon encountering
// a general protection fault (segment violation).
SetErrorMode(SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS);
-# if GTEST_HAS_SEH && !GTEST_OS_WINDOWS_MOBILE
+#if GTEST_HAS_SEH && !defined(GTEST_OS_WINDOWS_MOBILE)
// The default unhandled exception filter does not always exit
// with the exception code as exit code - for example it exits with
@@ -78,7 +75,7 @@ int main(int argc, char **argv) {
// exceptions.
SetUnhandledExceptionFilter(ExitWithExceptionCode);
-# endif
+#endif
#endif // GTEST_OS_WINDOWS
testing::InitGoogleTest(&argc, argv);