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
The following commit(s) were added to refs/heads/master by this push:
new 1a9567c Added tests that illustrate DAFFODIL-2069 bug.
1a9567c is described below
commit 1a9567cff34804bab6ab0f6e4174eaa101ce4b7c
Author: Michael Beckerle <[email protected]>
AuthorDate: Tue Feb 19 19:27:46 2019 -0500
Added tests that illustrate DAFFODIL-2069 bug.
DAFFODIL-2069
---
.../calc_value_properties/outputValueCalc3.tdml | 149 +++++++++++++++++++++
.../TestOutputValueCalc.scala | 7 +
2 files changed, 156 insertions(+)
diff --git
a/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc3.tdml
b/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc3.tdml
new file mode 100644
index 0000000..301c11c
--- /dev/null
+++
b/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc3.tdml
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<tdml:testSuite suiteName="outputValueCalc_bitOrder_interactions"
+ description="Tests interactions of bitOrder with hexBinary and
outputValueCalc"
+ xmlns:tns="http://example.com"
+ xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:fn="http://www.w3.org/2005/xpath-functions"
+ xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext"
+ xmlns:ex="http://example.com"
+ defaultRoundTrip="true"
+ defaultValidation="on">
+
+ <tdml:defineSchema name="s" elementFormDefault="unqualified">
+
+ <xs:include
schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
+
+ <dfdl:format ref="ex:GeneralFormatPortable" sequenceKind='ordered'
initiator=""
+ terminator="" separator="" initiatedContent='no' leadingSkip='0'
trailingSkip='0'
+ textStringPadCharacter='%SP;' lengthUnits="bits" alignment="1"
alignmentUnits="bits"
+ representation="binary" encoding="ASCII" binaryNumberRep="binary"
byteOrder="littleEndian"
+ bitOrder="leastSignificantBitFirst" encodingErrorPolicy="replace"
outputNewLine="%LF;"
+ textOutputMinLength="0" />
+
+ <xs:element name="rHexBinary">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:sequence>
+ <xs:element name="len" type="xs:unsignedInt" dfdl:length="8"
+ dfdl:lengthKind="explicit" dfdl:outputValueCalc="{
dfdl:valueLength(../value, 'bytes') }" />
+ <xs:element name="value" type="xs:hexBinary" dfdl:length="{ ../len
}"
+ dfdl:lengthUnits="bytes" dfdl:lengthKind="explicit"
dfdl:alignmentUnits="bytes"/>
+ </xs:sequence>
+ <xs:element name="next" type="xs:unsignedInt" dfdl:length="2"
+ dfdl:lengthKind="explicit" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rHexBinaryPrefixed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:sequence>
+ <xs:element name="value" type="xs:hexBinary"
dfdl:lengthKind="prefixed"
+ dfdl:prefixLengthType="tns:lenPrefixType"
+ dfdl:prefixIncludesPrefixLength="no"
+ dfdl:lengthUnits="bytes" dfdl:alignmentUnits="bytes"/>
+ </xs:sequence>
+ <xs:element name="next" type="xs:unsignedInt" dfdl:length="2"
+ dfdl:lengthKind="explicit" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:simpleType name="lenPrefixType"
+ dfdl:lengthKind="explicit" dfdl:length="8">
+ <xs:restriction base="xs:unsignedInt"/>
+ </xs:simpleType>
+
+
+ <xs:element name="rString">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:sequence>
+ <xs:element name="len" type="xs:unsignedInt" dfdl:length="8"
+ dfdl:lengthKind="explicit" dfdl:outputValueCalc="{
dfdl:valueLength(../value, 'bytes') }" />
+ <xs:element name="value" type="xs:string" dfdl:length="{ ../len }"
+ dfdl:lengthUnits="bytes" dfdl:lengthKind="explicit"
dfdl:alignmentUnits="bytes"/>
+ </xs:sequence>
+ <xs:element name="next" type="xs:unsignedInt" dfdl:length="2"
+ dfdl:lengthKind="explicit" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </tdml:defineSchema>
+
+ <tdml:unparserTestCase name="rHexBinaryLSBF1" root="rHexBinary" model="s"
roundTrip="onePass">
+ <tdml:document>
+ <tdml:documentPart type="byte">
+ 01 31 03
+ </tdml:documentPart>
+ </tdml:document>
+
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rHexBinary>
+ <len>1</len>
+ <value>31</value>
+ <next>3</next>
+ </ex:rHexBinary>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:unparserTestCase>
+
+ <tdml:unparserTestCase name="rHexBinaryLSBF2" root="rHexBinaryPrefixed"
model="s" roundTrip="onePass">
+ <tdml:document>
+ <tdml:documentPart type="byte">
+ 01 31 03
+ </tdml:documentPart>
+ </tdml:document>
+
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rHexBinaryPrefixed>
+ <value>31</value>
+ <next>3</next>
+ </ex:rHexBinaryPrefixed>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:unparserTestCase>
+
+ <tdml:unparserTestCase name="rStringLSBF1" root="rString" model="s"
roundTrip="onePass">
+ <tdml:document>
+ <tdml:documentPart type="byte">
+ 01 31 03
+ </tdml:documentPart>
+ </tdml:document>
+
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rString>
+ <len>1</len>
+ <value>1</value>
+ <next>3</next>
+ </ex:rString>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:unparserTestCase>
+
+</tdml:testSuite>
+
diff --git
a/daffodil-test/src/test/scala/org/apache/daffodil/section17/calc_value_properties/TestOutputValueCalc.scala
b/daffodil-test/src/test/scala/org/apache/daffodil/section17/calc_value_properties/TestOutputValueCalc.scala
index 10246f5..3671890 100644
---
a/daffodil-test/src/test/scala/org/apache/daffodil/section17/calc_value_properties/TestOutputValueCalc.scala
+++
b/daffodil-test/src/test/scala/org/apache/daffodil/section17/calc_value_properties/TestOutputValueCalc.scala
@@ -26,10 +26,12 @@ object TestOutputValueCalc {
val runner = Runner(testDir, "outputValueCalc.tdml")
val runner2 = Runner(testDir, "outputValueCalc2.tdml")
+ val runner3 = Runner(testDir, "outputValueCalc3.tdml")
@AfterClass def shutdown {
runner.reset
runner2.reset
+ runner3.reset
}
}
@@ -73,4 +75,9 @@ class TestOutputValueCalc {
@Test def test_errorOneArg() { runner.runOneTest("errorOneArg") }
@Test def test_errorTwoArg() { runner.runOneTest("errorTwoArg") }
@Test def test_errorThreeArg() { runner.runOneTest("errorThreeArg") }
+
+ // DAFFODIL-2069
+ // @Test def test_ovcHexBinaryLSBF1() {
runner3.runOneTest("rHexBinaryLSBF1") }
+ @Test def test_ovcHexBinaryLSBF2() { runner3.runOneTest("rHexBinaryLSBF2") }
+ @Test def test_ovcStringLSBF1() { runner3.runOneTest("rStringLSBF1") }
}