mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-24 22:34:54 +00:00
Merge pull request #10678 from Dentomologist/skip_pagefault_test_if_no_exception_handler
UnitTests: Skip PageFaultTest if exception handlers aren't supported
This commit is contained in:
commit
0fc1fb023f
3 changed files with 28 additions and 0 deletions
|
@ -113,6 +113,11 @@ void UninstallExceptionHandler()
|
||||||
s_veh_handle = nullptr;
|
s_veh_handle = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsExceptionHandlerSupported()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#elif defined(__APPLE__) && !defined(USE_SIGACTION_ON_APPLE)
|
#elif defined(__APPLE__) && !defined(USE_SIGACTION_ON_APPLE)
|
||||||
|
|
||||||
static void CheckKR(const char* name, kern_return_t kr)
|
static void CheckKR(const char* name, kern_return_t kr)
|
||||||
|
@ -245,6 +250,11 @@ void UninstallExceptionHandler()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsExceptionHandlerSupported()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#elif defined(_POSIX_VERSION) && !defined(_M_GENERIC)
|
#elif defined(_POSIX_VERSION) && !defined(_M_GENERIC)
|
||||||
|
|
||||||
static struct sigaction old_sa_segv;
|
static struct sigaction old_sa_segv;
|
||||||
|
@ -353,15 +363,27 @@ void UninstallExceptionHandler()
|
||||||
sigaction(SIGBUS, &old_sa_bus, nullptr);
|
sigaction(SIGBUS, &old_sa_bus, nullptr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsExceptionHandlerSupported()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#else // _M_GENERIC or unsupported platform
|
#else // _M_GENERIC or unsupported platform
|
||||||
|
|
||||||
void InstallExceptionHandler()
|
void InstallExceptionHandler()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void UninstallExceptionHandler()
|
void UninstallExceptionHandler()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsExceptionHandlerSupported()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace EMM
|
} // namespace EMM
|
||||||
|
|
|
@ -7,4 +7,5 @@ namespace EMM
|
||||||
{
|
{
|
||||||
void InstallExceptionHandler();
|
void InstallExceptionHandler();
|
||||||
void UninstallExceptionHandler();
|
void UninstallExceptionHandler();
|
||||||
|
bool IsExceptionHandlerSupported();
|
||||||
} // namespace EMM
|
} // namespace EMM
|
||||||
|
|
|
@ -61,6 +61,11 @@ static void ASAN_DISABLE perform_invalid_access(void* data)
|
||||||
|
|
||||||
TEST(PageFault, PageFault)
|
TEST(PageFault, PageFault)
|
||||||
{
|
{
|
||||||
|
if (!EMM::IsExceptionHandlerSupported())
|
||||||
|
{
|
||||||
|
// TODO: Use GTEST_SKIP() instead when GTest is updated to 1.10+
|
||||||
|
return;
|
||||||
|
}
|
||||||
EMM::InstallExceptionHandler();
|
EMM::InstallExceptionHandler();
|
||||||
void* data = Common::AllocateMemoryPages(PAGE_GRAN);
|
void* data = Common::AllocateMemoryPages(PAGE_GRAN);
|
||||||
EXPECT_NE(data, nullptr);
|
EXPECT_NE(data, nullptr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue