mbeckerle commented on code in PR #917:
URL: https://github.com/apache/daffodil/pull/917#discussion_r1073998187


##########
daffodil-test/src/test/resources/org/apache/daffodil/extensions/type_calc/inputTypeCalc.tdml:
##########
@@ -321,4 +321,21 @@
     </tdml:infoset>
   </tdml:parserTestCase>
 
+  <tdml:parserTestCase name="valueNotFound"
+    root="root" model="inputTypeCalc-Inherited.dfdl.xsd"
+    description="Demonstrates a case where the provided value doesn't match 
any value in the enumeration">
+
+    <tdml:document>
+    <tdml:documentPart type="byte">
+    00 00 00 03
+    </tdml:documentPart>
+    </tdml:document>
+    <tdml:errors>
+      <tdml:error>Value</tdml:error>
+      <tdml:error>3</tdml:error>
+      <tdml:error>not found</tdml:error>
+      <tdml:error>enumeration</tdml:error>

Review Comment:
   This should be mentioning "repValues" in the errors also. 



##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/TypeCalculator.scala:
##########
@@ -153,7 +153,7 @@ class KeysetValueTypeCalculatorOrdered(valueMap: 
HashMap[DataValuePrimitive, Dat
       })
       ans1 match {
         case None => {
-          (DataValue.NoValue, One(s"Key ${x} not found in keyset-value 
mapping"))
+          (DataValue.NoValue, One(s"Key ${x} not found in enumeration 
key-value mapping"))

Review Comment:
   I would not even use the term "key" here. 
   
   Parsing we're looking for the repValue of the enumeration.  So like "The 
value '993' was not found in any dfdlx:repValues for the enumeration type."
   
   Unparsing we're looking for the enumeration value (to determine the 
corresponding repValue).  So like "The enumeration value 'xyzzy' was not 
defined."



##########
daffodil-test/src/test/resources/org/apache/daffodil/extensions/type_calc/inputTypeCalc.tdml:
##########
@@ -321,4 +321,21 @@
     </tdml:infoset>
   </tdml:parserTestCase>
 
+  <tdml:parserTestCase name="valueNotFound"

Review Comment:
   unparser test case also needed. 



-- 
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]

Reply via email to