Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't duplicate macro definition.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 11 Feb 2021 13:32:40 +0000 (14:32 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 11 Feb 2021 13:32:40 +0000 (14:32 +0100)
teshsuite/s4u/activity-lifecycle/activity-lifecycle.hpp
teshsuite/s4u/activity-lifecycle/testing_comm.cpp
teshsuite/s4u/activity-lifecycle/testing_comm_direct.cpp

index e961290..6da2b3c 100644 (file)
@@ -29,4 +29,16 @@ extern void assert_cleanup();
 
 #define RUN_SECTION(descr, ...) SECTION(descr) { simgrid::s4u::Actor::create(descr, all_hosts[0], __VA_ARGS__); }
 
+// Normally, we should be able use Catch2's REQUIRE_THROWS_AS(...), but it generates errors with Address Sanitizer.
+// They're certainly false positive. Nevermind and use this simpler replacement.
+#define REQUIRE_NETWORK_FAILURE(...)                                                                                   \
+  do {                                                                                                                 \
+    try {                                                                                                              \
+      __VA_ARGS__;                                                                                                     \
+      FAIL("Expected exception NetworkFailureException not caught");                                                   \
+    } catch (simgrid::NetworkFailureException const&) {                                                                \
+      XBT_VERB("got expected NetworkFailureException");                                                                \
+    }                                                                                                                  \
+  } while (0)
+
 #endif // ACTIVITY_LIFECYCLE_HPP
index 747cfd2..9205f32 100644 (file)
@@ -6,18 +6,6 @@
 #include "activity-lifecycle.hpp"
 #include <array>
 
-// Normally, we should be able use Catch2's REQUIRE_THROWS_AS(...), but it generates errors with Address Sanitizer.
-// They're certainly false positive. Nevermind and use this simpler replacement.
-#define REQUIRE_NETWORK_FAILURE(...)                                                                                   \
-  do {                                                                                                                 \
-    try {                                                                                                              \
-      __VA_ARGS__;                                                                                                     \
-      FAIL("Expected exception NetworkFailureException not caught");                                                   \
-    } catch (simgrid::NetworkFailureException const&) {                                                                \
-      XBT_VERB("got expected NetworkFailureException");                                                                \
-    }                                                                                                                  \
-  } while (0)
-
 static void test_link_off_helper(double delay)
 {
   const double start = simgrid::s4u::Engine::get_clock();
index 7b0f021..c9411d3 100644 (file)
@@ -5,18 +5,6 @@
 
 #include "activity-lifecycle.hpp"
 
-// Normally, we should be able use Catch2's REQUIRE_THROWS_AS(...), but it generates errors with Address Sanitizer.
-// They're certainly false positive. Nevermind and use this simpler replacement.
-#define REQUIRE_NETWORK_FAILURE(...)                                                                                   \
-  do {                                                                                                                 \
-    try {                                                                                                              \
-      __VA_ARGS__;                                                                                                     \
-      FAIL("Expected exception NetworkFailureException not caught");                                                   \
-    } catch (simgrid::NetworkFailureException const&) {                                                                \
-      XBT_VERB("got expected NetworkFailureException");                                                                \
-    }                                                                                                                  \
-  } while (0)
-
 TEST_CASE("Activity lifecycle: direct communication activities")
 {
   XBT_INFO("#####[ launch next \"direct-comm\" test ]#####");