Skip to content

Adds support for NOP padding according to spec#107

Merged
raganhan merged 5 commits intomasterfrom
nop
Jul 27, 2017
Merged

Adds support for NOP padding according to spec#107
raganhan merged 5 commits intomasterfrom
nop

Conversation

@raganhan
Copy link
Copy Markdown
Contributor

Impl as a special TID marker to skip value. Structs are taken care by default as the field:value pair is parsed together and skipped together

ref: #97

Copy link
Copy Markdown
Contributor

@tgregg tgregg left a comment

Choose a reason for hiding this comment

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

Looks good overall. Some comments that go along with comments on amazon-ion/ion-tests#33 .

// that is there now, before the call)
_value_tid = read_type_id();
if (_value_tid == PrivateIonConstants.tidNopPad) {
throwErrorAt("Annotations are not allowed for NOP padding");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps "NOP padding is not allowed within annotation wrappers."

Comment thread test/AllTests.java

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import software.amazon.ion.AnnotationEscapesTest;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's leave the imports lists as-is, or change them in a separate PR.

{ "good" + File.separator + "item1.10n", "good" + File.separator + "symbols.ion" };
private static final String[] FILES_WITH_UNKNOWN_SYMBOL_TEXT = {
"good" + File.separator + "item1.10n",
"good" + File.separator + "symbols.ion",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm curious about this. What revision of good/symbols.ion are you using? I don't see any symbols with unknown text in there. Also note that for the others you added here, you can choose a non-zero symbol ID with known text without having to explicitly include a local symbol table. Just choose a symbol from 1-9, which occur in the local symbol table. I added a comment to this effect on amazon-ion/ion-tests#33 .

Once that's fixed, these don't need to be added here. Right now it looks like all these tests are being skipped. If they weren't they should fail.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good/symbols.ion was in GoodIonTest already, I only moved to add the new files. But you are right it doesn't need to be excluded there.

Submitted a PR to fix the NOP ones, amazon-ion/ion-tests#34

myExpectedException.expectMessage("Annotations are not allowed for NOP padding");

IonDatagram datagram = loadTestFile("bad/nopPadWithAnnotations.10n");
assertEquals(1, datagram.size());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hasn't the code under test already failed on the previous line (as expected)? What are the remaining lines testing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good point, fixed.

@raganhan
Copy link
Copy Markdown
Contributor Author

Will wait on amazon-ion/ion-tests#34 before submitting the new PR with the changes

raganhan added 2 commits July 25, 2017 17:19
Changes:
* Annotation exception msg
* Used existing Nop padding files for testing
* Removed files from FILES_WITH_UNKNOWN_SYMBOL_TEXT that don't need to
be there
@tgregg
Copy link
Copy Markdown
Contributor

tgregg commented Jul 27, 2017

The imports are still reordered.

@tgregg
Copy link
Copy Markdown
Contributor

tgregg commented Jul 27, 2017

Looks like the NopPaddingTest import got dropped from AllTests.

Copy link
Copy Markdown
Contributor

@tgregg tgregg left a comment

Choose a reason for hiding this comment

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

Looks good.

@raganhan raganhan merged commit c101da9 into master Jul 27, 2017
@raganhan raganhan deleted the nop branch July 27, 2017 18:30
tgregg pushed a commit that referenced this pull request Jun 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants