diff options
-rw-r--r-- | slicer/test/initial/optionals-areset.xml | 4 | ||||
-rw-r--r-- | slicer/test/initial/optionals-areset2.json | 2 | ||||
-rw-r--r-- | slicer/test/optionals.ice | 2 | ||||
-rw-r--r-- | slicer/test/serializers.cpp | 14 |
4 files changed, 15 insertions, 7 deletions
diff --git a/slicer/test/initial/optionals-areset.xml b/slicer/test/initial/optionals-areset.xml index aa2a97a..54cf855 100644 --- a/slicer/test/initial/optionals-areset.xml +++ b/slicer/test/initial/optionals-areset.xml @@ -6,8 +6,8 @@ <b>2</b> </optStruct> <optClass> - <a>1</a> - <b>2</b> + <dt>2017-Sep-07 20:40:30</dt> + <date>2017-09-07</date> </optClass> <optSeq> <element> diff --git a/slicer/test/initial/optionals-areset2.json b/slicer/test/initial/optionals-areset2.json index 44cf536..5636b57 100644 --- a/slicer/test/initial/optionals-areset2.json +++ b/slicer/test/initial/optionals-areset2.json @@ -1 +1 @@ -{"optClass":{"a":1,"b":2},"optDict":[{"key":10,"value":{"a":11,"b":12}},{"key":13,"value":{"a":14,"b":15}}],"optSeq":[{"a":3,"b":4},{"a":5,"b":6}],"optSimple":4,"optStruct":{"a":1,"b":2}} +{"optClass":{"date":"2017-09-07","dt":"2017-Sep-07 20:40:30"},"optDict":[{"key":10,"value":{"a":11,"b":12}},{"key":13,"value":{"a":14,"b":15}}],"optSeq":[{"a":3,"b":4},{"a":5,"b":6}],"optSimple":4,"optStruct":{"a":1,"b":2}} diff --git a/slicer/test/optionals.ice b/slicer/test/optionals.ice index 720e7c3..d037e67 100644 --- a/slicer/test/optionals.ice +++ b/slicer/test/optionals.ice @@ -9,7 +9,7 @@ module TestModule { class Optionals { optional(0) int optSimple; optional(1) StructType optStruct; - optional(2) ClassType optClass; + optional(2) DateTimeContainer optClass; optional(3) Classes optSeq; optional(4) ClassMap optDict; [ "slicer:conversion:boost.posix_time.ptime:boost.posix_time.to_iso_extended_string:boost.posix_time.time_from_string:nodeclare" ] diff --git a/slicer/test/serializers.cpp b/slicer/test/serializers.cpp index 1fbceb8..cfbe794 100644 --- a/slicer/test/serializers.cpp +++ b/slicer/test/serializers.cpp @@ -181,8 +181,16 @@ checkOptionals_areset(const TestModule::OptionalsPtr & opts) BOOST_REQUIRE_EQUAL(opts->optStruct->a, 1); BOOST_REQUIRE_EQUAL(opts->optStruct->b, 2); BOOST_REQUIRE(opts->optClass); - BOOST_REQUIRE_EQUAL((*opts->optClass)->a, 1); - BOOST_REQUIRE_EQUAL((*opts->optClass)->b, 2); + BOOST_REQUIRE(*opts->optClass); + BOOST_REQUIRE_EQUAL((*opts->optClass)->dt.year, 2017); + BOOST_REQUIRE_EQUAL((*opts->optClass)->dt.month, 9); + BOOST_REQUIRE_EQUAL((*opts->optClass)->dt.day, 7); + BOOST_REQUIRE_EQUAL((*opts->optClass)->dt.hour, 20); + BOOST_REQUIRE_EQUAL((*opts->optClass)->dt.minute, 40); + BOOST_REQUIRE_EQUAL((*opts->optClass)->dt.second, 30); + BOOST_REQUIRE_EQUAL((*opts->optClass)->date.year, 2017); + BOOST_REQUIRE_EQUAL((*opts->optClass)->date.month, 9); + BOOST_REQUIRE_EQUAL((*opts->optClass)->date.day, 7); BOOST_REQUIRE_EQUAL(opts->optSeq->size(), 2); BOOST_REQUIRE_EQUAL((*opts->optSeq)[0]->a, 3); BOOST_REQUIRE_EQUAL((*opts->optSeq)[0]->b, 4); @@ -604,6 +612,6 @@ BOOST_AUTO_TEST_SUITE_END(); BOOST_AUTO_TEST_CASE( customerModelPartCounters ) { - BOOST_REQUIRE_EQUAL(27, TestModule::completions); + BOOST_REQUIRE_EQUAL(21, TestModule::completions); } |