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 2020/09/02 14:26:05 UTC

[GitHub] [incubator-daffodil] stevedlawrence commented on a change in pull request #410: Stream infoset events while parsing and reduce memory usage

stevedlawrence commented on a change in pull request #410:
URL: https://github.com/apache/incubator-daffodil/pull/410#discussion_r482111277



##########
File path: daffodil-core/src/test/scala/org/apache/daffodil/dsom/TestSimpleTypeUnions.scala
##########
@@ -51,7 +51,18 @@ class TestSimpleTypeUnions {
     <xs:simpleType name="oneOrTwo">
       <xs:union memberTypes="ex:int1Type ex:int2Type"/>
     </xs:simpleType>
-    <xs:element name="e1" dfdl:lengthKind="delimited" type="ex:oneOrTwo"/>)
+    <xs:element name="e1" dfdl:lengthKind="delimited" type="ex:oneOrTwo">
+      <xs:annotation>
+        <xs:appinfo source="http://www.ogf.org/dfdl/">
+          <!--
+            this assert always passes, but uses e1 in an expression to prevent
+            the InfosetWalker from freeing it, which allows the tests to
+            inspect runtime internals
+          -->
+          <dfdl:assert test="{ fn:true() or /ex:e1 eq 0 }" />

Review comment:
       The comment above attempts to explain why, but maybe it needs to be more clear. The below tests inspect the infoset that is generated from parsing data with this schema. With the new changes, by the time the parse is complete the infoset has been free and so there is nothing to inspect. By using ``/ex:e1`` in an expression we don't free the e1 element so the tests can do the inspection.
   
   We could try to update the test to test for something different, but it didn't seem obvious to me on how to do it. Maybe I should just upate the comment to be more clear?




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

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