From 334991fbe59a0f40e704867033641a2cd09bfce6 Mon Sep 17 00:00:00 2001 From: evgeny Date: Mon, 26 Oct 2026 22:56:21 +0100 Subject: [PATCH] Initialize the desktop edit fixture with a valid test identity --- tools/chatgui/tests/test_group_edits.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/chatgui/tests/test_group_edits.cpp b/tools/chatgui/tests/test_group_edits.cpp index aabddde0..b3e0f4b7 100644 --- a/tools/chatgui/tests/test_group_edits.cpp +++ b/tools/chatgui/tests/test_group_edits.cpp @@ -40,13 +40,17 @@ private slots: directory.setAutoRemove(false); auto diagnostics = qScopeGuard([&] { directory.setAutoRemove(!QTest::currentTestFailed()); }); const auto configPath = directory.filePath("node.cfg"); QFile config(configPath); QVERIFY(config.open(QIODevice::WriteOnly)); - const QByteArray settings = "[global]\ntun_enabled=no\n[server:local]\naddr=127.0.0.1:0\ntype=private\n" + const QByteArray settings = "[global]\n" + "my_private_key=704f2e012c8fa8768130cb0f988a997dccb628372bc5ceccacc78dcbfec5916f\n" + "my_public_key=b3193173def895bd0fcea6f86af077c7d77216f10395275f627ac18242ec0f01\n" + "tun_enabled=no\n[server:local]\naddr=127.0.0.1:0\ntype=private\n" "[chatserver]\ngroup_autoconnect=0\nstorage_autoload=0\nlocal_invites_enabled=0\nlocal_broadcasts_enabled=0\n" "[ntp]\nenabled=no\n"; QCOMPARE(config.write(settings), settings.size()); config.close(); DbManager db; MainWindow window(nullptr, &db, configPath, directory.filePath("db"), directory.filePath("edit.log"), "warn", "chat_sync=debug"); - window.show(); QFile log(directory.filePath("edit.log")); log.open(QIODevice::ReadOnly); - QVERIFY2(window.utunNode()->isRunning(), qPrintable(window.utunNode()->startupError() + "\n" + log.readAll())); + window.show(); QFile log(directory.filePath("edit.log")); + const QByteArray startupLog = log.open(QIODevice::ReadOnly) ? log.readAll() : QByteArray("log unavailable"); + QVERIFY2(window.utunNode()->isRunning(), qPrintable(window.utunNode()->startupError() + "\n" + startupLog)); QTRY_VERIFY_WITH_TIMEOUT(db.isOpen(), 3000); QCOMPARE(inCore([](UTUN_INSTANCE* inst) { chat_core_create_channel_auto(inst, "Editable"); return 0; }), 0); QTRY_COMPARE(db.getChannels().size(), 1); const auto channel = db.getChannels().first().channelId;