mbeckerle commented on a change in pull request #437:
URL: https://github.com/apache/incubator-daffodil/pull/437#discussion_r505890418



##########
File path: 
daffodil-core/src/test/scala/org/apache/daffodil/infoset/TestInfoset.scala
##########
@@ -74,12 +74,17 @@ object TestInfoset {
   }
 
   /**
-   * Returns the root element of the infoset, along with
-   * the schema compiler Root object for examining schema-compiler
-   * computations for unit testing them.
+   * Returns the root element of the infoset, along with the schema compiler
+   * Root object for examining schema-compiler computations for unit testing
+   * them. Because this assumes tests will be inspecting the internal infoset
+   * for correctness, it sets the releaseUnusedInfoset tunable to false so that
+   * the infoset elements are not freed
    */
   def testInfoset(testSchema: scala.xml.Elem, infosetAsXML: scala.xml.Elem): 
(DIElement, Root, DaffodilTunables) = {
-    val schemaCompiler = 
Compiler().withTunable("allowExternalPathExpressions", "true")
+    val schemaCompiler =
+      Compiler()
+        .withTunable("allowExternalPathExpressions", "true")
+        .withTunable("releaseUnneededInfoset", "false")

Review comment:
       Do we have specific tests for the unparser's release mechanism that set 
this to true, exercise unparsing, and verify that the infoset doesn't have 
specific children in it at the end? Seems to me without that sort of a test, we 
could break this and not know it. 
   
   At the end of unparsing, the infoset rooted in the initial UState should 
still be there, but all its children that aren't referenced in expressions 
should be gone. We need a test or a few to verify that things are dropped 
properly. 
   




----------------------------------------------------------------
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:
[email protected]


Reply via email to