Lines Matching refs:rc

93 	int rc = sys_notify_fetch_result(&cp->notify, &result);  in cli_result()  local
95 if (rc == 0) { in cli_result()
96 rc = result; in cli_result()
98 return rc; in cli_result()
231 int rc; in setup_test() local
241 rc = onoff_manager_init(&onoff_srv, &transitions); in setup_test()
242 zassert_equal(rc, 0, in setup_test()
248 rc = onoff_monitor_register(&onoff_srv, &onoff_mon); in setup_test()
249 zassert_equal(rc, 0, in setup_test()
257 int rc; in setup_error() local
262 rc = onoff_request(&onoff_srv, &onoff_cli); in setup_error()
263 zassert_equal(rc, ONOFF_STATE_OFF, in setup_error()
275 int rc; in ZTEST() local
280 rc = onoff_manager_init(NULL, NULL); in ZTEST()
281 zassert_equal(rc, -EINVAL, in ZTEST()
283 rc = onoff_manager_init(&onoff_srv, NULL); in ZTEST()
284 zassert_equal(rc, -EINVAL, in ZTEST()
286 rc = onoff_manager_init(NULL, &transitions); in ZTEST()
287 zassert_equal(rc, -EINVAL, in ZTEST()
289 rc = onoff_manager_init(&onoff_srv, &xit); in ZTEST()
290 zassert_equal(rc, -EINVAL, in ZTEST()
294 rc = onoff_manager_init(&onoff_srv, &xit); in ZTEST()
295 zassert_equal(rc, -EINVAL, in ZTEST()
299 rc = onoff_manager_init(&onoff_srv, &xit); in ZTEST()
300 zassert_equal(rc, 0, in ZTEST()
343 int rc; in ZTEST() local
347 rc = onoff_request(NULL, NULL); in ZTEST()
348 zassert_equal(rc, -EINVAL, in ZTEST()
350 rc = onoff_request(&onoff_srv, NULL); in ZTEST()
351 zassert_equal(rc, -EINVAL, in ZTEST()
353 rc = onoff_request(NULL, &onoff_cli); in ZTEST()
354 zassert_equal(rc, -EINVAL, in ZTEST()
357 rc = onoff_request(&onoff_srv, &cli2); in ZTEST()
358 zassert_equal(rc, -EINVAL, in ZTEST()
362 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
363 zassert_equal(rc, -EINVAL, in ZTEST()
367 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
368 zassert_equal(rc, 0, in ZTEST()
373 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
374 zassert_equal(rc, -EAGAIN, in ZTEST()
381 int rc; in ZTEST() local
389 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
390 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
391 "req: %d", rc); in ZTEST()
408 rc = onoff_release(&onoff_srv); in ZTEST()
409 zassert_equal(rc, ONOFF_STATE_ON, in ZTEST()
410 "rel: %d", rc); in ZTEST()
420 rc = onoff_release(&onoff_srv); in ZTEST()
421 zassert_equal(rc, -ENOTSUP, in ZTEST()
422 "re-rel: %d", rc); in ZTEST()
427 int rc; in ZTEST() local
437 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
438 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
439 "async req: %d", rc); in ZTEST()
457 rc = onoff_release(&onoff_srv); in ZTEST()
458 zassert_true(rc >= 0, in ZTEST()
459 "rel: %d", rc); in ZTEST()
479 int rc; in ZTEST() local
484 rc = onoff_reset(NULL, NULL); in ZTEST()
485 zassert_equal(rc, -EINVAL, in ZTEST()
487 rc = onoff_reset(&onoff_srv, NULL); in ZTEST()
488 zassert_equal(rc, -EINVAL, in ZTEST()
490 rc = onoff_reset(NULL, &onoff_cli); in ZTEST()
491 zassert_equal(rc, -EINVAL, in ZTEST()
493 rc = onoff_reset(&onoff_srv, &cli2); in ZTEST()
494 zassert_equal(rc, -EINVAL, in ZTEST()
498 rc = onoff_reset(&onoff_srv, &onoff_cli); in ZTEST()
499 zassert_equal(rc, -ENOTSUP, in ZTEST()
503 rc = onoff_reset(&onoff_srv, &onoff_cli); in ZTEST()
504 zassert_equal(rc, ONOFF_STATE_ERROR, in ZTEST()
508 rc = onoff_reset(&onoff_srv, &onoff_cli); in ZTEST()
509 zassert_equal(rc, -EALREADY, in ZTEST()
515 int rc; in ZTEST() local
531 rc = onoff_reset(&onoff_srv, &onoff_cli); in ZTEST()
532 zassert_equal(rc, ONOFF_STATE_ERROR, in ZTEST()
546 int rc; in ZTEST() local
558 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
559 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
560 "req: %d", rc); in ZTEST()
571 rc = onoff_request(&onoff_srv, &cli2); in ZTEST()
572 zassert_equal(rc, ONOFF_STATE_TO_ON, in ZTEST()
573 "req2: %d", rc); in ZTEST()
590 int rc; in ZTEST() local
601 rc = onoff_request(&onoff_srv, &cli0); in ZTEST()
602 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
603 "req0: %d", rc); in ZTEST()
617 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
618 zassert_equal(rc, ONOFF_STATE_ON, in ZTEST()
619 "req: %d", rc); in ZTEST()
628 rc = onoff_release(&onoff_srv); /* pair with cli0 */ in ZTEST()
629 zassert_equal(rc, ONOFF_STATE_ON, in ZTEST()
630 "rel: %d", rc); in ZTEST()
636 rc = onoff_release(&onoff_srv); /* pair with cli */ in ZTEST()
637 zassert_equal(rc, ONOFF_STATE_ON, in ZTEST()
638 "rel: %d", rc); in ZTEST()
647 int rc; in ZTEST() local
656 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
657 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
658 "req: %d", rc); in ZTEST()
671 rc = onoff_release(&onoff_srv); in ZTEST()
672 zassert_true(rc >= 0, in ZTEST()
673 "rel: %d", rc); in ZTEST()
683 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
684 zassert_equal(rc, ONOFF_STATE_TO_OFF, in ZTEST()
685 "del req: %d", rc); in ZTEST()
708 int rc; in ZTEST() local
718 rc = onoff_monitor_unregister(&onoff_srv, &onoff_mon); in ZTEST()
719 zassert_equal(rc, 0, in ZTEST()
724 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
725 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
727 rc = onoff_cancel(&onoff_srv, &onoff_cli); in ZTEST()
728 zassert_equal(rc, ONOFF_STATE_TO_ON, in ZTEST()
738 int rc; in ZTEST() local
748 rc = onoff_monitor_unregister(&onoff_srv, &onoff_mon); in ZTEST()
749 zassert_equal(rc, 0, in ZTEST()
752 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
753 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
759 rc = onoff_release(&onoff_srv); in ZTEST()
760 zassert_equal(rc, ONOFF_STATE_ON, in ZTEST()
764 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
765 zassert_equal(rc, ONOFF_STATE_TO_OFF, in ZTEST()
780 int rc = onoff_release(srv); in rel_in_req_cb() local
782 zassert_equal(rc, ONOFF_STATE_ON, in rel_in_req_cb()
788 int rc; in ZTEST() local
797 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
798 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
818 int rc; in ZTEST() local
827 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
828 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
845 rc = onoff_reset(&onoff_srv, &cli2); in ZTEST()
846 zassert_equal(rc, ONOFF_STATE_ERROR, in ZTEST()
856 rc = onoff_reset(&onoff_srv, &onoff_cli); in ZTEST()
857 zassert_equal(rc, ONOFF_STATE_RESETTING, in ZTEST()
877 int rc; in ZTEST() local
883 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
884 zassert_equal(rc, -EIO, in ZTEST()
887 rc = onoff_release(&onoff_srv); in ZTEST()
888 zassert_equal(rc, -EIO, in ZTEST()
894 rc = onoff_reset(&onoff_srv, &cli2); in ZTEST()
895 zassert_equal(rc, ONOFF_STATE_ERROR, in ZTEST()
898 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
899 zassert_equal(rc, -ENOTSUP, in ZTEST()
902 rc = onoff_release(&onoff_srv); in ZTEST()
903 zassert_equal(rc, -ENOTSUP, in ZTEST()
909 int rc; in ZTEST() local
915 rc = onoff_cancel(NULL, NULL); in ZTEST()
916 zassert_equal(rc, -EINVAL, in ZTEST()
918 rc = onoff_cancel(&onoff_srv, NULL); in ZTEST()
919 zassert_equal(rc, -EINVAL, in ZTEST()
921 rc = onoff_cancel(NULL, &onoff_cli); in ZTEST()
922 zassert_equal(rc, -EINVAL, in ZTEST()
925 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
926 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
927 "async req: %d", rc); in ZTEST()
934 rc = onoff_cancel(&onoff_srv, &onoff_cli); in ZTEST()
935 zassert_equal(rc, ONOFF_STATE_TO_ON, in ZTEST()
936 "cancel req: %d", rc); in ZTEST()
938 rc = onoff_cancel(&onoff_srv, &onoff_cli); in ZTEST()
939 zassert_equal(rc, -EALREADY, in ZTEST()
940 "re-cancel req: %d", rc); in ZTEST()
958 int rc; in ZTEST() local
962 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
963 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
964 "req: %d", rc); in ZTEST()
976 rc = onoff_release(&onoff_srv); in ZTEST()
977 zassert_true(rc >= 0, in ZTEST()
978 "rel: %d", rc); in ZTEST()
988 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
989 zassert_equal(rc, ONOFF_STATE_TO_OFF, in ZTEST()
990 "del req: %d", rc); in ZTEST()
995 rc = onoff_cancel(&onoff_srv, &onoff_cli); in ZTEST()
996 zassert_equal(rc, ONOFF_STATE_TO_OFF, in ZTEST()
997 "can del req: %d", rc); in ZTEST()
1011 int rc; in ZTEST() local
1020 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
1021 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
1023 rc = onoff_cancel_or_release(&onoff_srv, &onoff_cli); in ZTEST()
1024 zassert_equal(rc, ONOFF_STATE_TO_ON, in ZTEST()
1040 rc = onoff_request(&onoff_srv, &onoff_cli); in ZTEST()
1041 zassert_equal(rc, ONOFF_STATE_OFF, in ZTEST()
1046 rc = onoff_cancel_or_release(&onoff_srv, &onoff_cli); in ZTEST()
1047 zassert_equal(rc, ONOFF_STATE_ON, in ZTEST()
1060 int rc; in ZTEST() local
1064 rc = onoff_sync_lock(&srv, &key); in ZTEST()
1065 zassert_equal(rc, 0, in ZTEST()
1068 rc = onoff_sync_finalize(&srv, key, &onoff_cli, res, true); in ZTEST()
1069 zassert_equal(rc, 1, in ZTEST()
1080 rc = onoff_sync_lock(&srv, &key); in ZTEST()
1081 zassert_equal(rc, 1, in ZTEST()
1085 rc = onoff_sync_finalize(&srv, key, &onoff_cli, res, true); in ZTEST()
1086 zassert_equal(rc, 2, in ZTEST()
1092 rc = onoff_sync_lock(&srv, &key); in ZTEST()
1093 zassert_equal(rc, 2, in ZTEST()
1096 rc = onoff_sync_finalize(&srv, key, NULL, res, false); in ZTEST()
1097 zassert_equal(rc, 1, in ZTEST()
1102 rc = onoff_sync_lock(&srv, &key); in ZTEST()
1103 zassert_equal(rc, 1, in ZTEST()
1106 rc = onoff_sync_finalize(&srv, key, NULL, res, false); in ZTEST()
1107 zassert_equal(rc, 0, in ZTEST()
1115 rc = onoff_sync_lock(&srv, &key); in ZTEST()
1116 zassert_equal(rc, 0, in ZTEST()
1119 rc = onoff_sync_finalize(&srv, key, NULL, res, false); in ZTEST()
1120 zassert_equal(rc, -1, in ZTEST()
1127 rc = onoff_sync_lock(&srv, &key); in ZTEST()
1128 zassert_equal(rc, -1, in ZTEST()
1137 int rc; in ZTEST() local
1142 rc = onoff_sync_lock(&srv, &key); in ZTEST()
1143 zassert_equal(rc, 0, in ZTEST()
1146 rc = onoff_sync_finalize(&srv, key, &onoff_cli, res, true); in ZTEST()
1148 zassert_equal(rc, res, in ZTEST()
1165 rc = onoff_sync_lock(&srv, &key); in ZTEST()
1166 zassert_equal(rc, -1, in ZTEST()
1171 rc = onoff_sync_finalize(&srv, key, &onoff_cli, res, true); in ZTEST()
1173 zassert_equal(rc, 1, in ZTEST()
1174 "req count %d", rc); in ZTEST()
1177 rc = onoff_sync_lock(&srv, &key); in ZTEST()
1178 zassert_equal(rc, 1, in ZTEST()