TEST(TimeHelpersTest, DateToDaysForYear4000) { SQL_DATE_STRUCT data = {4000, 01, 02}; // expectation generated by http://www.convertunits.com/dates/from/Jan+1,+1970/to/Jan+2,+4000 std::int64_t expected = 741443; EXPECT_EQ(expected, date_to_days(reinterpret_cast<char const *>(&data))); }
TEST(TimeHelpersTest, DateToDaysForEpoch) { SQL_DATE_STRUCT data = {1970, 01, 01}; EXPECT_EQ(0, date_to_days(reinterpret_cast<char const *>(&data))); }