From 45b783c7243681422613844b89464609fbc00933 Mon Sep 17 00:00:00 2001 From: heck Date: Thu, 8 Jul 2021 18:51:08 +0200 Subject: [PATCH] Test: update test_tofu --- test/test_tofu.cc | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/test/test_tofu.cc b/test/test_tofu.cc index 582d372..d95cfdb 100644 --- a/test/test_tofu.cc +++ b/test/test_tofu.cc @@ -13,6 +13,9 @@ using namespace pEp::Adapter; using namespace pEp::Test::Utils; using namespace pEp::PityTest11; +using TestUnit = PityUnit; + + bool did_tx_encrypted = false; bool did_rx_encrypted = false; @@ -134,14 +137,18 @@ int main(int argc, char *argv[]) int nodesCount = 2; PityModel model{ "test_tofu", nodesCount }; - PitySwarm swarm{ model }; - swarm.addTestUnit(0, "tofu1", [](PityUnit &unit, PityPerspective *ctx) { - return tofu(unit, ctx, true); - }); - swarm.addTestUnit(1, "tofu2", [](PityUnit &unit, PityPerspective *ctx) { - return tofu(unit, ctx, false); - }); + TestUnit suite("suite_tofu"); + PitySwarm swarm{ "swarm_tofu", model }; + suite.addRef(swarm.getSwarmUnit()); + + swarm.addTestUnit(0, TestUnit("tofu1", [](PityUnit &unit, PityPerspective *ctx) { + return tofu(unit, ctx, true); + })); + + swarm.addTestUnit(1, TestUnit("tofu2", [](PityUnit &unit, PityPerspective *ctx) { + return tofu(unit, ctx, false); + })); - swarm.run(); + suite.run(); } \ No newline at end of file