Lines Matching +full:- +full:j
4 * SPDX-License-Identifier: Apache-2.0
37 for (size_t i = 0, j = 0, N = ARRAY_SIZE(devs); i < 2 * N; i++, j++, j %= N) { in ZTEST() local
38 if (j == normal_uart) { in ZTEST()
39 /* skip testing non-emul uart */ in ZTEST()
46 /* write text[j] to dev[j] */ in ZTEST()
47 ret[0] = devmux_select_set(devmux_dev, j); in ZTEST()
48 printk("%s", text[j]); in ZTEST()
49 ret[1] = uart_emul_get_tx_data(devs[j], buf, ARRAY_SIZE(buf)); in ZTEST()
52 zassert_ok(ret[0], "Failed to select devmux %zu", j); in ZTEST()
55 /* verify that text[j] was written to dev[j] */ in ZTEST()
56 TC_PRINT("wrote '%s' to %s\n", buf, name[j]); in ZTEST()
58 zassert_equal(ret[1], strlen(text[j]), "Only wrote %zu/%zu bytes of '%s'", in ZTEST()
59 ret[1], strlen(text[j]), text[j]); in ZTEST()
60 zassert_equal(0, strcmp(text[j], buf), "Strings '%s' and '%s' do not match", in ZTEST()
61 text[j], buf); in ZTEST()
71 for (size_t i = 0, j = 0, N = ARRAY_SIZE(devs); i < 2 * N; i++, j++, j %= N) { in ZTEST() local
72 if (j == normal_uart) { in ZTEST()
73 /* skip testing non-emul uart */ in ZTEST()
80 /* read text[j] from dev[j] */ in ZTEST()
81 ret[0] = devmux_select_set(devmux_dev, j); in ZTEST()
83 ret[1] = uart_emul_put_rx_data(devs[j], (uint8_t *)text[j], strlen(text[j])); in ZTEST()
84 ret[3] = uart_emul_put_rx_data(devs[j], "\n", 1); in ZTEST()
88 zassert_ok(ret[0], "Failed to select devmux %zu", j); in ZTEST()
91 /* verify that text[j] was written to dev[j] */ in ZTEST()
92 TC_PRINT("read '%s' from %s\n", buf, name[j]); in ZTEST()
94 zassert_equal(ret[1], strlen(text[j]), "Only put %zu/%zu bytes of '%s'", in ZTEST()
95 ret[1], strlen(text[j]), text[j]); in ZTEST()
96 zassert_equal(0, strcmp(text[j], buf), "Strings '%s' and '%s' do not match", in ZTEST()
97 text[j], buf); in ZTEST()
106 /* ensure that non-default initial selection via DT works */ in setup()