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



##########
File path: 
daffodil-runtime2/src/test/resources/org/apache/daffodil/runtime2/ex_nums.dfdl.xsd
##########
@@ -23,26 +23,24 @@
         xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/";
         xmlns:xs="http://www.w3.org/2001/XMLSchema";>
 
-    <xs:include 
schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+    <!-- Representation property bindings -->
 
+    <xs:include 
schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
     <xs:annotation>
         <xs:appinfo source="http://www.ogf.org/dfdl/";>
             <dfdl:format
-                    alignment="1"
-                    alignmentUnits="bits"

Review comment:
       I wanted to remove all unneeded DFDL property definitions and this data 
format doesn't have any explicit alignment properties so I figured there was no 
need to override alignmentUnits as well as lengthUnits.  I believe Daffodil 
doesn't performs any alignment (even implicitly) in data formats that use 
alignment="1" from DFDLGeneralFormat.dfdl.xsd.

##########
File path: 
daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/Runtime2DataProcessor.scala
##########
@@ -89,13 +92,25 @@ class Runtime2DataProcessor(executableFile: os.Path) 
extends DFDL.DataProcessorB
       os.write(infile, input)
       val result = os.proc(executableFile, "-o", outfile, "parse", 
infile).call(cwd = tempDir, stderr = os.Pipe)
       if (result.out.text.isEmpty && result.err.text.isEmpty) {
-        val parseResult = new ParseResult(outfile, Success, infile)
+        val parseResult = new ParseResult(infile, outfile, Success)
         parseResult
       } else {
-        val msg = s"Unexpected daffodil output on stdout: ${result.out.text} 
on stderr: ${result.err.text}"
-        val parseError = new ParseError(Nope, Nope, Nope, Maybe(msg))
-        val parseResult = new ParseResult(outfile, Failure(parseError), infile)
-        parseResult.addDiagnostic(parseError)
+        val validationWarnings = if (result.out.text.isEmpty) {
+          Seq.empty
+        } else {
+          val warning = new ValidationWarning { override def getMessage: 
String = result.out.text }
+          Seq(warning)
+        }
+        val validationFailures = if (result.err.text.isEmpty) {
+          Seq.empty

Review comment:
       The ordinary path taken when there are no validation failures is 
actually higher up on lines 95-96.  However, my next commit will remove the if 
statements and simplify the parse validation error code to prevent these code 
coverage warnings.

##########
File path: 
daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/Runtime2TDMLDFDLProcessor.scala
##########
@@ -140,13 +139,11 @@ final class Runtime2TDMLDFDLProcessorFactory private(
  * TDML XML Infosets, feeding to the unparser, creating XML from the result 
created by
  * the Runtime2DataProcessor. All the "real work" is done by 
Runtime2DataProcessor.
  */
-class Runtime2TDMLDFDLProcessor(tempDir: os.Path, executable: os.Path,
-                                var diagnostics: Seq[Diagnostic]) extends 
TDMLDFDLProcessor {
+class Runtime2TDMLDFDLProcessor(tempDir: os.Path, executable: os.Path) extends 
TDMLDFDLProcessor {

Review comment:
       My next commit will move the extends clause to the next line.




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