From 4dc5e1b11c5b5d4a6f5e72072845adce4bb3ddc2 Mon Sep 17 00:00:00 2001 From: evgeny Date: Tue, 3 Nov 2026 12:37:09 +0100 Subject: [PATCH] Keep GUI history and media regression tests in device mode --- tools/chatgui/tests/test_dm_deletion.cpp | 4 ++-- tools/chatgui/tests/test_group_avatars.cpp | 2 +- tools/chatgui/tests/test_group_edits.cpp | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/chatgui/tests/test_dm_deletion.cpp b/tools/chatgui/tests/test_dm_deletion.cpp index 5d95b3912..3733fb085 100644 --- a/tools/chatgui/tests/test_dm_deletion.cpp +++ b/tools/chatgui/tests/test_dm_deletion.cpp @@ -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); diff --git a/tools/chatgui/tests/test_group_avatars.cpp b/tools/chatgui/tests/test_group_avatars.cpp index 21e6098f9..ed8b0a506 100644 --- a/tools/chatgui/tests/test_group_avatars.cpp +++ b/tools/chatgui/tests/test_group_avatars.cpp @@ -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()); diff --git a/tools/chatgui/tests/test_group_edits.cpp b/tools/chatgui/tests/test_group_edits.cpp index e13d274f6..ffc038ee3 100644 --- a/tools/chatgui/tests/test_group_edits.cpp +++ b/tools/chatgui/tests/test_group_edits.cpp @@ -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); }