mbeckerle commented on a change in pull request #83: Adding value of 'bcd' to 
binaryCalendarRep
URL: https://github.com/apache/incubator-daffodil/pull/83#discussion_r203414958
 
 

 ##########
 File path: 
daffodil-test/src/test/resources/org/apache/daffodil/section05/simple_types/SimpleTypes.tdml
 ##########
 @@ -2251,7 +2304,244 @@
     </tdml:errors>
   </tdml:parserTestCase>
 
-  <tdml:parserTestCase name="dateBin2" root="dateBin2"
+  <tdml:parserTestCase name="dateTimeBin20" root="dateTimeBin12"
+    model="SimpleTypes-binary" description="Section 5 Schema types-dateTime - 
DFDL-5-016R"
+    roundTrip="false">
+
+    <tdml:document>
+      <tdml:documentPart type="bits">00000000 00000000 00000000 
00111101</tdml:documentPart>
+    </tdml:document>
+    <tdml:errors>
+      <tdml:error>Schema Definition Error: Subset lengthKind='delimited' only 
supported for packed binary formats.</tdml:error>
+    </tdml:errors>
+  </tdml:parserTestCase>
+
+  <tdml:parserTestCase name="dateBinBCD" root="dateBinBCD"
+    model="SimpleTypes-binary" description="Section 5 Schema types-dateTime - 
DFDL-5-016R"
+    roundTrip="true">
+
+    <tdml:document>
+      <tdml:documentPart type="byte">12 14 23</tdml:documentPart>
+    </tdml:document>
+    <tdml:infoset>
+      <tdml:dfdlInfoset>
+        <dateBinBCD>2023-12-14</dateBinBCD>
+      </tdml:dfdlInfoset>
+    </tdml:infoset>
+  </tdml:parserTestCase>
+
+  <tdml:parserTestCase name="dateBinBCD2" root="dateBinBCD2"
+    model="SimpleTypes-binary" description="Section 5 Schema types-dateTime - 
DFDL-5-016R"
+    roundTrip="true">
+
+    <tdml:document>
+      <tdml:documentPart type="byte">12 14 20 23</tdml:documentPart>
+    </tdml:document>
+    <tdml:infoset>
+      <tdml:dfdlInfoset>
+        <dateBinBCD2>2023-12-14</dateBinBCD2>
+      </tdml:dfdlInfoset>
+    </tdml:infoset>
+  </tdml:parserTestCase>
+
+  <tdml:parserTestCase name="dateBinBCD3" root="dateBinBCD"
+    model="SimpleTypes-binary" description="Section 5 Schema types-dateTime - 
DFDL-5-016R"
+    roundTrip="false">
+
+    <tdml:document>
+      <tdml:documentPart type="byte">12 0F 23</tdml:documentPart>
+    </tdml:document>
+    <tdml:errors>
+      <tdml:error>Parse Error</tdml:error>
+      <tdml:error>Invalid low nibble</tdml:error>
+    </tdml:errors>
+  </tdml:parserTestCase>
+
+  <tdml:parserTestCase name="dateBinBCD4" root="dateBinBCD3"
+    model="SimpleTypes-binary" description="Section 5 Schema types-dateTime - 
DFDL-5-016R"
+    roundTrip="false">
+
+    <tdml:document>
+      <tdml:documentPart type="byte">08 17 48</tdml:documentPart>
+    </tdml:document>
+    <tdml:errors>
+      <tdml:error>Schema Definition Error</tdml:error>
+      <tdml:error>Character '-' not allowed in dfdl:calendarPattern for 
xs:date with a binaryCalendarRep of 'bcd'</tdml:error>
+    </tdml:errors>
+  </tdml:parserTestCase>
+
+  <tdml:parserTestCase name="dateBinBCD5" root="dateBinBCD4"
+    model="SimpleTypes-binary" description="Section 5 Schema types-dateTime - 
DFDL-5-016R"
+    roundTrip="false">
+
+    <tdml:document>
+      <tdml:documentPart type="bits">0000000</tdml:documentPart>
+    </tdml:document>
+    <tdml:errors>
+      <tdml:error>Schema Definition Error</tdml:error>
+      <tdml:error>The given length (7 bits) must be a multiple of 4 when using 
binaryCalendarRep='bcd'</tdml:error>
+    </tdml:errors>
+  </tdml:parserTestCase>
+
+  <tdml:parserTestCase name="dateBinBCD6" root="dateBinBCD"
+    model="SimpleTypes-binary" description="Section 5 Schema types-dateTime - 
DFDL-5-016R"
+    roundTrip="true">
+
+    <tdml:document>
+      <tdml:documentPart type="bits">0001 0010 0010 0111 1001 
1001</tdml:documentPart>
+    </tdml:document>
+    <tdml:infoset>
+      <tdml:dfdlInfoset>
+        <dateBinBCD>1999-12-27</dateBinBCD>
+      </tdml:dfdlInfoset>
+    </tdml:infoset>
+  </tdml:parserTestCase>
+
+  <tdml:parserTestCase name="timeBinBCD" root="timeBinBCD"
+    model="SimpleTypes-binary" description="Section 5 Schema types-dateTime - 
DFDL-5-016R"
+    roundTrip="true">
+
+    <tdml:document>
+      <tdml:documentPart type="byte">18 56 03</tdml:documentPart>
+    </tdml:document>
+    <tdml:infoset>
+      <tdml:dfdlInfoset>
+        <timeBinBCD>18:56:03.000000</timeBinBCD>
+      </tdml:dfdlInfoset>
+    </tdml:infoset>
+  </tdml:parserTestCase>
+
+  <tdml:parserTestCase name="timeBinBCD2" root="timeBinBCD2"
+    model="SimpleTypes-binary" description="Section 5 Schema types-dateTime - 
DFDL-5-016R"
+    roundTrip="twoPass">
+
+    <tdml:document>
+      <tdml:documentPart type="byte">01 45 00 99 87</tdml:documentPart>
+    </tdml:document>
+    <tdml:infoset>
+      <tdml:dfdlInfoset>
+        <timeBinBCD2>01:45:00.998000</timeBinBCD2>
+      </tdml:dfdlInfoset>
+    </tdml:infoset>
+  </tdml:parserTestCase>
+
+  <tdml:parserTestCase name="timeBinBCD3" root="timeBinBCD3"
+    model="SimpleTypes-binary" description="Section 5 Schema types-dateTime - 
DFDL-5-016R"
+    roundTrip="false">
 
 Review comment:
   Note that negative tests need not state a round-trip status, as they are 
never attempted for round tripping. Only positive tests are round tripped.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to