#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();
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], []() {