diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-02-18 14:27:24 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-02-18 14:27:24 +0100 |
commit | d4f1b09476c4bcc5c33cc40e2506d7fd6a731456 (patch) | |
tree | 8cb8494ec6cceb581cd53033870000c200c05950 | |
parent | 4f4c04c53ea27777e8cf4ecab690985ad3f78e1f (diff) | |
download | libquotient-d4f1b09476c4bcc5c33cc40e2506d7fd6a731456.tar.gz libquotient-d4f1b09476c4bcc5c33cc40e2506d7fd6a731456.zip |
TestOlmAccount: align homeserver address with that in run-tests.sh
It would probably be even better to pass the homeserver address in
the environment but that's a bigger endeavour.
Also: reformatted CREATE_CONNECTION macro.
-rw-r--r-- | autotests/testolmaccount.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/autotests/testolmaccount.cpp b/autotests/testolmaccount.cpp index 760276c8..0c44c8d7 100644 --- a/autotests/testolmaccount.cpp +++ b/autotests/testolmaccount.cpp @@ -168,25 +168,25 @@ void TestOlmAccount::encryptedFile() QCOMPARE(file.key.kty, "oct"); } -#define CREATE_CONNECTION(VAR, USERNAME, SECRET, DEVICE_NAME) \ - NetworkAccessManager::instance()->ignoreSslErrors(true); \ - auto VAR = std::make_shared<Connection>(); \ - (VAR) ->resolveServer("@alice:localhost:443"); \ - connect( (VAR) .get(), &Connection::loginFlowsChanged, this, [=] { \ - (VAR) ->loginWithPassword( (USERNAME) , SECRET , DEVICE_NAME , ""); \ - }); \ - connect( (VAR) .get(), &Connection::networkError, [](QString error) { \ - QWARN(qUtf8Printable(error)); \ - QFAIL("Network error: make sure synapse is running"); \ - }); \ - connect( (VAR) .get(), &Connection::loginError, [](QString error) { \ - QWARN(qUtf8Printable(error)); \ - QFAIL("Login failed"); \ - }); \ - QSignalSpy spy ## VAR ((VAR).get(), &Connection::loginFlowsChanged); \ - QSignalSpy spy2 ## VAR ((VAR).get(), &Connection::connected); \ - QVERIFY(spy ## VAR .wait(10000)); \ - QVERIFY(spy2 ## VAR .wait(10000)); +#define CREATE_CONNECTION(VAR, USERNAME, SECRET, DEVICE_NAME) \ + NetworkAccessManager::instance()->ignoreSslErrors(true); \ + auto VAR = std::make_shared<Connection>(); \ + (VAR)->resolveServer("@" USERNAME ":localhost:1234"); \ + connect((VAR).get(), &Connection::loginFlowsChanged, this, [=] { \ + (VAR)->loginWithPassword((USERNAME), SECRET, DEVICE_NAME, ""); \ + }); \ + connect((VAR).get(), &Connection::networkError, [](QString error) { \ + QWARN(qUtf8Printable(error)); \ + QFAIL("Network error: make sure synapse is running"); \ + }); \ + connect((VAR).get(), &Connection::loginError, [](QString error) { \ + QWARN(qUtf8Printable(error)); \ + QFAIL("Login failed"); \ + }); \ + QSignalSpy spy##VAR((VAR).get(), &Connection::loginFlowsChanged); \ + QSignalSpy spy2##VAR((VAR).get(), &Connection::connected); \ + QVERIFY(spy##VAR.wait(10000)); \ + QVERIFY(spy2##VAR.wait(10000)); void TestOlmAccount::uploadIdentityKey() { |