tests: lwm2m: Update lwm2m_engine tests
Fix lwm2m_message initialization. Pending struct was NULL. Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
This commit is contained in:
parent
9eee8d2be5
commit
c84dc7ee2e
1 changed files with 4 additions and 0 deletions
|
@ -260,11 +260,13 @@ ZTEST(lwm2m_engine, test_push_queued_buffers)
|
|||
int ret;
|
||||
struct lwm2m_ctx ctx;
|
||||
struct lwm2m_message msg;
|
||||
struct coap_pending pending;
|
||||
|
||||
(void)memset(&ctx, 0x0, sizeof(ctx));
|
||||
|
||||
sys_slist_init(&ctx.queued_messages);
|
||||
msg.ctx = &ctx;
|
||||
msg.pending = &pending;
|
||||
sys_slist_append(&ctx.queued_messages, &msg.node);
|
||||
ret = lwm2m_push_queued_buffers(&ctx);
|
||||
zassert_equal(ret, 0);
|
||||
|
@ -391,6 +393,7 @@ ZTEST(lwm2m_engine, test_socket_send)
|
|||
int ret;
|
||||
struct lwm2m_ctx ctx;
|
||||
struct lwm2m_message msg;
|
||||
struct coap_pending pending;
|
||||
|
||||
(void)memset(&ctx, 0x0, sizeof(ctx));
|
||||
|
||||
|
@ -398,6 +401,7 @@ ZTEST(lwm2m_engine, test_socket_send)
|
|||
ctx.sock_fd = -1;
|
||||
sys_slist_init(&ctx.queued_messages);
|
||||
msg.ctx = &ctx;
|
||||
msg.pending = &pending;
|
||||
msg.type = COAP_TYPE_CON;
|
||||
sys_slist_append(&ctx.queued_messages, &msg.node);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue