David Bold 60de867
From 71c74425b70a32cdedcde42925e5be6b62070aeb Mon Sep 17 00:00:00 2001
David Bold 60de867
From: j-b-o <61712105+j-b-o@users.noreply.github.com>
David Bold 60de867
Date: Mon, 24 Jan 2022 17:50:38 +0100
David Bold 60de867
Subject: [PATCH] Remove tests depending on UB
David Bold 60de867
David Bold 60de867
---
David Bold 60de867
 tests/unit/src/test_bout++.cxx | 29 -----------------------------
David Bold 60de867
 1 file changed, 29 deletions(-)
David Bold 60de867
David Bold 60de867
diff --git a/tests/unit/src/test_bout++.cxx b/tests/unit/src/test_bout++.cxx
David Bold 60de867
index 050901ddb8..1c895fffbc 100644
David Bold 60de867
--- a/tests/unit/src/test_bout++.cxx
David Bold 60de867
+++ b/tests/unit/src/test_bout++.cxx
David Bold 60de867
@@ -6,7 +6,6 @@
David Bold 60de867
 #include "utils.hxx"
David Bold 60de867
 
David Bold 60de867
 #include <algorithm>
David Bold 60de867
-#include <csignal>
David Bold 60de867
 #include <iostream>
David Bold 60de867
 #include <string>
David Bold 60de867
 #include <vector>
David Bold 60de867
@@ -313,34 +312,6 @@ TEST_F(PrintStartupTest, CommandLineArguments) {
David Bold 60de867
   }
David Bold 60de867
 }
David Bold 60de867
 
David Bold 60de867
-#ifdef SIGHANDLE
David Bold 60de867
-
David Bold 60de867
-#ifdef BOUT_FPE
David Bold 60de867
-#include <fenv.h>
David Bold 60de867
-#endif
David Bold 60de867
-
David Bold 60de867
-class SignalHandlerTest : public ::testing::Test {
David Bold 60de867
-public:
David Bold 60de867
-  SignalHandlerTest() = default;
David Bold 60de867
-  virtual ~SignalHandlerTest() {
David Bold 60de867
-    std::signal(SIGUSR1, SIG_DFL);
David Bold 60de867
-    std::signal(SIGFPE, SIG_DFL);
David Bold 60de867
-    std::signal(SIGSEGV, SIG_DFL);
David Bold 60de867
-#ifdef BOUT_FPE
David Bold 60de867
-    std::signal(SIGFPE, SIG_DFL);
David Bold 60de867
-    fedisableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
David Bold 60de867
-#endif
David Bold 60de867
-  }
David Bold 60de867
-};
David Bold 60de867
-
David Bold 60de867
-using SignalHandlerTestDeathTest = SignalHandlerTest;
David Bold 60de867
-
David Bold 60de867
-TEST_F(SignalHandlerTestDeathTest, SegFault) {
David Bold 60de867
-  bout::experimental::setupSignalHandler(bout::experimental::defaultSignalHandler);
David Bold 60de867
-  // This test is *incredibly* expensive, maybe as much as 1s, so only test the one signal
David Bold 60de867
-  EXPECT_DEATH(std::raise(SIGSEGV), "SEGMENTATION FAULT");
David Bold 60de867
-}
David Bold 60de867
-#endif
David Bold 60de867
 
David Bold 60de867
 TEST(BoutInitialiseFunctions, SetRunStartInfo) {
David Bold 60de867
   WithQuietOutput quiet{output_info};