stevedlawrence commented on code in PR #1192: URL: https://github.com/apache/daffodil/pull/1192#discussion_r1539727486
########## daffodil-test/src/test/resources/org/apache/daffodil/section02/validation_errors/Validation.tdml: ########## @@ -1921,7 +2019,139 @@ </tdml:parserTestCase> - <tdml:parserTestCase name="floatExclusiveValid" + <tdml:parserTestCase name="validation_inputValueCalc_04" + root="e2_3" model="inputValueCalc" + description="Section 17 - the value created using inputValueCalc is validated using minLength/maxLength facets" + validation="limited"> + + <tdml:document></tdml:document> + + <tdml:infoset> + <tdml:dfdlInfoset> + <e2_3>string</e2_3> + </tdml:dfdlInfoset> + </tdml:infoset> + + <tdml:validationErrors> + <tdml:error>Validation Error</tdml:error> + <tdml:error>failed facet checks due to: facet minLength (7)</tdml:error> + </tdml:validationErrors> + + </tdml:parserTestCase> + + <tdml:parserTestCase name="validation_inputValueCalc_05" + root="e2_4" model="inputValueCalc" + description="Section 17 - the value created using inputValueCalc is validated using length facets" + validation="limited"> + + <tdml:document></tdml:document> + + <tdml:infoset> + <tdml:dfdlInfoset> + <e2_4>string</e2_4> + </tdml:dfdlInfoset> + </tdml:infoset> + + <tdml:validationErrors> + <tdml:error>Validation Error</tdml:error> + <tdml:error>failed facet checks due to: facet length (7)</tdml:error> + </tdml:validationErrors> + + </tdml:parserTestCase> + + <tdml:parserTestCase name="validation_inputValueCalc_06" + root="e2_3" model="inputValueCalc" + description="Section 17 - the value created using inputValueCalc is validated using minLength/maxLength facets" + validation="on"> + + <tdml:document></tdml:document> + + <tdml:infoset> + <tdml:dfdlInfoset> + <e2_3>string</e2_3> + </tdml:dfdlInfoset> + </tdml:infoset> + + <tdml:validationErrors> + <tdml:error>Validation Error</tdml:error> + <tdml:error>failed facet checks due to: facet minLength (7)</tdml:error> + </tdml:validationErrors> + + </tdml:parserTestCase> + + <tdml:parserTestCase name="validation_inputValueCalc_07" + root="e2_4" model="inputValueCalc" + description="Section 17 - the value created using inputValueCalc is validated using length facets" + validation="on"> + + <tdml:document></tdml:document> + + <tdml:infoset> + <tdml:dfdlInfoset> + <e2_4>string</e2_4> + </tdml:dfdlInfoset> + </tdml:infoset> + + <tdml:validationErrors> + <tdml:error>Validation Error</tdml:error> + <tdml:error>failed facet checks due to: facet length (7)</tdml:error> + </tdml:validationErrors> + + </tdml:parserTestCase> + + <tdml:defineSchema name="TestFacets2"> + <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/> + <dfdl:format ref="ex:GeneralFormat" /> + <xs:element name="e2_5" dfdl:lengthKind="delimited" dfdl:encoding="ISO-8859-1"> + <xs:simpleType> + <xs:restriction base="xs:hexBinary"> + <xs:length value="7"/> + <xs:minLength value="7"/> + <xs:maxLength value="7"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + </tdml:defineSchema> + + <tdml:parserTestCase name="validation_testFacets2_01" + root="e2_5" model="TestFacets2" + description="checks that length cannot be used with min/maxLength" + validation="limited"> + + <tdml:document> + <tdml:documentPart type="byte">deadbeef</tdml:documentPart> + </tdml:document> + + <!-- this is a Xerces Error --> Review Comment: I think this comes from validating the DFDL schema, not the infoset. So limited/on/full doesn't affect this. The Java and Scala API's don't allow turning off validating the DFDL schema. It can be disabled using the internal ProcessorFactory: https://github.com/apache/daffodil/blob/main/daffodil-core/src/main/scala/org/apache/daffodil/core/compiler/Compiler.scala#L64 I *think* the TDML runner can also disable validating dfdl schemas, but that's only done in special cases I think. -- 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]
