[test-dbi-backend] Test 64-bit integer insertion explicitly.

https://bugs.gnucash.org/show_bug.cgi?id=799623 identified a problem
with int64_t storage in SQLite3 by setting a date after 2038-01-23
whose time64 overflowed int32_t. But dates shouldn't be stored as
time64s, they should be stored as ISO 8601 date-time strings. So fix
the test to store the date correctly and to store the big int as an
int64_t.
pull/2103/head
John Ralls 11 months ago
parent b0c60fb310
commit 60bc4ccab0

@ -117,6 +117,7 @@ setup_memory (Fixture* fixture, gconstpointer pData)
Split* spl1, *spl2;
gnc_commodity_table* table;
gnc_commodity* currency;
Time64 now{gnc_time(nullptr)};
gnc_module_init_backend_dbi();
root = gnc_book_get_root_account (book);
@ -131,10 +132,10 @@ setup_memory (Fixture* fixture, gconstpointer pData)
xaccAccountSetCommodity (acct1, currency);
auto frame = qof_instance_get_slots (QOF_INSTANCE (acct1));
frame->set ({"int64-val"}, new KvpValue (INT64_C (100)));
frame->set ({"int64-val"}, new KvpValue (INT64_C (2148634028)));
frame->set ({"double-val"}, new KvpValue (3.14159));
frame->set ({"numeric-val"}, new KvpValue (gnc_numeric_zero ()));
frame->set ({"time-val"}, new KvpValue (gnc_time(nullptr)));
frame->set ({"time-val"}, new KvpValue (now));
frame->set ({"string-val"}, new KvpValue (g_strdup ("abcdefghijklmnop")));
auto guid = qof_instance_get_guid (QOF_INSTANCE (acct1));
frame->set ({"guid-val"}, new KvpValue (const_cast<GncGUID*> (guid_copy (
@ -669,6 +670,8 @@ test_suite_gnc_backend_dbi (void)
mysql_url.append(getenv("TEST_MYSQL_URL") ? getenv("TEST_MYSQL_URL") : "");
pgsql_url.append(getenv("TEST_PGSQL_URL") ? getenv("TEST_PGSQL_URL") : "");
sort(drivers.begin(), drivers.end());
for (auto name : drivers)
{
if (name == "sqlite3")

Loading…
Cancel
Save