From 90e940c9b398aa26d50095b2ca6905d0815f6412 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 22 Aug 2020 21:39:31 +0200 Subject: quotest: fix changeName test failures Member renames upon profile changes don't come right away, it turns out; so check User::nameChanged instead of Room::memberRenamed. --- tests/quotest.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/quotest.cpp b/tests/quotest.cpp index 0ad5ff6b..f14edcc0 100644 --- a/tests/quotest.cpp +++ b/tests/quotest.cpp @@ -493,22 +493,14 @@ TEST_IMPL(changeName) { auto* const localUser = connection()->user(); const auto& newName = connection()->generateTxnId(); // See setTopic() + clog << "Renaming the user to " << newName.toStdString() << endl; localUser->rename(newName); - connectUntil(targetRoom, &Room::memberRenamed, this, - [this, thisTest, newName, localUser](const User* arrivedUser) { - if (localUser != arrivedUser) + connectUntil(localUser, &User::nameChanged, this, + [this, thisTest, newName](const QString& emittedName, QString, + const Room* r) { + if (r != nullptr) return false; - - const auto& arrivedNewName = arrivedUser->name(targetRoom); - // Old names may diverge e.g. because the original name - // hasn't been known to Quotient - if (newName == arrivedNewName) - FINISH_TEST(true); - - clog << "Names mismatch: found " << newName.toStdString() - << " instead of " << arrivedNewName.toStdString() - << "; waiting for the next event" << endl; - return false; + FINISH_TEST(emittedName == newName); }); return false; } -- cgit v1.2.3