diff options
Diffstat (limited to 'slicer/db')
-rw-r--r-- | slicer/db/testInsert.cpp | 7 | ||||
-rw-r--r-- | slicer/db/testSelect.cpp | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/slicer/db/testInsert.cpp b/slicer/db/testInsert.cpp index 2068de3..e2118b8 100644 --- a/slicer/db/testInsert.cpp +++ b/slicer/db/testInsert.cpp @@ -144,14 +144,17 @@ BOOST_AUTO_TEST_CASE( insert_converted ) DB::SpecificTypesPtr st = new DB::SpecificTypes { {2015, 10, 16, 19, 12, 34}, {2015, 10, 16}, - {1, 2, 3, 4} + new DB::Timespan(1, 2, 3, 4) }; Slicer::SerializeAny<Slicer::SqlInsertSerializer>(st, db.get(), "converted"); auto sel = SelectPtr(db->newSelectCommand("SELECT * FROM converted")); auto st2 = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DB::SpecificTypesPtr>(*sel); BOOST_REQUIRE_EQUAL(st->date, st2->date); BOOST_REQUIRE_EQUAL(st->dt, st2->dt); - BOOST_REQUIRE_EQUAL(st->ts, st2->ts); + BOOST_REQUIRE_EQUAL(st->ts->days, st2->ts->days); + BOOST_REQUIRE_EQUAL(st->ts->hours, st2->ts->hours); + BOOST_REQUIRE_EQUAL(st->ts->minutes, st2->ts->minutes); + BOOST_REQUIRE_EQUAL(st->ts->seconds, st2->ts->seconds); } BOOST_AUTO_TEST_CASE( insert_unsupportedModel ) diff --git a/slicer/db/testSelect.cpp b/slicer/db/testSelect.cpp index afea1d3..b5664a1 100644 --- a/slicer/db/testSelect.cpp +++ b/slicer/db/testSelect.cpp @@ -141,10 +141,10 @@ BOOST_AUTO_TEST_CASE( select_inherit_datetime ) BOOST_REQUIRE_EQUAL(2015, bi->date.year); BOOST_REQUIRE_EQUAL(3, bi->date.month); BOOST_REQUIRE_EQUAL(27, bi->date.day); - BOOST_REQUIRE_EQUAL(1, bi->ts.days); - BOOST_REQUIRE_EQUAL(13, bi->ts.hours); - BOOST_REQUIRE_EQUAL(13, bi->ts.minutes); - BOOST_REQUIRE_EQUAL(12, bi->ts.seconds); + BOOST_REQUIRE_EQUAL(1, bi->ts->days); + BOOST_REQUIRE_EQUAL(13, bi->ts->hours); + BOOST_REQUIRE_EQUAL(13, bi->ts->minutes); + BOOST_REQUIRE_EQUAL(12, bi->ts->seconds); } template <typename T, typename ... P> |