mike-mcgann commented on code in PR #918:
URL: https://github.com/apache/daffodil/pull/918#discussion_r1081303267
##########
daffodil-test/src/test/resources/org/apache/daffodil/section12/lengthKind/ExplicitTests.tdml:
##########
@@ -903,4 +903,37 @@
</tdml:infoset>
</tdml:parserTestCase>
+<!--
+ Test Name: invalidLengthUnits_explicit
+ Schema: invalidLengthUnits_explicit
+ Root: r1
+ Purpose: This test checks that a warning is emitted when a bigint is
used when lengthUnits='bits'.
+-->
+ <tdml:defineSchema name="invalidLengthUnits_explicit">
+ <xs:include
schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:defineFormat name="Binary">
+ <dfdl:format ref="ex:GeneralFormat" representation="binary"/>
+ </dfdl:defineFormat>
+ <dfdl:format ref="ex:Binary" />
+
+ <xs:element name="r1" dfdl:lengthKind="explicit" type="xs:integer"
dfdl:lengthUnits="bits" dfdl:length="8"/>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="invalidLengthUnits_explicit" root="r1"
model="invalidLengthUnits_explicit"
+ description="">
+ <tdml:document>
+ <tdml:documentPart type="byte">
+ 0f
+ </tdml:documentPart>
+ </tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>f
+ <r1>15</r1>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ <tdml:warnings>
+ <tdml:warning>lengthUnits='bits' will only be supported for integer
types of 64 bits or less</tdml:warning>
Review Comment:
Updated message and warning check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]