diff --git a/src/processor/exploitability_unittest.cc b/src/processor/exploitability_unittest.cc index db3dc687..b5e7feef 100644 --- a/src/processor/exploitability_unittest.cc +++ b/src/processor/exploitability_unittest.cc @@ -37,12 +37,12 @@ #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/minidump_processor.h" #include "google_breakpad/processor/process_state.h" -#ifndef _WIN32 +#ifdef __linux__ #include "processor/exploitability_linux.h" -#endif // _WIN32 +#endif // __linux__ #include "processor/simple_symbol_supplier.h" -#ifndef _WIN32 +#ifdef __linux__ namespace google_breakpad { class ExploitabilityLinuxTest : public ExploitabilityLinux { @@ -64,15 +64,15 @@ class ExploitabilityLinuxTestMinidumpContext : public MinidumpContext { }; } // namespace google_breakpad -#endif // _WIN32 +#endif // __linux__ namespace { using google_breakpad::BasicSourceLineResolver; -#ifndef _WIN32 +#ifdef __linux__ using google_breakpad::ExploitabilityLinuxTest; using google_breakpad::ExploitabilityLinuxTestMinidumpContext; -#endif // _WIN32 +#endif // __linux__ using google_breakpad::MinidumpProcessor; using google_breakpad::ProcessState; using google_breakpad::SimpleSymbolSupplier; @@ -171,7 +171,7 @@ TEST(ExploitabilityTest, TestLinuxEngine) { ExploitabilityFor("linux_executable_heap.dmp")); ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp")); -#ifndef _WIN32 +#ifdef __linux__ ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, ExploitabilityFor("linux_write_to_nonwritable_module.dmp")); ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, @@ -182,10 +182,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) { ExploitabilityFor("linux_write_to_outside_module_via_math.dmp")); ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING, ExploitabilityFor("linux_write_to_under_4k.dmp")); -#endif // _WIN32 +#endif // __linux__ } -#ifndef _WIN32 +#ifdef __linux__ TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) { ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 0, 5, NULL)); uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0}; @@ -299,6 +299,6 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) { context, &write_address)); } -#endif // _WIN32 +#endif // __linux__ } // namespace