MCPcopy Create free account
hub / github.com/apache/impala / ValidateTimestamp

Function ValidateTimestamp

be/src/runtime/timestamp-test.cc:147–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145};
146
147inline void ValidateTimestamp(TimestampValue& tv, string& fmt, string& val,
148 string& fmt_val, int year, int month, int day, int hours, int mins, int secs,
149 int frac) {
150 boost::gregorian::date not_a_date;
151 boost::gregorian::date cust_date = tv.date();
152 boost::posix_time::time_duration cust_time = tv.time();
153 EXPECT_NE(not_a_date, cust_date) << fmt_val;
154 EXPECT_NE(not_a_date_time, cust_time) << fmt_val;
155 EXPECT_EQ(year, cust_date.year()) << fmt_val;
156 EXPECT_EQ(month, cust_date.month()) << fmt_val;
157 EXPECT_EQ(day, cust_date.day()) << fmt_val;
158 EXPECT_EQ(hours, cust_time.hours()) << fmt_val;
159 EXPECT_EQ(mins, cust_time.minutes()) << fmt_val;
160 EXPECT_EQ(secs, cust_time.seconds()) << fmt_val;
161 EXPECT_EQ(frac, cust_time.fractional_seconds()) << fmt_val;
162}
163
164// This function will generate all permutations of tokens to test that the parsing and
165// formatting is correct (position of tokens should be irrelevant). Note that separators

Callers 1

TestTimestampTokensFunction · 0.85

Calls 3

yearMethod · 0.80
monthMethod · 0.80
dayMethod · 0.80

Tested by

no test coverage detected