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

Block wise transfer tests #682

Conversation

LukasWoodtli
Copy link
Contributor

Some unit tests were refactored and improved.
Added also some new tests.

@rettichschnidi
Copy link
Contributor

rettichschnidi commented Feb 20, 2023

@LukasWoodtli You will need to sign the Eclipse contributor agreement and rebase on the most recent master commit to fix the builds.

@rettichschnidi rettichschnidi changed the title Gardena/lw/block wise transfer tests Block wise transfer tests Feb 21, 2023
@LukasWoodtli LukasWoodtli force-pushed the gardena/lw/block-wise-transfer-tests branch 4 times, most recently from e86865f to 5329f0f Compare February 28, 2023 16:30
Copy link
Contributor

@rettichschnidi rettichschnidi left a comment

Choose a reason for hiding this comment

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

Regarding commit messages:

  • I think there is some mix-up as the last commit clearly adds new code, not refactoring existing one as its description says.
  • I think this finally resolves block transfer unit tests broken #511, yay! Would mention this in the body of the first commit (which is not just refactoring)

Comment on lines +101 to +115
}
static void test_block1_same_message_after_success(void) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing newline

Suggested change
}
static void test_block1_same_message_after_success(void) {
}
static void test_block1_same_message_after_success(void) {

tests/tests.h Outdated Show resolved Hide resolved
tests/block1tests.c Outdated Show resolved Hide resolved
tests/block1tests.c Outdated Show resolved Hide resolved
tests/block1tests.c Outdated Show resolved Hide resolved
tests/block2tests.c Outdated Show resolved Hide resolved
tests/block2tests.c Show resolved Hide resolved
tests/block1tests.c Outdated Show resolved Hide resolved
tests/block1tests.c Outdated Show resolved Hide resolved
tests/block1tests.c Show resolved Hide resolved
@LukasWoodtli LukasWoodtli force-pushed the gardena/lw/block-wise-transfer-tests branch 3 times, most recently from 406dcb3 to fcd721e Compare March 2, 2023 08:48
The input buffer for the block handling functions is never modified.
Therefore it can be provided as an constant pointer to the
corresponding functions.
The tests are more modular and more readable now.
This fixes eclipse-wakaama#511.
This thest is a simple usecase with multiple block2 transfers
to send a big message.
@LukasWoodtli LukasWoodtli force-pushed the gardena/lw/block-wise-transfer-tests branch from fcd721e to 66f1145 Compare March 2, 2023 12:46
The test sends the same meassage twice. The message is split
into blocks.
@LukasWoodtli LukasWoodtli force-pushed the gardena/lw/block-wise-transfer-tests branch from 66f1145 to 52b24f1 Compare March 2, 2023 14:02

static void test_block2_receive_simple_GET(void) {
lwm2m_block_data_t *blk = NULL;
/* This should be incremented for each block. But it leads to a COAP_408_REQ_ENTITY_INCOMPLETE. */
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bug then in the existing implementation?

@rettichschnidi rettichschnidi merged commit 410cbec into eclipse-wakaama:master Mar 11, 2023
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