@@ -27,6 +27,7 @@ FAKE_VOID_FUNC(show_lwm2m_event, enum lwm2m_rd_client_event);
27
27
FAKE_VOID_FUNC (show_lwm2m_observe , enum lwm2m_observe_event );
28
28
29
29
static int next_event ;
30
+ static struct lwm2m_ctx ctx ;
30
31
31
32
bool expect_lwm2m_rd_client_event (uint8_t expected_val )
32
33
{
@@ -198,8 +199,6 @@ ZTEST_SUITE(lwm2m_rd_client, NULL, NULL, my_suite_before, my_suite_after, NULL);
198
199
199
200
ZTEST (lwm2m_rd_client , test_start_registration_ok )
200
201
{
201
- struct lwm2m_ctx ctx ;
202
-
203
202
(void )memset (& ctx , 0x0 , sizeof (ctx ));
204
203
205
204
lwm2m_rd_client_init ();
@@ -224,8 +223,6 @@ ZTEST(lwm2m_rd_client, test_start_registration_ok)
224
223
225
224
ZTEST (lwm2m_rd_client , test_register_update_too_small_lifetime_to_default )
226
225
{
227
- struct lwm2m_ctx ctx ;
228
-
229
226
get_u32_val = CONFIG_LWM2M_ENGINE_DEFAULT_LIFETIME / 2 ;
230
227
lwm2m_get_u32_fake .custom_fake = lwm2m_get_u32_val ;
231
228
@@ -247,8 +244,6 @@ ZTEST(lwm2m_rd_client, test_register_update_too_small_lifetime_to_default)
247
244
248
245
ZTEST (lwm2m_rd_client , test_timeout_resume_registration )
249
246
{
250
- struct lwm2m_ctx ctx ;
251
-
252
247
(void )memset (& ctx , 0x0 , sizeof (ctx ));
253
248
254
249
lwm2m_rd_client_init ();
@@ -270,8 +265,6 @@ ZTEST(lwm2m_rd_client, test_timeout_resume_registration)
270
265
271
266
ZTEST (lwm2m_rd_client , test_start_registration_timeout )
272
267
{
273
- struct lwm2m_ctx ctx ;
274
-
275
268
(void )memset (& ctx , 0x0 , sizeof (ctx ));
276
269
277
270
lwm2m_rd_client_init ();
@@ -289,8 +282,6 @@ ZTEST(lwm2m_rd_client, test_start_registration_timeout)
289
282
290
283
ZTEST (lwm2m_rd_client , test_start_registration_fail )
291
284
{
292
- struct lwm2m_ctx ctx ;
293
-
294
285
(void )memset (& ctx , 0x0 , sizeof (ctx ));
295
286
296
287
lwm2m_rd_client_init ();
@@ -315,8 +306,6 @@ ZTEST(lwm2m_rd_client, test_start_registration_fail)
315
306
316
307
ZTEST (lwm2m_rd_client , test_start_registration_update )
317
308
{
318
- struct lwm2m_ctx ctx ;
319
-
320
309
(void )memset (& ctx , 0x0 , sizeof (ctx ));
321
310
322
311
lwm2m_rd_client_init ();
@@ -337,8 +326,6 @@ ZTEST(lwm2m_rd_client, test_start_registration_update)
337
326
338
327
ZTEST (lwm2m_rd_client , test_rx_off )
339
328
{
340
- struct lwm2m_ctx ctx ;
341
-
342
329
(void )memset (& ctx , 0x0 , sizeof (ctx ));
343
330
344
331
lwm2m_rd_client_init ();
@@ -360,8 +347,6 @@ ZTEST(lwm2m_rd_client, test_rx_off)
360
347
361
348
ZTEST (lwm2m_rd_client , test_start_registration_update_fail )
362
349
{
363
- struct lwm2m_ctx ctx ;
364
-
365
350
(void )memset (& ctx , 0x0 , sizeof (ctx ));
366
351
367
352
lwm2m_rd_client_init ();
@@ -384,8 +369,6 @@ ZTEST(lwm2m_rd_client, test_start_registration_update_fail)
384
369
385
370
ZTEST (lwm2m_rd_client , test_registration_update_timeout )
386
371
{
387
- struct lwm2m_ctx ctx ;
388
-
389
372
(void )memset (& ctx , 0x0 , sizeof (ctx ));
390
373
391
374
lwm2m_rd_client_init ();
@@ -414,8 +397,6 @@ ZTEST(lwm2m_rd_client, test_registration_update_timeout)
414
397
415
398
ZTEST (lwm2m_rd_client , test_deregistration_timeout )
416
399
{
417
- struct lwm2m_ctx ctx ;
418
-
419
400
(void )memset (& ctx , 0x0 , sizeof (ctx ));
420
401
421
402
lwm2m_rd_client_init ();
@@ -437,8 +418,6 @@ ZTEST(lwm2m_rd_client, test_deregistration_timeout)
437
418
438
419
ZTEST (lwm2m_rd_client , test_error_on_registration_update )
439
420
{
440
- struct lwm2m_ctx ctx ;
441
-
442
421
(void )memset (& ctx , 0x0 , sizeof (ctx ));
443
422
444
423
lwm2m_rd_client_init ();
@@ -462,8 +441,6 @@ ZTEST(lwm2m_rd_client, test_error_on_registration_update)
462
441
463
442
ZTEST (lwm2m_rd_client , test_network_error_on_registration )
464
443
{
465
- struct lwm2m_ctx ctx ;
466
-
467
444
(void )memset (& ctx , 0x0 , sizeof (ctx ));
468
445
469
446
lwm2m_rd_client_init ();
@@ -480,8 +457,6 @@ ZTEST(lwm2m_rd_client, test_network_error_on_registration)
480
457
481
458
ZTEST (lwm2m_rd_client , test_suspend_resume_registration )
482
459
{
483
- struct lwm2m_ctx ctx ;
484
-
485
460
(void )memset (& ctx , 0x0 , sizeof (ctx ));
486
461
487
462
lwm2m_rd_client_init ();
@@ -514,8 +489,6 @@ ZTEST(lwm2m_rd_client, test_suspend_resume_registration)
514
489
515
490
ZTEST (lwm2m_rd_client , test_suspend_stop_resume )
516
491
{
517
- struct lwm2m_ctx ctx ;
518
-
519
492
(void )memset (& ctx , 0x0 , sizeof (ctx ));
520
493
521
494
lwm2m_rd_client_init ();
@@ -540,8 +513,6 @@ ZTEST(lwm2m_rd_client, test_suspend_stop_resume)
540
513
541
514
ZTEST (lwm2m_rd_client , test_socket_error )
542
515
{
543
- struct lwm2m_ctx ctx ;
544
-
545
516
(void )memset (& ctx , 0x0 , sizeof (ctx ));
546
517
547
518
lwm2m_rd_client_init ();
@@ -564,8 +535,6 @@ ZTEST(lwm2m_rd_client, test_socket_error)
564
535
565
536
ZTEST (lwm2m_rd_client , test_socket_error_on_stop )
566
537
{
567
- struct lwm2m_ctx ctx ;
568
-
569
538
(void )memset (& ctx , 0x0 , sizeof (ctx ));
570
539
571
540
lwm2m_rd_client_init ();
@@ -590,8 +559,6 @@ ZTEST(lwm2m_rd_client, test_socket_error_on_stop)
590
559
591
560
ZTEST (lwm2m_rd_client , test_no_context )
592
561
{
593
- struct lwm2m_ctx ctx ;
594
-
595
562
lwm2m_rd_client_init ();
596
563
zassert_equal (lwm2m_rd_client_stop (& ctx , NULL , false), - EPERM );
597
564
zassert_equal (lwm2m_rd_client_pause (), - EPERM );
@@ -602,8 +569,6 @@ ZTEST(lwm2m_rd_client, test_no_context)
602
569
603
570
ZTEST (lwm2m_rd_client , test_engine_trigger_bootstrap )
604
571
{
605
- struct lwm2m_ctx ctx ;
606
-
607
572
(void )memset (& ctx , 0x0 , sizeof (ctx ));
608
573
609
574
lwm2m_rd_client_init ();
@@ -630,9 +595,6 @@ ZTEST(lwm2m_rd_client, test_engine_trigger_bootstrap)
630
595
631
596
ZTEST (lwm2m_rd_client , test_bootstrap_timeout )
632
597
{
633
-
634
- struct lwm2m_ctx ctx ;
635
-
636
598
(void )memset (& ctx , 0x0 , sizeof (ctx ));
637
599
638
600
lwm2m_rd_client_init ();
@@ -653,8 +615,6 @@ ZTEST(lwm2m_rd_client, test_bootstrap_timeout)
653
615
654
616
ZTEST (lwm2m_rd_client , test_bootstrap_fail )
655
617
{
656
- struct lwm2m_ctx ctx ;
657
-
658
618
(void )memset (& ctx , 0x0 , sizeof (ctx ));
659
619
660
620
lwm2m_rd_client_init ();
@@ -676,9 +636,6 @@ ZTEST(lwm2m_rd_client, test_bootstrap_fail)
676
636
677
637
ZTEST (lwm2m_rd_client , test_bootstrap_no_srv )
678
638
{
679
-
680
- struct lwm2m_ctx ctx ;
681
-
682
639
(void )memset (& ctx , 0x0 , sizeof (ctx ));
683
640
684
641
lwm2m_rd_client_init ();
@@ -695,8 +652,6 @@ ZTEST(lwm2m_rd_client, test_bootstrap_no_srv)
695
652
696
653
ZTEST (lwm2m_rd_client , test_disable_server )
697
654
{
698
- struct lwm2m_ctx ctx ;
699
-
700
655
(void )memset (& ctx , 0x0 , sizeof (ctx ));
701
656
702
657
lwm2m_rd_client_init ();
@@ -718,8 +673,6 @@ ZTEST(lwm2m_rd_client, test_disable_server)
718
673
719
674
ZTEST (lwm2m_rd_client , test_disable_server_stop )
720
675
{
721
- struct lwm2m_ctx ctx ;
722
-
723
676
(void )memset (& ctx , 0x0 , sizeof (ctx ));
724
677
725
678
lwm2m_rd_client_init ();
@@ -744,8 +697,6 @@ ZTEST(lwm2m_rd_client, test_disable_server_stop)
744
697
745
698
ZTEST (lwm2m_rd_client , test_disable_server_connect )
746
699
{
747
- struct lwm2m_ctx ctx ;
748
-
749
700
(void )memset (& ctx , 0x0 , sizeof (ctx ));
750
701
751
702
lwm2m_rd_client_init ();
@@ -774,8 +725,6 @@ ZTEST(lwm2m_rd_client, test_disable_server_connect)
774
725
775
726
ZTEST (lwm2m_rd_client , test_fallback_to_bootstrap )
776
727
{
777
- struct lwm2m_ctx ctx ;
778
-
779
728
(void )memset (& ctx , 0x0 , sizeof (ctx ));
780
729
781
730
lwm2m_rd_client_init ();
@@ -796,8 +745,6 @@ ZTEST(lwm2m_rd_client, test_fallback_to_bootstrap)
796
745
797
746
ZTEST (lwm2m_rd_client , test_no_srv_fallback_to_bootstrap )
798
747
{
799
- struct lwm2m_ctx ctx ;
800
-
801
748
(void )memset (& ctx , 0x0 , sizeof (ctx ));
802
749
803
750
lwm2m_rd_client_init ();
@@ -822,8 +769,6 @@ ZTEST(lwm2m_rd_client, test_no_srv_fallback_to_bootstrap)
822
769
823
770
ZTEST (lwm2m_rd_client , test_start_stop_ignore_engine_fault )
824
771
{
825
- struct lwm2m_ctx ctx ;
826
-
827
772
(void )memset (& ctx , 0x0 , sizeof (ctx ));
828
773
829
774
test_prepare_pending_message_cb (& message_reply_cb_default );
@@ -857,8 +802,6 @@ ZTEST(lwm2m_rd_client, test_start_stop_ignore_engine_fault)
857
802
858
803
ZTEST (lwm2m_rd_client , test_start_suspend_ignore_engine_fault )
859
804
{
860
- struct lwm2m_ctx ctx ;
861
-
862
805
(void )memset (& ctx , 0x0 , sizeof (ctx ));
863
806
864
807
test_prepare_pending_message_cb (& message_reply_cb_default );
0 commit comments