Skip to content

Conversation

dan4thewin
Copy link
Contributor

This PR solves 3 edge cases and adds unit tests to prevent future regressions.


#define isOpenBracket_( x ) ( ( ( x ) == '{' ) || ( ( x ) == '[' ) )
#define isCloseBracket_( x ) ( ( ( x ) == '}' ) || ( ( x ) == ']' ) )
/* NB. The numeric values of the open and close bracket pairs differ by 2. */
Copy link
Contributor

Choose a reason for hiding this comment

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

What does "NB" stand for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nota bene

Copy link
Contributor

Choose a reason for hiding this comment

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

May be esoteric for readers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use e.g. and i.e. often enough. I'll keep it.

CUT_AFTER_OBJECT_START_MARKER_LENGTH );
TEST_ASSERT_EQUAL( JSONPartial, jsonStatus );

jsonStatus = JSON_Validate( CUT_AFTER_KEY,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the changes to the parser, a key without a value is considered illegal, not partial. The case is also covered by one of the new tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, I put the test back with the other illegal tests.

@aggarw13 aggarw13 merged commit 424feac into FreeRTOS:master Sep 16, 2020
@dan4thewin dan4thewin deleted the edge-cases branch September 16, 2020 21:28
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.

4 participants