You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by mb...@apache.org on 2018/08/15 12:59:32 UTC

[incubator-daffodil] 02/02: Review comments/fixes incorporated.

This is an automated email from the ASF dual-hosted git repository.

mbeckerle pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-daffodil.git

commit 39c500e1361953447747cfaf72a502513771266b
Author: Michael Beckerle <mb...@tresys.com>
AuthorDate: Tue Aug 14 15:52:39 2018 -0400

    Review comments/fixes incorporated.
---
 .../unparsers/SequenceChildUnparsers.scala         |  1 -
 .../TestArrayOptionalElem.scala                    |  6 +++
 .../TestArrayOptionalElemNew.scala                 | 45 ----------------------
 3 files changed, 6 insertions(+), 46 deletions(-)

diff --git a/daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/SequenceChildUnparsers.scala b/daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/SequenceChildUnparsers.scala
index 5a7cf0a..0583a96 100644
--- a/daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/SequenceChildUnparsers.scala
+++ b/daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/SequenceChildUnparsers.scala
@@ -254,7 +254,6 @@ abstract class RepeatingChildUnparser(
     //
     val ock = erd.maybeOccursCountKind.get
     // System.err.println("Checking for events consistent with Array index:\n ==> Array Index Stack is:" + state.arrayIndexStack)
-    // val arrPos = state.arrayPos - 1 // because we advance after each unparse so this is the position of the next (non-existing) occurrence
 
     Assert.invariant(arrPos <= maxReps || !(ock eq Implicit))
 
diff --git a/daffodil-test/src/test/scala/org/apache/daffodil/section16/array_optional_elem/TestArrayOptionalElem.scala b/daffodil-test/src/test/scala/org/apache/daffodil/section16/array_optional_elem/TestArrayOptionalElem.scala
index b965dbd..de4a50f 100644
--- a/daffodil-test/src/test/scala/org/apache/daffodil/section16/array_optional_elem/TestArrayOptionalElem.scala
+++ b/daffodil-test/src/test/scala/org/apache/daffodil/section16/array_optional_elem/TestArrayOptionalElem.scala
@@ -30,12 +30,14 @@ object TestArrayOptionalElem {
   val runner01 = Runner(testDir01, "Facets.tdml", validateTDMLFile = false)
   val runner1 = Runner(testDir1, "dpaext2.tdml")
   val rBack = Runner(testDir, "backtracking.tdml")
+  val runnerAC = Runner(testDir, "ArrayComb.tdml")
 
   @AfterClass def shutDown {
     runner.reset
     runner01.reset
     runner1.reset
     rBack.reset
+    runnerAC.reset
   }
 
 }
@@ -44,6 +46,10 @@ class TestArrayOptionalElem {
 
   import TestArrayOptionalElem._
 
+  // DAFFODIL-1964
+  @Test def test_arrayComb1() = { runnerAC.runOneTest("arrayComb1") }
+  @Test def test_arrayComb2() = { runnerAC.runOneTest("arrayComb2") }
+
   @Test def test_arrayExpressions01() { runner.runOneTest("arrayExpressions01") }
   @Test def test_arrayExpressions02() { runner.runOneTest("arrayExpressions02") }
   @Test def test_arrayExpressions02b() { runner.runOneTest("arrayExpressions02b") }
diff --git a/daffodil-test/src/test/scala/org/apache/daffodil/section16/array_optional_elem/TestArrayOptionalElemNew.scala b/daffodil-test/src/test/scala/org/apache/daffodil/section16/array_optional_elem/TestArrayOptionalElemNew.scala
deleted file mode 100644
index edb996a..0000000
--- a/daffodil-test/src/test/scala/org/apache/daffodil/section16/array_optional_elem/TestArrayOptionalElemNew.scala
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.daffodil.section16.array_optional_elem
-
-import org.apache.daffodil.util._
-import org.apache.daffodil.tdml.Runner
-import org.junit.AfterClass
-import org.junit.Test
-
-object TestArrayOptionalElemNew {
-
-  val testDir = "/org/apache/daffodil/section16/array_optional_elem/"
-
-  var runner = Runner(testDir, "ArrayComb.tdml")
-
-  /**
-   * Avoid memory leak of adding more and more test suites to static objects as we run more and more test suites.
-   */
-  @AfterClass def tearDown() {
-    runner.reset
-  }
-
-}
-
-class TestArrayOptionalElemNew {
-  import TestArrayOptionalElemNew._
-
-  @Test def test_arrayComb1() = { runner.runOneTest("arrayComb1") }
-  @Test def test_arrayComb2() = { runner.runOneTest("arrayComb2") }
-}