Release v0.6.39: isolate history UI and image clipboard memory

This commit is contained in:
2026-11-04 19:40:54 +02:00
parent fa2f6d2ce4
commit 00c9cb0ee4
22 changed files with 747 additions and 49 deletions
+16
View File
@@ -29,6 +29,12 @@ int main() {
"helper persists fingerprints and resident reloads them");
require(entries.back().id==pinned && entries.back().pinned,"helper preserves existing pinned entry");
auto restored=history.load(entries.front().id);
auto thumbnail=history.thumbnail(entries.front().id);
require(thumbnail.width==pixels.width && thumbnail.height==pixels.height && thumbnail.bgra==pixels.bgra,
"helper thumbnail preserves small image pixels");
bool thumbnailCancelled=false;
try {history.thumbnail(entries.front().id,[]{return true;});} catch(...) {thumbnailCancelled=true;}
require(thumbnailCancelled,"closed history cancels thumbnail work");
auto has=[&](const ks::Format &expected) {
return std::any_of(restored.formats.begin(),restored.formats.end(),[&](const ks::Format &actual) {
return (expected.name.empty()?actual.id==expected.id:actual.name==expected.name) && actual.data==expected.data;
@@ -55,6 +61,16 @@ int main() {
}
require(rejected && history.entries().size()==2,"oversized image is rejected without changing index");
require(GetClipboardSequenceNumber()==sequence,"rejection leaves clipboard unchanged");
settings.maxImageMiB=20;
history.add(ks::Clip{{ks::imageDib(pixels)}},L"thumbnail fixture",settings);
auto largeId=history.entries().front().id;
thumbnail=history.thumbnail(largeId);
require(thumbnail.width==208 && thumbnail.height==104 && thumbnail.bgra.size()==208*104*4,
"large image returns only bounded thumbnail pixels");
history.remove(largeId);
bool missingRejected=false;
try {history.thumbnail(largeId);} catch(...) {missingRejected=true;}
require(missingRejected,"deleted image cannot be previewed or recreated");
for(const auto &file:std::filesystem::directory_iterator(folder))
require(file.path().extension()!=L".request","encrypted capture request is cleaned up");
} catch(const std::exception &e) {std::cerr << "FAIL " << e.what() << '\n';result=1;}