Lines Matching full:ctx
98 struct lwm2m_ctx ctx; in ZTEST() local
101 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
103 ctx.remote_addr.sa_family = AF_INET; in ZTEST()
104 ctx.sock_fd = -1; in ZTEST()
105 ctx.load_credentials = NULL; in ZTEST()
106 ctx.desthostname = host_name; in ZTEST()
107 ctx.desthostnamelen = strlen(host_name); in ZTEST()
108 ctx.use_dtls = true; in ZTEST()
110 ret = lwm2m_engine_start(&ctx); in ZTEST()
118 zassert_equal(eng_ctx[0], &ctx); in ZTEST()
122 ret = lwm2m_engine_stop(&ctx); in ZTEST()
129 struct lwm2m_ctx ctx; in ZTEST() local
131 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
133 ctx.remote_addr.sa_family = AF_INET; in ZTEST()
134 ctx.sock_fd = -1; in ZTEST()
135 ctx.load_credentials = NULL; in ZTEST()
137 ret = lwm2m_engine_start(&ctx); in ZTEST()
147 ret = lwm2m_engine_stop(&ctx); in ZTEST()
154 struct lwm2m_ctx ctx; in ZTEST() local
156 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
158 ctx.remote_addr.sa_family = AF_INET; in ZTEST()
159 ctx.load_credentials = NULL; in ZTEST()
161 ret = lwm2m_engine_start(&ctx); in ZTEST()
169 ret = lwm2m_engine_stop(&ctx); in ZTEST()
176 struct lwm2m_ctx ctx; in ZTEST() local
178 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
180 ctx.sock_fd = -1; in ZTEST()
181 ctx.load_credentials = NULL; in ZTEST()
183 ret = lwm2m_engine_start(&ctx); in ZTEST()
185 lwm2m_engine_stop(&ctx); in ZTEST()
191 struct lwm2m_ctx ctx; in ZTEST() local
193 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
195 ctx.sock_fd = -1; in ZTEST()
196 ctx.load_credentials = NULL; in ZTEST()
197 ctx.remote_addr.sa_family = AF_INET; in ZTEST()
201 ret = lwm2m_engine_start(&ctx); in ZTEST()
203 lwm2m_engine_stop(&ctx); in ZTEST()
209 struct lwm2m_ctx ctx; in ZTEST() local
211 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
213 ctx.sock_fd = -1; in ZTEST()
214 ctx.load_credentials = NULL; in ZTEST()
215 ctx.remote_addr.sa_family = AF_INET; in ZTEST()
217 ret = lwm2m_engine_start(&ctx); in ZTEST()
219 ret = lwm2m_socket_suspend(&ctx); in ZTEST()
221 zassert_equal(ctx.connection_suspended, true); in ZTEST()
222 ret = lwm2m_engine_connection_resume(&ctx); in ZTEST()
224 zassert_equal(ctx.connection_suspended, false); in ZTEST()
225 lwm2m_engine_stop(&ctx); in ZTEST()
231 struct lwm2m_ctx ctx; in ZTEST() local
234 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
236 ctx.sock_fd = -1; in ZTEST()
237 ctx.load_credentials = NULL; in ZTEST()
238 ctx.remote_addr.sa_family = AF_INET; in ZTEST()
239 sys_slist_init(&ctx.observer); in ZTEST()
246 sys_slist_append(&ctx.observer, &obs.node); in ZTEST()
249 ret = lwm2m_engine_start(&ctx); in ZTEST()
253 ret = lwm2m_engine_stop(&ctx); in ZTEST()
263 struct lwm2m_ctx ctx; in ZTEST() local
267 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
269 sys_slist_init(&ctx.queued_messages); in ZTEST()
270 msg.ctx = &ctx; in ZTEST()
272 sys_slist_append(&ctx.queued_messages, &msg.node); in ZTEST()
273 ret = lwm2m_push_queued_buffers(&ctx); in ZTEST()
280 struct lwm2m_ctx ctx; in ZTEST() local
286 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
288 ctx.bootstrap_mode = true; in ZTEST()
289 msg.ctx = &ctx; in ZTEST()
342 struct lwm2m_ctx ctx; in ZTEST() local
346 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
348 ctx.sock_fd = -1; in ZTEST()
349 ctx.load_credentials = NULL; in ZTEST()
350 ctx.remote_addr.sa_family = AF_INET; in ZTEST()
355 ctx.pendings[0] = pending_1; in ZTEST()
360 ctx.pendings[1] = pending_2; in ZTEST()
362 ret = lwm2m_engine_start(&ctx); in ZTEST()
366 ret = lwm2m_engine_stop(&ctx); in ZTEST()
375 struct lwm2m_ctx ctx; in ZTEST() local
377 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
379 ctx.remote_addr.sa_family = AF_INET; in ZTEST()
380 ctx.sock_fd = -1; in ZTEST()
384 ret = lwm2m_engine_start(&ctx); in ZTEST()
388 ret = lwm2m_engine_stop(&ctx); in ZTEST()
396 struct lwm2m_ctx ctx; in ZTEST() local
400 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
402 ctx.remote_addr.sa_family = AF_INET; in ZTEST()
403 ctx.sock_fd = -1; in ZTEST()
404 sys_slist_init(&ctx.queued_messages); in ZTEST()
405 msg.ctx = &ctx; in ZTEST()
408 sys_slist_append(&ctx.queued_messages, &msg.node); in ZTEST()
410 ret = lwm2m_push_queued_buffers(&ctx); in ZTEST()
415 ret = lwm2m_engine_start(&ctx); in ZTEST()
419 ret = lwm2m_engine_stop(&ctx); in ZTEST()
427 struct lwm2m_ctx ctx; in ZTEST() local
430 (void)memset(&ctx, 0x0, sizeof(ctx)); in ZTEST()
433 ctx.remote_addr.sa_family = AF_INET; in ZTEST()
434 ctx.sock_fd = -1; in ZTEST()
435 ctx.load_credentials = NULL; in ZTEST()
436 ctx.desthostname = host_name; in ZTEST()
437 ctx.desthostnamelen = strlen(host_name); in ZTEST()
438 ctx.use_dtls = false; in ZTEST()
442 zassert_equal(lwm2m_engine_start(&ctx), 0); in ZTEST()
443 zassert_equal(lwm2m_engine_stop(&ctx), 0); in ZTEST()
445 ctx.use_dtls = true; in ZTEST()
446 zassert_equal(lwm2m_engine_start(&ctx), -EINVAL); in ZTEST()
447 zassert_equal(lwm2m_engine_stop(&ctx), 0); in ZTEST()
451 zassert_equal(lwm2m_engine_start(&ctx), 0); in ZTEST()
459 zassert_equal(lwm2m_engine_stop(&ctx), 0); in ZTEST()
464 ctx.desthostname = NULL; in ZTEST()
465 zassert_equal(lwm2m_engine_start(&ctx), 0); in ZTEST()
473 zassert_equal(lwm2m_engine_stop(&ctx), 0); in ZTEST()
487 struct lwm2m_ctx ctx = { in ZTEST() local
493 .ctx = &ctx, in ZTEST()
498 .ctx = &ctx, in ZTEST()
502 sys_slist_init(&ctx.pending_sends); in ZTEST()
503 ret = lwm2m_engine_start(&ctx); in ZTEST()
508 sys_slist_append(&ctx.pending_sends, &msg1.node); in ZTEST()
515 sys_slist_append(&ctx.pending_sends, &msg1.node); in ZTEST()
516 sys_slist_append(&ctx.pending_sends, &msg2.node); in ZTEST()
529 sys_slist_append(&ctx.pending_sends, &ack.node); in ZTEST()
535 ret = lwm2m_socket_suspend(&ctx); in ZTEST()
539 ret = lwm2m_engine_stop(&ctx); in ZTEST()