You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/11/08 19:18:28 UTC

[GitHub] [daffodil] tuxji commented on a change in pull request #676: Rename runtime2 test files and make runtime2 tests round-trip

tuxji commented on a change in pull request #676:
URL: https://github.com/apache/daffodil/pull/676#discussion_r745005309



##########
File path: daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums.dat.xml.runtime2.error
##########
@@ -20,7 +20,7 @@
   <array>
     <be_bool16>false</be_bool16>
     <be_bool16>true</be_bool16>

Review comment:
       I agree that some editors will get confused about file extensions ending with .runtime1, etc.  My next commit will rename these files again.

##########
File path: daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums.tdml
##########
@@ -37,62 +37,69 @@
   </tdml:defineConfig>
 
   <tdml:parserTestCase
-    name="ex_nums_parse_runtime1"
     model="ex_nums.dfdl.xsd"
+    name="ex_nums_runtime1"
     config="config-runtime1">
     <tdml:document>
-      <tdml:documentPart type="file">ex_nums_parse.dat</tdml:documentPart>
+      <tdml:documentPart type="file">ex_nums.dat</tdml:documentPart>
     </tdml:document>
     <tdml:infoset>
-      <tdml:dfdlInfoset type="file">ex_nums_unparse_runtime1.xml</tdml:dfdlInfoset>
+      <tdml:dfdlInfoset type="file">ex_nums.dat.xml.runtime1</tdml:dfdlInfoset>

Review comment:
       Yes, runtime1 and runtime2 have different infosets because Java code and C code will format floating point numbers closely but not exactly the same as each other.  We would need to either make Java and C format floats exactly the same (very difficult) or make TDMLRunner compare floats semantically, not syntactically ([DAFFODIL-2402](https://issues.apache.org/jira/browse/DAFFODIL-2402)).

##########
File path: daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums.tdml
##########
@@ -37,62 +37,69 @@
   </tdml:defineConfig>
 
   <tdml:parserTestCase
-    name="ex_nums_parse_runtime1"
     model="ex_nums.dfdl.xsd"
+    name="ex_nums_runtime1"
     config="config-runtime1">
     <tdml:document>
-      <tdml:documentPart type="file">ex_nums_parse.dat</tdml:documentPart>
+      <tdml:documentPart type="file">ex_nums.dat</tdml:documentPart>
     </tdml:document>
     <tdml:infoset>
-      <tdml:dfdlInfoset type="file">ex_nums_unparse_runtime1.xml</tdml:dfdlInfoset>
+      <tdml:dfdlInfoset type="file">ex_nums.dat.xml.runtime1</tdml:dfdlInfoset>
     </tdml:infoset>
   </tdml:parserTestCase>
 
-  <tdml:unparserTestCase
-    name="ex_nums_unparse_runtime1"
-    model="ex_nums.dfdl.xsd"
-    config="config-runtime1">
-    <tdml:infoset>
-      <tdml:dfdlInfoset type="file">ex_nums_unparse_runtime1.xml</tdml:dfdlInfoset>
-    </tdml:infoset>
-    <tdml:document>
-      <tdml:documentPart type="file">ex_nums_parse.dat</tdml:documentPart>
-    </tdml:document>
-  </tdml:unparserTestCase>
-
   <tdml:parserTestCase
-    name="ex_nums_parse_runtime2"
     model="ex_nums.dfdl.xsd"
+    name="ex_nums_runtime2"
     config="config-runtime2">
     <tdml:document>
-      <tdml:documentPart type="file">ex_nums_parse.dat</tdml:documentPart>
+      <tdml:documentPart type="file">ex_nums.dat</tdml:documentPart>
     </tdml:document>
     <tdml:infoset>
-      <tdml:dfdlInfoset type="file">ex_nums_unparse_runtime2.xml</tdml:dfdlInfoset>
+      <tdml:dfdlInfoset type="file">ex_nums.dat.xml.runtime2</tdml:dfdlInfoset>
     </tdml:infoset>
   </tdml:parserTestCase>
 
   <tdml:unparserTestCase
-    name="ex_nums_unparse_runtime2"
-    model="ex_nums.dfdl.xsd"
-    config="config-runtime2">
-    <tdml:infoset>
-      <tdml:dfdlInfoset type="file">ex_nums_unparse_runtime2.xml</tdml:dfdlInfoset>
-    </tdml:infoset>
-    <tdml:document>
-      <tdml:documentPart type="file">ex_nums_parse.dat</tdml:documentPart>
-    </tdml:document>
-  </tdml:unparserTestCase>
-
-  <tdml:unparserTestCase
-    name="ex_nums_unparse_errors"
     model="ex_nums.dfdl.xsd"
+    name="ex_nums_runtime2_error"
     config="config-runtime2">
     <tdml:infoset>
-      <tdml:dfdlInfoset type="file">ex_nums_unparse_errors.xml</tdml:dfdlInfoset>
+      <tdml:dfdlInfoset type="file">ex_nums.dat.xml.runtime2.error</tdml:dfdlInfoset>
     </tdml:infoset>
     <tdml:errors>
       <tdml:error>value</tdml:error>
+      <tdml:error>boolean_false</tdml:error>

Review comment:
       This is an `unparseTestCase`, not a `parseTestCase`, so that's why it has both an infoset and errors.  However, I've managed to make Runtime2DataProcessor return validation errors and change this test to a parse test case with a document, an infoset, and validation errors.  (I found out the hard way that an `unparseTestCase` isn't allowed to contain validation errors, unlike a `parseTestCase`.)  My next commit will have these changes.




-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org