Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Prefer a reference for first parameter of {test,wait}_{all,any}.
[simgrid.git] / teshsuite / s4u / activity-lifecycle / testing_comm.cpp
index 3256474..87b7af7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -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], []() {