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

Method Run

be/src/runtime/date-test.cc:493–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491 }
492
493 void Run(int id, const TimestampValue& now) const {
494 DateTimeFormatContext dt_ctx(fmt);
495 dt_ctx.SetCenturyBreakAndCurrentTime(now);
496
497 stringstream desc;
498 desc << "DateFormatTC [" << id << "]: " << "days_since_epoch:" << days_since_epoch
499 << " fmt:" << fmt << " str:" << str;
500
501 ASSERT_TRUE(SimpleDateFormatTokenizer::Tokenize(&dt_ctx, PARSE, false)) << desc.str();
502
503 const DateValue cust_dv(days_since_epoch);
504 EXPECT_TRUE(cust_dv.IsValid()) << desc.str();
505 EXPECT_GE(dt_ctx.fmt_out_len, dt_ctx.fmt_len) << desc.str();
506
507 string buff = cust_dv.Format(dt_ctx);
508 EXPECT_TRUE(!buff.empty()) << desc.str();
509 EXPECT_LE(buff.length(), dt_ctx.fmt_out_len) << desc.str();
510 EXPECT_EQ(buff, string(str, strlen(str))) << desc.str();
511 }
512
513};
514

Callers

nothing calls this directly

Calls 6

strMethod · 0.45
IsValidMethod · 0.45
FormatMethod · 0.45
emptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected