Skip to content

Conversation

@sora
Copy link
Contributor

@sora sora commented Jul 11, 2020

No description provided.

@sora sora changed the title support unit test with picotest. This unit test runs when the libtlp is built. support unit test with picotest. This unit test runs when the libtlp is compiled. Jul 11, 2020
@sora sora marked this pull request as ready for review July 11, 2020 09:11
@sora sora assigned upa Jul 11, 2020
@upa
Copy link
Collaborator

upa commented Jul 12, 2020

Please do not put source files on the top of repository. Please make a directory for unit tests, and put unit test codes into the directory. Unfortunately, test is already used for snippet codes for handy testing, so that I suggest mkdir snippet, mv test/* snippet/, and then use test for unit tests.

unit_test.c Outdated
result_length = tlp_calculate_length(0x0, 0);
ok(result_length == 0);

result_length = tlp_calculate_length(0x1, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This test fails. the correct behavior is 0?

unit_test.c Outdated
ok(result_length == 1023);

result_length = tlp_calculate_length(0x0, 4093);
ok(result_length == 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

These four tests also fail. result_length must be 1024.

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