From 6e308275d75df30b099552126562ff52d3ea8b57 Mon Sep 17 00:00:00 2001 From: stm-ableton Date: Thu, 29 Jan 2026 23:03:26 +0100 Subject: [PATCH] Ensure database filename used by test is invalid with SQLite >= 3.39.0 (#94) This test constructs an SqliteStorage object with a bogus database name, and expects to see a failure. The internal call to sqlite3_open succeeds with "~/" when linking against versions of SQLite from 3.39.0 onwards (and creates a file with the name "~" in the working directory). In these newer versions, trailing slashes are stripped from the input, likely as a byproduct of the following change: >The unix os interface resolves all symbolic links in database filenames >to create a canonical name for the database before the file is opened. See https://sqlite.org/changes.html. Using "." produces the expected failure. Co-authored-by: stm --- test/storage/sqlite_storage_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/storage/sqlite_storage_test.cpp b/test/storage/sqlite_storage_test.cpp index 445aff1..08cfa0a 100644 --- a/test/storage/sqlite_storage_test.cpp +++ b/test/storage/sqlite_storage_test.cpp @@ -26,7 +26,7 @@ TEST_CASE("SQLite storage") { SECTION("database should throw exceptions for unmanageable errors") { bool runtime_error_bad_db_name = false; try { - SqliteStorage("~/"); + SqliteStorage("."); } catch (runtime_error) { runtime_error_bad_db_name = true; }