Skip to content

Commit

Permalink
keep the original test
Browse files Browse the repository at this point in the history
  • Loading branch information
NEUpanning committed May 17, 2024
1 parent fa05922 commit 225d1f2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions velox/functions/sparksql/tests/DateTimeFunctionsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,15 @@ TEST_F(DateTimeFunctionsTest, fromUnixtime) {
fromUnixTime(getUnixTime("2020-06-30 23:59:59"), "yyyy-MM-dd HH:mm:ss"),
"2020-06-30 23:59:59");

// In debug mode, Timestamp constructor will throw exception if range check
// fails.
#ifdef NDEBUG
// Integer overflow in the internal conversion from seconds to milliseconds.
EXPECT_EQ(
fromUnixTime(std::numeric_limits<int64_t>::max(), "yyyy-MM-dd HH:mm:ss"),
"1969-12-31 23:59:59");
#endif

// 8 hours ahead UTC.
setQueryTimeZone("Asia/Shanghai");
// In debug mode, Timestamp constructor will throw exception if range check
Expand Down

0 comments on commit 225d1f2

Please sign in to comment.