332
332
ASSERT_FALSE(result);
335
TEST_F(DateTest, from_int32_t_onValueCreatedBy_to_int32_t_shouldProduceOriginalDate)
337
uint32_t years= 2030, months= 8, days= 17;
338
Generator::DateGen::make_date(&date, years, months, days);
339
uint32_t decoded_years, decoded_months, decoded_days;
335
TEST_F(DateTest, to_int64_t)
337
Generator::DateGen::make_date(&date, 2030, 8, 17);
338
int64_t representation;
340
date.to_int64_t(&representation);
342
ASSERT_EQ(20300817, representation);
345
TEST_F(DateTest, to_int32_t)
347
Generator::DateGen::make_date(&date, 2030, 8, 17);
340
348
int32_t representation;
343
350
date.to_int32_t(&representation);
344
decoded_date.from_int32_t(representation);
346
decoded_years= decoded_date.years();
347
decoded_months= decoded_date.months();
348
decoded_days= decoded_date.days();
350
EXPECT_EQ(years, decoded_years);
351
EXPECT_EQ(months, decoded_months);
352
EXPECT_EQ(days, decoded_days);
352
ASSERT_EQ(20300817, representation);
355
TEST_F(DateTest, from_int32_t_shouldPopulateDateCorrectly)
357
uint32_t decoded_years, decoded_months, decoded_days;
359
date.from_int32_t(20300817);
361
decoded_years= date.years();
362
decoded_months= date.months();
363
decoded_days= date.days();
365
EXPECT_EQ(2030, decoded_years);
366
EXPECT_EQ(8, decoded_months);
367
EXPECT_EQ(17, decoded_days);
355
370
TEST_F(DateTest, to_julian_day_number)