Fail the test if still using 32bit time_t in 2038

gtest-gnc-option.cpp and gtest-gnc-optiondb.cpp need to call
time() for g_date_set_time_t()
This commit is contained in:
Richard Cohen 2023-06-06 15:42:28 +01:00
parent d63248dad2
commit 7d26b8c05f

View File

@ -941,6 +941,13 @@ TEST(GncOptionDate, test_gnc_relative_date_from_storage_string)
EXPECT_EQ(RelativeDatePeriod::END_ACCOUNTING_PERIOD, gnc_relative_date_from_storage_string("end-prev-fin-year"));
}
TEST(GncOptionDate, test_not_using_32bit_time_t_in_2038)
{
// tests below call time() to initialize GDate.
// make sure the tests fail if that could cause a problem
EXPECT_FALSE(sizeof (time_t) == 4 && time(nullptr) <= 0) << "Time to upgrade 32bit time_t!";
}
TEST(GncOptionDate, test_gnc_relative_date_to_time64)
{
GDate date;