Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix choice bug DAFFODIL-2259 #307

Merged
merged 1 commit into from Dec 26, 2019

Conversation

mbeckerle
Copy link
Contributor

Added test for this.

Also adding tests to mil-std-2045 schema that exercise the previously
unused element that would have shown this bug up before.

DAFFODIL-2259

Copy link
Contributor

@jadams-tresys jadams-tresys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
Looks good


trait ChoiceTermRuntime1Mixin { self: ChoiceTermBase =>

protected def alternatives: Seq[Gram]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add scala doc. The alternatives are the members of the choice group with special treatment given to some kinds of members. An invariant is that if a direct child member is an array element, the child will have been encapsulated as a sequence, so that arrays always live within sequences.


<xs:element name="e">
<xs:complexType>
<xs:choice>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment here to document what this test is specifically covering, which is DAFFODIL-2259, a bug where a choice element that is an array was fooling construction of the unparser eventUnparserMap.

limitations under the License.
-->

<tdml:testSuite suiteName="choice" description="Tests for choice construct"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve or remove suiteName and description

Copy link
Contributor

@bsloane1650 bsloane1650 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 Looks good. Minor suggestiong for improved test coverage

<tdml:infoset>
<tdml:dfdlInfoset>
<ex:e>
<a>1</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sake of completeness, we should have another test where occurs twice.

Added tests for this.

Also adding tests to mil-std-2045 schema that exercise the previously
unused element that would have shown this bug up before.

Fixed a debugger abort found while debugging the issue.

DAFFODIL-2259
@mbeckerle mbeckerle merged commit 1bdf1cd into apache:master Dec 26, 2019
@mbeckerle mbeckerle deleted the daffodil-2259-choice branch December 26, 2019 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants