stevedlawrence commented on a change in pull request #79: TDMLRunner explicit 
roundTrip="twoPass" feature.
URL: https://github.com/apache/incubator-daffodil/pull/79#discussion_r201311327
 
 

 ##########
 File path: 
daffodil-tdml/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
 ##########
 @@ -77,12 +77,43 @@ import org.apache.daffodil.api.DaffodilTunables
 import org.apache.daffodil.processors.charset.NBitsWidth_BitsCharset
 import org.apache.daffodil.processors.charset.NBitsWidth_BitsCharsetEncoder
 import java.nio.charset.{ Charset => JavaCharset }
+import java.io.OutputStream
 
 /**
  * Parses and runs tests expressed in IBM's contributed tdml "Test Data Markup 
Language"
  */
 
+sealed trait RoundTrip
+
+/**
+ * Test is just a parse test, or just an unparse, with no round trip involved.
+ */
+case object NoRoundTrip extends RoundTrip
+
+/**
+ * Test round trips simply. Unparse produces exactly the original data.
+ */
+case object SimpleRoundTrip extends RoundTrip
+
+/**
+ * Unparse doesn't produce original data, but equivalent canonical data which
+ * if reparsed in a second parse pass, produces the same infoset as the first
+ * parse.
+ */
+case object TwoPassRoundTrip extends RoundTrip
+
 private[tdml] object DFDLTestSuite {
+
+  /**
+   * Use to convert round trip default into enum value
+   */
+  def standardizeRoundTrip(enumStr: String): RoundTrip =
+    enumStr match {
+      case "false" | "none" => NoRoundTrip
+      case "true" | "simple" => SimpleRoundTrip
+      case "twoPass" => TwoPassRoundTrip
+    }
 
 Review comment:
   This feels like maybe it should be a companion object with an apply method 
that converts a string to one of those? Or perhaps something like in 
GeneratedCode that has builtin string to Enum values?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to