]> AND Public Git Repository - simgrid.git/blobdiff - teshsuite/s4u/activity-lifecycle/testing_comm.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Mix XML and C++ platforms
[simgrid.git] / teshsuite / s4u / activity-lifecycle / testing_comm.cpp
index 747cfd2ce6def4310bef912eb2c3a5d672177e2b..87b7af7c305cc66b966027d9caacf7c79181389a 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();
@@ -284,7 +272,7 @@ TEST_CASE("Activity lifecycle: comm activities")
       int* data;
       simgrid::s4u::CommPtr comm                       = simgrid::s4u::Mailbox::by_name("mb")->get_async<int>(&data);
       std::vector<simgrid::s4u::CommPtr> pending_comms = {comm};
-      REQUIRE_NETWORK_FAILURE(simgrid::s4u::Comm::wait_any(&pending_comms));
+      REQUIRE_NETWORK_FAILURE(simgrid::s4u::Comm::wait_any(pending_comms));
     });
 
     simgrid::s4u::ActorPtr sender = simgrid::s4u::Actor::create("sender", all_hosts[2], []() {