diff --git a/tools/chatgui/tests/test_channel_settings.cpp b/tools/chatgui/tests/test_channel_settings.cpp index 4e6082bf..47bee51a 100644 --- a/tools/chatgui/tests/test_channel_settings.cpp +++ b/tools/chatgui/tests/test_channel_settings.cpp @@ -331,13 +331,18 @@ private slots: void avatarBlobTypesAndLimits() { QFETCH(QByteArray, value); QFETCH(bool, valid); QFETCH(int, bytes); SettingsCore core; QVERIFY(core.start()); - const QByteArray sql = "UPDATE channels SET avatar_data=" + value; + const QByteArray sql = "UPDATE channels SET avatar_version=1,avatar_data=" + value; QCOMPARE(sqlite3_exec(core.inst->topo_sqlite_db, sql.constData(), nullptr, nullptr, nullptr), SQLITE_OK); bool ok = !valid; const QByteArray result = core.db.getChannelAvatar(core.channel, &ok); QCOMPARE(ok, valid); QCOMPARE(result.size(), bytes); QVERIFY(core.db.getChannelAvatar("missing", &ok).isEmpty()); QVERIFY(!ok); } + void unpublishedAvatarIsAnEmptyRead() { + SettingsCore core; QVERIFY(core.start()); + bool ok = false; QVERIFY(core.db.getChannelAvatar(core.channel, &ok).isEmpty()); QVERIFY(ok); + } + #ifdef UTUN_TEST_SETTINGS_ALLOC_FAILURES void avatarAllocationFailure_data() { QTest::addColumn("source");