db_test: don't verify SQLite issued error messages, they might change
A user on openbsc@ complained that with SQLite 3.8.2, the db_test fails with
--- expected
+++ stderr
-DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi
+DDB (2067) abort at 35 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi
i.e. a trivial difference in the error message issued by SQLite.
For db_test, don't output any SQLite error messages: Add argument
enable_sqlite_logging, pass as true, except in db_test.c.
Remove the SQLite error messages from expected output.
(Note that there is a src/db_test.c program that's not of interest here, this
is about the tests/db/db_test.c)
Change-Id: I2513d71cc0072aef8d08f47d0a1959f311176229
diff --git a/tests/db/db_test.c b/tests/db/db_test.c
index 389ed00..23b84cc 100644
--- a/tests/db/db_test.c
+++ b/tests/db/db_test.c
@@ -820,7 +820,9 @@
/* omit the SQLite version and compilation flags from test output */
log_set_log_level(osmo_stderr_target, LOGL_ERROR);
- dbc = db_open(ctx, "db_test.db");
+ /* Disable SQLite logging so that we're not vulnerable on SQLite error messages changing across
+ * library versions. */
+ dbc = db_open(ctx, "db_test.db", false);
log_set_log_level(osmo_stderr_target, 0);
OSMO_ASSERT(dbc);