|
|
@ -65,14 +65,13 @@ MinMsgRx tofu_receive(TestUnitSwarm &pity, TestContext *ctx) |
|
|
|
|
|
|
|
void tofu_receiveAndReply(TestUnitSwarm &pity, TestContext *ctx) |
|
|
|
{ |
|
|
|
MinMsgRx rx_msg = tofu_receive(pity, ctx); |
|
|
|
MinMsgRx rx_msg{ tofu_receive(pity, ctx) }; |
|
|
|
|
|
|
|
std::string addr{ std::get<0>(rx_msg) }; |
|
|
|
std::string longmsg_orig{ std::get<1>(rx_msg) }; |
|
|
|
pEpMessage msg = createMessage( |
|
|
|
ctx->own_ident, |
|
|
|
addr, |
|
|
|
"REPLY_FROM:'" + std::string(addr) + "' - " + longmsg_orig); |
|
|
|
pEpMessage msg{ |
|
|
|
createMessage(ctx->own_ident, addr, "REPLY_FROM:'" + std::string(addr) + "' - " + longmsg_orig) |
|
|
|
}; |
|
|
|
|
|
|
|
tofu_send(pity, ctx, addr, "REPLY_FROM:'" + std::string(addr) + "' - " + longmsg_orig); |
|
|
|
} |
|
|
@ -86,7 +85,7 @@ int test_create_myself(TestUnitSwarm &pity, TestContext *ctx) |
|
|
|
// Create new identity
|
|
|
|
pity.log("updating or creating identity for me"); |
|
|
|
ctx->own_ident = createOwnIdent(ctx->own_name); |
|
|
|
::PEP_STATUS status = ::myself(Adapter::session(), ctx->own_ident.get()); |
|
|
|
::PEP_STATUS status {::myself(Adapter::session(), ctx->own_ident.get())}; |
|
|
|
pEp::throw_status(status); |
|
|
|
return 0; |
|
|
|
} |
|
|
@ -113,21 +112,21 @@ int test_tofu_react(TestUnitSwarm &pity, TestContext *ctx) |
|
|
|
int main(int argc, char *argv[]) |
|
|
|
{ |
|
|
|
// Adapter::pEpLog::set_enabled(true);
|
|
|
|
// Adapter::GroupDriverReplicator::log_enabled = true;
|
|
|
|
// Adapter::GroupDriverEngine::log_enabled = true;
|
|
|
|
// Adapter::GroupDriverDummy::log_enabled = true;
|
|
|
|
// TestUnit::debug_log_enabled = false;
|
|
|
|
// PityTransport::debug_log_enabled = true;
|
|
|
|
int nodesCount = 23; |
|
|
|
// Adapter::GroupDriverReplicator::log_enabled {true};
|
|
|
|
// Adapter::GroupDriverEngine::log_enabled {true};
|
|
|
|
// Adapter::GroupDriverDummy::log_enabled {true};
|
|
|
|
// TestUnit::debug_log_enabled {false};
|
|
|
|
// PityTransport::debug_log_enabled {true};
|
|
|
|
int nodesCount{ 23 }; |
|
|
|
PityModel model{ "model_tofu2", nodesCount }; |
|
|
|
TestUnitSwarm suite = TestUnitSwarm{"suite_tofu2"}; |
|
|
|
TestUnitSwarm suite{ TestUnitSwarm{ "suite_tofu2" } }; |
|
|
|
PitySwarm swarm{ "swarm_tofu2", model }; |
|
|
|
suite.addRef(swarm.getSwarmUnit()); |
|
|
|
// ------------------------------------------------------------------------------------
|
|
|
|
swarm.addTestUnit(0, TestUnitSwarm{ "test_create_myself", test_create_myself }); |
|
|
|
swarm.addTestUnit(0, TestUnitSwarm{ "test_tofu_init_all_peers", test_tofu_init_all_peers }); |
|
|
|
|
|
|
|
for (int i = 1; i < nodesCount; i++) { |
|
|
|
for (int i{ 1 }; i < nodesCount; i++) { |
|
|
|
swarm.addTestUnit(i, TestUnitSwarm{ "test_create_myself", test_create_myself }); |
|
|
|
swarm.addTestUnit(i, TestUnitSwarm{ "test_tofu_react", test_tofu_react }); |
|
|
|
} |
|
|
|