summaryrefslogtreecommitdiff
path: root/ACE/tests
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2021-06-18 18:56:46 +0200
committerGitHub <noreply@github.com>2021-06-18 18:56:46 +0200
commit67e660cf72c7e02e91b7e0df2bbfb9fe5d5e2094 (patch)
tree6feb5d12f61e72cd88377f36841be9fbd6198116 /ACE/tests
parent1620aa41534fd4715d5fc1fed61c6035add528c6 (diff)
parent2b717af399e275065bfada5f77631cd69d75eff6 (diff)
downloadATCD-67e660cf72c7e02e91b7e0df2bbfb9fe5d5e2094.tar.gz
Merge pull request #1561 from jwillemsen/jwi-sehtest
New compiler test to validated that structured exception handling on windows works
Diffstat (limited to 'ACE/tests')
-rw-r--r--ACE/tests/Compiler_Features_39_Test.cpp49
-rw-r--r--ACE/tests/run_test.lst1
-rw-r--r--ACE/tests/tests.mpc7
3 files changed, 57 insertions, 0 deletions
diff --git a/ACE/tests/Compiler_Features_39_Test.cpp b/ACE/tests/Compiler_Features_39_Test.cpp
new file mode 100644
index 00000000000..7942f4d21af
--- /dev/null
+++ b/ACE/tests/Compiler_Features_39_Test.cpp
@@ -0,0 +1,49 @@
+/**
+ * This program checks if the compiler/RTL does have correct support
+ * for structured exception handling
+ */
+
+#include "test_config.h"
+
+#if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS)
+int ExFilter(EXCEPTION_POINTERS *ep, DWORD code_arg)
+{
+ ACE_DEBUG ((LM_INFO,("In SEH Filter\n")));
+ ACE_DEBUG ((LM_INFO,("Code param=%d\n"), code_arg));
+ ACE_DEBUG ((LM_INFO,("\tep->ExceptionRecord->ExceptionCode =%d\n"), ep->ExceptionRecord->ExceptionCode));
+ ACE_DEBUG ((LM_INFO,("\tep->ExceptionRecord->ExceptionAddress =%@\n"), ep->ExceptionRecord->ExceptionAddress));
+ if (ep->ExceptionRecord->NumberParameters >= 1)
+ ACE_DEBUG ((LM_INFO,("\tep->ExceptionRecord->ExceptionInformation[0]=%@\n"), ep->ExceptionRecord->ExceptionInformation[0]));
+ if (ep->ExceptionRecord->NumberParameters == 2)
+ ACE_DEBUG ((LM_INFO,("\tep->ExceptionRecord->ExceptionInformation[1]=%@\n"), ep->ExceptionRecord->ExceptionInformation[1]));
+ return 1;
+}
+#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
+
+int
+run_main (int, ACE_TCHAR *[])
+{
+ ACE_START_TEST (ACE_TEXT("Compiler_Features_39_Test"));
+
+#if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS)
+ ACE_SEH_TRY
+ {
+ volatile int* pInt = 0x0000000;
+ *pInt = 20;
+ }
+ ACE_SEH_EXCEPT (ExFilter(GetExceptionInformation(), GetExceptionCode()))
+ {
+ ACE_DEBUG ((LM_DEBUG,("In SEH __except\n")));
+ }
+
+ ACE_DEBUG ((LM_DEBUG,("SEH worked\n")));
+#else
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("Platform lacks ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS\n")));
+#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */
+
+ ACE_END_TEST;
+
+ return 0;
+}
+
diff --git a/ACE/tests/run_test.lst b/ACE/tests/run_test.lst
index 7277368fffb..ab5e25d91a2 100644
--- a/ACE/tests/run_test.lst
+++ b/ACE/tests/run_test.lst
@@ -109,6 +109,7 @@ Compiler_Features_35_Test
Compiler_Features_36_Test
Compiler_Features_37_Test
Compiler_Features_38_Test
+Compiler_Features_39_Test
Config_Test: !LynxOS !VxWorks !ACE_FOR_TAO
Conn_Test: !ACE_FOR_TAO
DLL_Test: !STATIC Linux
diff --git a/ACE/tests/tests.mpc b/ACE/tests/tests.mpc
index 35feb43db0f..bce99b2dd5e 100644
--- a/ACE/tests/tests.mpc
+++ b/ACE/tests/tests.mpc
@@ -842,6 +842,13 @@ project(Compiler_Features_38_Test) : acetest {
}
}
+project(Compiler_Features_39_Test) : acetest {
+ exename = Compiler_Features_39_Test
+ Source_Files {
+ Compiler_Features_39_Test.cpp
+ }
+}
+
project(Config Test) : acetest {
avoids += ace_for_tao
exename = Config_Test