Skip to content

unittests: fix gnrc_ipv6_nib test#8177

Merged
miri64 merged 1 commit intoRIOT-OS:masterfrom
smlng:fix/unittests/gnrc_ipv6_nib
Nov 29, 2017
Merged

unittests: fix gnrc_ipv6_nib test#8177
miri64 merged 1 commit intoRIOT-OS:masterfrom
smlng:fix/unittests/gnrc_ipv6_nib

Conversation

@smlng
Copy link
Copy Markdown
Member

@smlng smlng commented Nov 29, 2017

discovered failed assertion when enabling DEVELHELP for unit tests of gnrc_ipv6_nib, this PR fixes them (see Murdock error here [edit]-> PR #8080).

@smlng smlng added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Impact: major The PR changes a significant part of the code base. It should be reviewed carefully CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: tests Area: tests and testing framework labels Nov 29, 2017
@smlng smlng requested a review from miri64 November 29, 2017 15:57
Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

Minor comment, otherwise I am ready to ACK this.

void *iter_state = NULL;
static const ipv6_addr_t addr = { .u64 = { { .u8 = GLOBAL_PREFIX },
{ .u64 = TEST_UINT64 } } };
uint8_t l2addr[] = L2ADDR;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

static const?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

copy-pasta from other test-case above - could fix, but then in multiple places

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since the topic of this PR is "fix gnrc_ipv6_nib test" I have no problem with that ;-)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ah no, though its copy-pasta, in other tests l2addr is modified (i.e. l2addr++), so here static const but other places are good as is ...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wait... now that I think about it: why did you add the l2addr in the first place? nc_set() should work with l2addr being NULL (since there are link-layers like e.g. SLIP that don't have link-layer addresses).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

because of this assert

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ohh... See #8179 for fixing that.

gnrc_ipv6_nib_nc_t nce;

TEST_ASSERT_EQUAL_INT(0, gnrc_ipv6_nib_nc_set(&addr, IFACE, NULL, 0));
TEST_ASSERT_EQUAL_INT(0, gnrc_ipv6_nib_nc_set(&addr, IFACE, l2addr,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If #8179 get's merged I would prefer this change to be reverted.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

sure

@smlng smlng force-pushed the fix/unittests/gnrc_ipv6_nib branch from d8401f8 to 1dfe371 Compare November 29, 2017 20:12
@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 29, 2017

rebase, squashed and adapted

@miri64 miri64 self-assigned this Nov 29, 2017
Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

ACK & go

@miri64 miri64 merged commit 639e65b into RIOT-OS:master Nov 29, 2017
@smlng smlng deleted the fix/unittests/gnrc_ipv6_nib branch November 30, 2017 12:01
@aabadie aabadie added this to the Release 2018.01 milestone Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: major The PR changes a significant part of the code base. It should be reviewed carefully Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants