Keep GUI history and media regression tests in device mode
This commit is contained in:
1 parent
d840688e96
commit
4dc5e1b11c
3 files changed
+6
-5
No files matched your search
@@ -140,7 +140,7 @@ private slots:
|
||||
QCOMPARE(sc_generate_keypair(&peer), SC_OK); QCOMPARE(sc_derive_ed25519_pubkey(peer.private_key, ed), SC_OK);
|
||||
const quint64 peerId = sc_derive_node_id_from_pubkey(peer.public_key);
|
||||
const auto startPeer = [peer, ed, peerId](UTUN_INSTANCE* inst) {
|
||||
return dm_start(inst, peerId, peer.public_key, ed, "Alice", nullptr);
|
||||
return dm_start(inst, peerId, peer.public_key, ed, "Alice", nullptr, DM_MODE_DEVICE, nullptr);
|
||||
};
|
||||
QCOMPARE(inCore(startPeer), 0);
|
||||
QTRY_COMPARE_WITH_TIMEOUT(db.getDmConversations().size(), 1, 3000);
|
||||
@@ -214,7 +214,7 @@ private slots:
|
||||
QCOMPARE(sc_generate_keypair(&other), SC_OK); QCOMPARE(sc_derive_ed25519_pubkey(other.private_key, otherEd), SC_OK);
|
||||
const quint64 otherId = sc_derive_node_id_from_pubkey(other.public_key);
|
||||
QCOMPARE(inCore([other, otherEd, otherId](UTUN_INSTANCE* inst) {
|
||||
return dm_start(inst, otherId, other.public_key, otherEd, "Bob", nullptr);
|
||||
return dm_start(inst, otherId, other.public_key, otherEd, "Bob", nullptr, DM_MODE_DEVICE, nullptr);
|
||||
}), 0);
|
||||
QTRY_COMPARE_WITH_TIMEOUT(db.getDmConversations().size(), 2, 3000);
|
||||
QCoreApplication::processEvents(); channels->selectChannel("dm:" + conv);
|
||||
|
||||
@@ -124,7 +124,7 @@ private slots:
|
||||
QCOMPARE(db.getChannels()[0].channelId, survivor); QCOMPARE(deletedChannels, QStringList({channel}));
|
||||
list.loadChannels(); QCOMPARE(view->currentIndex().data(ChannelChannelIdRole).toString(), survivor);
|
||||
const QByteArray peer = QByteArray::fromHex("ce8871f07fa056c636d297115f231b08c29cdf94e0d440fce83a07c34416d36a");
|
||||
QCOMPARE(dm_start(instance, 7, (const uint8_t*)peer.constData(), (const uint8_t*)peer.constData(), "PM", nullptr), 0);
|
||||
QCOMPARE(dm_start(instance, 7, (const uint8_t*)peer.constData(), (const uint8_t*)peer.constData(), "PM", nullptr, DM_MODE_DEVICE, nullptr), 0);
|
||||
chat_core_delete_channel(instance, survivor.toLatin1().constData());
|
||||
list.loadChannels();
|
||||
QVERIFY(!view->currentIndex().data(ChannelIsSectionRole).toBool());
|
||||
|
||||
@@ -146,7 +146,8 @@ private slots:
|
||||
if (dm) {
|
||||
SC_MYKEYS peer{}; uint8_t ed[32]; QCOMPARE(sc_generate_keypair(&peer), 0);
|
||||
QCOMPARE(sc_derive_ed25519_pubkey(peer.private_key, ed), 0);
|
||||
QCOMPARE(dm_start(core.instance, sc_derive_node_id_from_pubkey(peer.public_key), peer.public_key, ed, "Scroll peer", nullptr), 0);
|
||||
QCOMPARE(dm_start(core.instance, sc_derive_node_id_from_pubkey(peer.public_key), peer.public_key, ed,
|
||||
"Scroll peer", nullptr, DM_MODE_DEVICE, nullptr), 0);
|
||||
const auto conversations = core.db.getDmConversations(); QCOMPARE(conversations.size(), 1);
|
||||
conversation = conversations.first().convId; generation = conversations.first().generation;
|
||||
history->loadChannel("dm:" + conversation);
|
||||
@@ -221,7 +222,7 @@ private slots:
|
||||
SC_MYKEYS peer{}; uint8_t ed[32]; QCOMPARE(sc_generate_keypair(&peer), 0);
|
||||
QCOMPARE(sc_derive_ed25519_pubkey(peer.private_key, ed), 0);
|
||||
const auto peerId = sc_derive_node_id_from_pubkey(peer.public_key);
|
||||
QCOMPARE(dm_start(core.instance, peerId, peer.public_key, ed, "Clipboard peer", nullptr), 0);
|
||||
QCOMPARE(dm_start(core.instance, peerId, peer.public_key, ed, "Clipboard peer", nullptr, DM_MODE_DEVICE, nullptr), 0);
|
||||
conversation = QString::number(dm_derive_conv_id(core.instance->node_id, peerId));
|
||||
core.history->loadChannel("dm:" + conversation);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user