From 8562f6130489c255da994e527bed047223d2b970 Mon Sep 17 00:00:00 2001 From: Christian Heusel Date: Mon, 7 Nov 2022 23:15:51 +0100 Subject: [PATCH] allow identifiers in the test setup --- test/integration/framework/znctest.cpp | 8 ++++++-- test/integration/framework/znctest.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/integration/framework/znctest.cpp b/test/integration/framework/znctest.cpp index 58c3f926..e06cb834 100644 --- a/test/integration/framework/znctest.cpp +++ b/test/integration/framework/znctest.cpp @@ -72,11 +72,15 @@ Socket ZNCTest::ConnectClient() { return WrapIO(&sock); } -Socket ZNCTest::LoginClient() { +Socket ZNCTest::LoginClient(QString identifier) { auto client = ConnectClient(); client.Write("PASS :hunter2"); client.Write("NICK nick"); - client.Write("USER user/test x x :x"); + if ( identifier.length() == 0 ) { + client.Write("USER user/test x x :x"); + } else { + client.Write("USER user@" + identifier.toUtf8() + "/test x x :x"); + } return client; } diff --git a/test/integration/framework/znctest.h b/test/integration/framework/znctest.h index c03591ef..c3ce7c9e 100644 --- a/test/integration/framework/znctest.h +++ b/test/integration/framework/znctest.h @@ -37,7 +37,7 @@ class ZNCTest : public testing::Test { Socket ConnectIRCd(); Socket ConnectClient(); - Socket LoginClient(); + Socket LoginClient(QString identifier = ""); std::unique_ptr Run();