~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to unittests/date_test.cc

tests for to_decimal methods
parameterized tests for more formats possible for from_strings, however they don't compile ATM so I commented them out

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "config.h"
22
22
 
23
23
#include <gtest/gtest.h>
 
24
#include <drizzled/decimal.h>
24
25
#include <drizzled/temporal.h>
25
26
#include <drizzled/temporal_format.h>
26
27
 
457
458
  EXPECT_EQ(9, months);
458
459
  EXPECT_EQ(9, days);
459
460
}
 
461
 
 
462
TEST_F(DateTest, to_decimal)
 
463
{
 
464
  drizzled::my_decimal to;
 
465
  Generator::DateGen::make_date(&date, 1987, 5, 6);
 
466
 
 
467
  date.to_decimal(&to);
 
468
 
 
469
  ASSERT_EQ(19870506, to.buf[0]);
 
470
}