diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-08-22 21:39:31 +0200 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-08-22 21:45:43 +0200 |
commit | 90e940c9b398aa26d50095b2ca6905d0815f6412 (patch) | |
tree | bc8b41e767635c841083ad704464419aedfb8682 /tests/quotest.cpp | |
parent | c75ef102c4b24c89f28a4773d7758adcbf4b6846 (diff) | |
download | libquotient-90e940c9b398aa26d50095b2ca6905d0815f6412.tar.gz libquotient-90e940c9b398aa26d50095b2ca6905d0815f6412.zip |
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.
Diffstat (limited to 'tests/quotest.cpp')
-rw-r--r-- | tests/quotest.cpp | 20 |
1 files 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; } |