Home
last modified time | relevance | path

Searched refs:fixture (Results 1 – 25 of 181) sorted by relevance

12345678

/Zephyr-latest/tests/drivers/uart/uart_emul/src/
Dbus.c40 static struct uart_emul_fixture fixture = {.dev = DEVICE_DT_GET(EMUL_UART_NODE)}; in uart_emul_setup() local
43 fixture.sample_data[i] = i; in uart_emul_setup()
47 k_sem_init(&fixture.tx_done_sem, 0, 1); in uart_emul_setup()
48 k_sem_init(&fixture.rx_done_sem, 0, 1); in uart_emul_setup()
52 k_event_init(&fixture.async_events); in uart_emul_setup()
55 zassert_not_null(fixture.dev); in uart_emul_setup()
56 return &fixture; in uart_emul_setup()
61 struct uart_emul_fixture *fixture = f; in uart_emul_before() local
63 uart_emul_flush_rx_data(fixture->dev); in uart_emul_before()
64 uart_emul_flush_tx_data(fixture->dev); in uart_emul_before()
[all …]
Ddevice.c46 static struct uart_emul_device_fixture fixture = {.dev = DEVICE_DT_GET(EMUL_UART_NODE)}; in uart_emul_device_setup() local
49 fixture.sample_data[i] = i; in uart_emul_device_setup()
53 k_sem_init(&fixture.tx_done_sem, 0, 1); in uart_emul_device_setup()
54 k_sem_init(&fixture.rx_done_sem, 0, 1); in uart_emul_device_setup()
58 k_event_init(&fixture.async_events); in uart_emul_device_setup()
61 zassert_not_null(fixture.dev); in uart_emul_device_setup()
62 return &fixture; in uart_emul_device_setup()
67 struct uart_emul_device_fixture *fixture = f; in uart_emul_device_before() local
69 uart_emul_flush_rx_data(fixture->dev); in uart_emul_device_before()
70 uart_emul_flush_tx_data(fixture->dev); in uart_emul_device_before()
[all …]
/Zephyr-latest/tests/drivers/usb/bc12/src/
Dpd_mode.c36 struct bc12_pd_mode_fixture *fixture = user_data; in bc12_test_result_cb() local
38 fixture->callback_count++; in bc12_test_result_cb()
48 fixture->partner_state = *state; in bc12_test_result_cb()
51 fixture->disconnect_detected = true; in bc12_test_result_cb()
52 fixture->partner_state.type = BC12_TYPE_NONE; in bc12_test_result_cb()
53 fixture->partner_state.current_ua = 0; in bc12_test_result_cb()
54 fixture->partner_state.voltage_uv = 0; in bc12_test_result_cb()
60 bc12_emul_set_charging_partner(fixture->bc12_emul, BC12_TYPE_NONE); in ZTEST_USER_F()
62 bc12_set_role(fixture->bc12_dev, BC12_PORTABLE_DEVICE); in ZTEST_USER_F()
67 zassert_equal(fixture->callback_count, 0); in ZTEST_USER_F()
[all …]
Dcharging_mode.c34 struct bc12_pi3usb9201_charging_mode_fixture *fixture = user_data; in bc12_test_result_cb() local
44 fixture->partner_state = *state; in bc12_test_result_cb()
47 fixture->partner_state.type = BC12_TYPE_NONE; in bc12_test_result_cb()
48 fixture->partner_state.current_ua = 0; in bc12_test_result_cb()
49 fixture->partner_state.voltage_uv = 0; in bc12_test_result_cb()
55 bc12_set_role(fixture->bc12_dev, BC12_CHARGING_PORT); in ZTEST_USER_F()
57 bc12_emul_set_pd_partner(fixture->bc12_emul, true); in ZTEST_USER_F()
61 zassert_true(fixture->partner_state.pd_partner_connected); in ZTEST_USER_F()
63 bc12_emul_set_pd_partner(fixture->bc12_emul, false); in ZTEST_USER_F()
67 zassert_false(fixture->partner_state.pd_partner_connected); in ZTEST_USER_F()
[all …]
/Zephyr-latest/tests/drivers/stepper/drv8424/api/src/
Dmain.c46 static struct drv8424_api_fixture fixture = { in drv8424_api_setup() local
55 zassert_not_null(fixture.dev); in drv8424_api_setup()
56 return &fixture; in drv8424_api_setup()
61 struct drv8424_api_fixture *fixture = f; in drv8424_api_before() local
62 (void)stepper_set_reference_position(fixture->dev, 0); in drv8424_api_before()
63 (void)stepper_set_micro_step_res(fixture->dev, 1); in drv8424_api_before()
69 struct drv8424_api_fixture *fixture = f; in drv8424_api_after() local
70 (void)stepper_run(fixture->dev, STEPPER_DIRECTION_POSITIVE, 0); in drv8424_api_after()
75 (void)stepper_set_micro_step_res(fixture->dev, 4); in ZTEST_F()
77 (void)stepper_get_micro_step_res(fixture->dev, &res); in ZTEST_F()
[all …]
/Zephyr-latest/tests/lib/c_lib/thrd/src/
Dcnd.c53 zassert_equal(thrd_error, cnd_wait(NULL, &fixture->mutex)); in ZTEST_F()
54 zassert_equal(thrd_error, cnd_wait(&fixture->cond, NULL)); in ZTEST_F()
56 zassert_equal(thrd_error, cnd_timedwait(NULL, NULL, &fixture->time_point)); in ZTEST_F()
57 zassert_equal(thrd_error, cnd_timedwait(NULL, &fixture->mutex, NULL)); in ZTEST_F()
59 cnd_timedwait(NULL, &fixture->mutex, &fixture->time_point)); in ZTEST_F()
60 zassert_equal(thrd_error, cnd_timedwait(&fixture->cond, NULL, NULL)); in ZTEST_F()
62 cnd_timedwait(&fixture->cond, NULL, &fixture->time_point)); in ZTEST_F()
63 zassert_equal(thrd_error, cnd_timedwait(&fixture->cond, &fixture->mutex, NULL)); in ZTEST_F()
71 struct libc_cnd_fixture *const fixture = arg; in test_cnd_thread_fn() local
73 if (fixture->do_timedwait) { in test_cnd_thread_fn()
[all …]
/Zephyr-latest/tests/bluetooth/audio/ascs/src/
Dtest_ase_control_params.c41 struct test_ase_control_params_fixture *fixture; in test_ase_control_params_setup() local
43 fixture = malloc(sizeof(*fixture)); in test_ase_control_params_setup()
44 zassert_not_null(fixture); in test_ase_control_params_setup()
46 return fixture; in test_ase_control_params_setup()
51 struct test_ase_control_params_fixture *fixture = f; in test_ase_control_params_before() local
58 ARG_UNUSED(fixture); in test_ase_control_params_before()
66 test_conn_init(&fixture->conn); in test_ase_control_params_before()
67 fixture->ase_cp = test_ase_control_point_get(); in test_ase_control_params_before()
70 test_ase_snk_get(CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT, &fixture->ase); in test_ase_control_params_before()
72 test_ase_src_get(CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT, &fixture->ase); in test_ase_control_params_before()
[all …]
Dtest_ase_state_transition.c48 struct test_ase_state_transition_fixture *fixture; in test_sink_ase_state_transition_setup() local
50 fixture = malloc(sizeof(*fixture)); in test_sink_ase_state_transition_setup()
51 zassert_not_null(fixture); in test_sink_ase_state_transition_setup()
53 return fixture; in test_sink_ase_state_transition_setup()
58 struct test_ase_state_transition_fixture *fixture = in test_ase_snk_state_transition_before() local
72 memset(fixture, 0, sizeof(struct test_ase_state_transition_fixture)); in test_ase_snk_state_transition_before()
73 test_conn_init(&fixture->conn); in test_ase_snk_state_transition_before()
74 test_ase_snk_get(1, &fixture->ase.attr); in test_ase_snk_state_transition_before()
75 if (fixture->ase.attr != NULL) { in test_ase_snk_state_transition_before()
76 fixture->ase.id = test_ase_id_get(fixture->ase.attr); in test_ase_snk_state_transition_before()
[all …]
Dmain.c43 static void mock_init_rule_before(const struct ztest_unit_test *test, void *fixture) in mock_init_rule_before() argument
48 static void mock_destroy_rule_after(const struct ztest_unit_test *test, void *fixture) in mock_destroy_rule_after() argument
65 static void ascs_test_suite_fixture_init(struct ascs_test_suite_fixture *fixture) in ascs_test_suite_fixture_init() argument
73 memset(fixture, 0, sizeof(*fixture)); in ascs_test_suite_fixture_init()
78 fixture->ase_cp = test_ase_control_point_get(); in ascs_test_suite_fixture_init()
80 test_conn_init(&fixture->conn); in ascs_test_suite_fixture_init()
82 test_ase_snk_get(CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT, &fixture->ase_snk.attr); in ascs_test_suite_fixture_init()
83 if (fixture->ase_snk.attr != NULL) { in ascs_test_suite_fixture_init()
84 fixture->ase_snk.id = test_ase_id_get(fixture->ase_snk.attr); in ascs_test_suite_fixture_init()
87 test_ase_src_get(CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT, &fixture->ase_src.attr); in ascs_test_suite_fixture_init()
[all …]
/Zephyr-latest/tests/drivers/gpio/gpio_get_direction/src/
Dmain.c23 static struct gpio_get_direction_fixture fixture; in gpio_get_direction_setup() local
25 fixture.pin = TEST_PIN; in gpio_get_direction_setup()
26 fixture.port = DEVICE_DT_GET(TEST_NODE); in gpio_get_direction_setup()
28 return &fixture; in gpio_get_direction_setup()
33 struct gpio_get_direction_fixture *fixture = (struct gpio_get_direction_fixture *)arg; in gpio_get_direction_before() local
35 zassert_true(device_is_ready(fixture->port), "GPIO device is not ready"); in gpio_get_direction_before()
38 static void common(struct gpio_get_direction_fixture *fixture) in common() argument
42 rv = gpio_pin_configure(fixture->port, fixture->pin, fixture->flags); in common()
55 fixture->flags = GPIO_DISCONNECTED; in ZTEST_F()
56 common(fixture); in ZTEST_F()
[all …]
/Zephyr-latest/tests/kernel/interrupt/src/
Ddynamic_shared_irq.c17 static struct shared_irq_fixture fixture; variable
36 arch_irq_disconnect_dynamic(fixture.irq1, fixture.irq_priority, in dynamic_shared_irq_suite_after()
38 arch_irq_disconnect_dynamic(fixture.irq1, fixture.irq_priority, in dynamic_shared_irq_suite_after()
40 arch_irq_disconnect_dynamic(fixture.irq2, fixture.irq_priority, in dynamic_shared_irq_suite_after()
86 fixture.irq1 = get_irq_slot(CONFIG_GEN_IRQ_START_VECTOR); in dynamic_shared_irq_suite_setup()
87 zassert_true(fixture.irq1 != TEST_INVALID_IRQ, in dynamic_shared_irq_suite_setup()
89 fixture.irq2 = get_irq_slot(fixture.irq1 + 1); in dynamic_shared_irq_suite_setup()
90 zassert_true(fixture.irq2 != TEST_INVALID_IRQ, in dynamic_shared_irq_suite_setup()
92 fixture.irq_priority = IRQ_PRIORITY; in dynamic_shared_irq_suite_setup()
94 fixture.irq1_table_idx = fixture.irq1 - CONFIG_GEN_IRQ_START_VECTOR; in dynamic_shared_irq_suite_setup()
[all …]
/Zephyr-latest/tests/bluetooth/audio/cap_commander/src/
Dtest_broadcast_reception.c60 struct cap_commander_test_broadcast_reception_fixture *fixture) in cap_commander_test_broadcast_reception_fixture_init() argument
64 for (size_t i = 0; i < ARRAY_SIZE(fixture->conns); i++) { in cap_commander_test_broadcast_reception_fixture_init()
65 test_conn_init(&fixture->conns[i]); in cap_commander_test_broadcast_reception_fixture_init()
66 fixture->conns[i].index = i; in cap_commander_test_broadcast_reception_fixture_init()
68 test_start_param_init(fixture); in cap_commander_test_broadcast_reception_fixture_init()
69 test_stop_param_init(fixture); in cap_commander_test_broadcast_reception_fixture_init()
71 fixture->broadcast_assistant_cb.recv_state = in cap_commander_test_broadcast_reception_fixture_init()
73 err = bt_bap_broadcast_assistant_register_cb(&fixture->broadcast_assistant_cb); in cap_commander_test_broadcast_reception_fixture_init()
79 struct cap_commander_test_broadcast_reception_fixture *fixture; in cap_commander_test_broadcast_reception_setup() local
81 fixture = malloc(sizeof(*fixture)); in cap_commander_test_broadcast_reception_setup()
[all …]
Dtest_distribute_broadcast_code.c41 struct cap_commander_test_distribute_broadcast_code_fixture *fixture) in cap_commander_test_distribute_broadcast_code_fixture_init() argument
43 for (size_t i = 0; i < ARRAY_SIZE(fixture->conns); i++) { in cap_commander_test_distribute_broadcast_code_fixture_init()
44 test_conn_init(&fixture->conns[i]); in cap_commander_test_distribute_broadcast_code_fixture_init()
45 fixture->conns[i].index = i; in cap_commander_test_distribute_broadcast_code_fixture_init()
48 fixture->distribute_broadcast_code_param.type = BT_CAP_SET_TYPE_AD_HOC; in cap_commander_test_distribute_broadcast_code_fixture_init()
49 fixture->distribute_broadcast_code_param.param = fixture->broadcast_code_member_params; in cap_commander_test_distribute_broadcast_code_fixture_init()
50 fixture->distribute_broadcast_code_param.count = in cap_commander_test_distribute_broadcast_code_fixture_init()
51 ARRAY_SIZE(fixture->broadcast_code_member_params); in cap_commander_test_distribute_broadcast_code_fixture_init()
52 memcpy(fixture->distribute_broadcast_code_param.broadcast_code, BROADCAST_CODE, in cap_commander_test_distribute_broadcast_code_fixture_init()
54 for (size_t i = 0; i < ARRAY_SIZE(fixture->broadcast_code_member_params); i++) { in cap_commander_test_distribute_broadcast_code_fixture_init()
[all …]
/Zephyr-latest/tests/drivers/sensor/adltc2990/src/
Dmain.c17 zassert_ok(sensor_sample_fetch_chan(fixture->dev, SENSOR_CHAN_VOLTAGE)); \
18 zassert_ok(sensor_channel_get(fixture->dev, SENSOR_CHAN_VOLTAGE, sensor_val)); \
31 zassert_ok(sensor_sample_fetch_chan(fixture->dev, SENSOR_CHAN_CURRENT)); \
32 zassert_ok(sensor_channel_get(fixture->dev, SENSOR_CHAN_CURRENT, sensor_val)); \
47 zassert_ok(sensor_sample_fetch_chan(fixture->dev, temperature_type)); \
48 zassert_ok(sensor_channel_get(fixture->dev, temperature_type, sensor_val)); \
63 static struct adltc2990_0_0_fixture fixture = { in adltc2990_0_0_setup() local
68 zassert_not_null(fixture.dev); in adltc2990_0_0_setup()
69 zassert_not_null(fixture.target); in adltc2990_0_0_setup()
70 return &fixture; in adltc2990_0_0_setup()
[all …]
/Zephyr-latest/tests/bluetooth/audio/bap_broadcast_source/src/
Dmain.c36 static void mock_init_rule_before(const struct ztest_unit_test *test, void *fixture) in mock_init_rule_before() argument
42 static void mock_destroy_rule_after(const struct ztest_unit_test *test, void *fixture) in mock_destroy_rule_after() argument
56 struct bap_broadcast_source_test_suite_fixture *fixture) in bap_broadcast_source_test_suite_fixture_init() argument
82 fixture->param = malloc(sizeof(struct bt_bap_broadcast_source_param)); in bap_broadcast_source_test_suite_fixture_init()
99 memset(fixture->param, 0, sizeof(*fixture->param)); in bap_broadcast_source_test_suite_fixture_init()
130 fixture->param->params_count = CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT; in bap_broadcast_source_test_suite_fixture_init()
131 fixture->param->params = subgroup_param; in bap_broadcast_source_test_suite_fixture_init()
132 fixture->param->qos = qos_cfg; in bap_broadcast_source_test_suite_fixture_init()
133 fixture->param->encryption = false; in bap_broadcast_source_test_suite_fixture_init()
134 memset(fixture->param->broadcast_code, 0, sizeof(fixture->param->broadcast_code)); in bap_broadcast_source_test_suite_fixture_init()
[all …]
/Zephyr-latest/tests/subsys/fs/nvs/src/
Dmain.c51 static struct nvs_fixture fixture; in setup() local
58 fixture.fs.offset = TEST_NVS_FLASH_AREA_OFFSET; in setup()
59 err = flash_get_page_info_by_offs(flash_area_get_device(fa), fixture.fs.offset, in setup()
63 fixture.fs.sector_size = info.size; in setup()
64 fixture.fs.sector_count = TEST_SECTOR_COUNT; in setup()
65 fixture.fs.flash_device = flash_area_get_device(fa); in setup()
67 return &fixture; in setup()
72 struct nvs_fixture *fixture = (struct nvs_fixture *)data; in before() local
74 fixture->sim_stats = stats_group_find("flash_sim_stats"); in before()
75 fixture->sim_thresholds = stats_group_find("flash_sim_thresholds"); in before()
[all …]
/Zephyr-latest/tests/subsys/fs/zms/src/
Dmain.c49 static struct zms_fixture fixture; in setup() local
56 fixture.fs.offset = TEST_ZMS_AREA_OFFSET; in setup()
57 err = flash_get_page_info_by_offs(flash_area_get_device(fa), fixture.fs.offset, &info); in setup()
60 fixture.fs.sector_size = info.size; in setup()
61 fixture.fs.sector_count = TEST_SECTOR_COUNT; in setup()
62 fixture.fs.flash_device = flash_area_get_device(fa); in setup()
64 return &fixture; in setup()
69 struct zms_fixture *fixture = (struct zms_fixture *)data; in before() local
71 fixture->sim_stats = stats_group_find("flash_sim_stats"); in before()
72 fixture->sim_thresholds = stats_group_find("flash_sim_thresholds"); in before()
[all …]
/Zephyr-latest/tests/drivers/gpio/gpio_enable_disable_interrupt/src/
Dmain.c28 static struct gpio_enable_disable_interrupt_fixture fixture; in gpio_enable_disable_interrupt_setup() local
30 fixture.irq_spec = &irq_pin; in gpio_enable_disable_interrupt_setup()
32 return &fixture; in gpio_enable_disable_interrupt_setup()
37 struct gpio_enable_disable_interrupt_fixture *fixture = in gpio_enable_disable_interrupt_before() local
40 zassert_true(gpio_is_ready_dt(fixture->irq_spec), "GPIO device is not ready"); in gpio_enable_disable_interrupt_before()
42 zassert_ok(gpio_pin_configure_dt(fixture->irq_spec, GPIO_INPUT)); in gpio_enable_disable_interrupt_before()
43 zassert_ok(gpio_emul_input_set(fixture->irq_spec->port, fixture->irq_spec->pin, 0), in gpio_enable_disable_interrupt_before()
47 zassert_ok(gpio_pin_interrupt_configure_dt(fixture->irq_spec, GPIO_INT_DISABLE)); in gpio_enable_disable_interrupt_before()
48 gpio_init_callback(&cb_data, callback, BIT(fixture->irq_spec->pin)); in gpio_enable_disable_interrupt_before()
49 zassert_ok(gpio_add_callback(fixture->irq_spec->port, &cb_data), "failed to add callback"); in gpio_enable_disable_interrupt_before()
[all …]
/Zephyr-latest/tests/posix/eventfd/src/
Dnonblocking.c14 reopen(&fixture->fd, 0, EFD_NONBLOCK); in ZTEST_F()
16 ret = eventfd_read(fixture->fd, &val); in ZTEST_F()
20 ret = eventfd_write(fixture->fd, TESTVAL); in ZTEST_F()
23 ret = eventfd_read(fixture->fd, &val); in ZTEST_F()
27 ret = eventfd_read(fixture->fd, &val); in ZTEST_F()
34 reopen(&fixture->fd, TESTVAL, EFD_NONBLOCK); in ZTEST_F()
35 eventfd_poll_set_common(fixture->fd); in ZTEST_F()
40 reopen(&fixture->fd, 0, EFD_NONBLOCK); in ZTEST_F()
41 eventfd_poll_unset_common(fixture->fd); in ZTEST_F()
49 reopen(&fixture->fd, 0, EFD_NONBLOCK); in ZTEST_F()
[all …]
Dblocking.c14 ret = eventfd_write(fixture->fd, 3); in ZTEST_F()
17 ret = eventfd_write(fixture->fd, 2); in ZTEST_F()
20 ret = eventfd_read(fixture->fd, &val); in ZTEST_F()
25 reopen(&fixture->fd, 0, EFD_SEMAPHORE); in ZTEST_F()
27 ret = eventfd_write(fixture->fd, 3); in ZTEST_F()
30 ret = eventfd_write(fixture->fd, 2); in ZTEST_F()
33 ret = eventfd_read(fixture->fd, &val); in ZTEST_F()
43 ret = eventfd_write(fixture->fd, 0); in ZTEST_F()
44 zassert_equal(ret, 0, "fd == %d", fixture->fd); in ZTEST_F()
47 ret = is_blocked(fixture->fd, &event); in ZTEST_F()
[all …]
/Zephyr-latest/tests/subsys/shell/shell_backend_uart/src/
Dmain.c29 struct shell_backend_uart_fixture *fixture = f; in before() local
31 uart_irq_tx_enable(fixture->dev); in before()
32 uart_irq_rx_enable(fixture->dev); in before()
34 uart_err_check(fixture->dev); in before()
39 struct shell_backend_uart_fixture *fixture = f; in after() local
41 uart_irq_tx_disable(fixture->dev); in after()
42 uart_irq_rx_disable(fixture->dev); in after()
44 uart_emul_flush_rx_data(fixture->dev); in after()
45 uart_emul_flush_tx_data(fixture->dev); in after()
59 uart_emul_put_rx_data(fixture->dev, "kernel version\n", sizeof("kernel version\n")); in ZTEST_F()
[all …]
/Zephyr-latest/tests/bluetooth/audio/cap_initiator/src/
Dtest_unicast_stop.c43 struct cap_initiator_test_unicast_stop_fixture *fixture) in cap_initiator_test_unicast_stop_fixture_init() argument
45 fixture->preset = (struct bt_bap_lc3_preset)BT_BAP_LC3_UNICAST_PRESET_16_2_1( in cap_initiator_test_unicast_stop_fixture_init()
48 for (size_t i = 0U; i < ARRAY_SIZE(fixture->conns); i++) { in cap_initiator_test_unicast_stop_fixture_init()
49 test_conn_init(&fixture->conns[i]); in cap_initiator_test_unicast_stop_fixture_init()
52 for (size_t i = 0U; i < ARRAY_SIZE(fixture->eps); i++) { in cap_initiator_test_unicast_stop_fixture_init()
53 fixture->eps[i].dir = (i & 1) + 1; /* Makes it either 1 or 2 (sink or source)*/ in cap_initiator_test_unicast_stop_fixture_init()
56 for (size_t i = 0U; i < ARRAY_SIZE(fixture->cap_streams); i++) { in cap_initiator_test_unicast_stop_fixture_init()
57 struct bt_cap_stream *cap_stream = &fixture->cap_streams[i]; in cap_initiator_test_unicast_stop_fixture_init()
60 sys_slist_append(&fixture->unicast_group.streams, &bap_stream->_node); in cap_initiator_test_unicast_stop_fixture_init()
61 bap_stream->group = &fixture->unicast_group; in cap_initiator_test_unicast_stop_fixture_init()
[all …]
Dtest_unicast_start.c42 struct cap_initiator_test_unicast_start_fixture *fixture) in cap_initiator_test_unicast_start_fixture_init() argument
44 fixture->preset = (struct bt_bap_lc3_preset)BT_BAP_LC3_UNICAST_PRESET_16_2_1( in cap_initiator_test_unicast_start_fixture_init()
47 for (size_t i = 0U; i < ARRAY_SIZE(fixture->conns); i++) { in cap_initiator_test_unicast_start_fixture_init()
48 test_conn_init(&fixture->conns[i]); in cap_initiator_test_unicast_start_fixture_init()
51 for (size_t i = 0U; i < ARRAY_SIZE(fixture->cap_streams); i++) { in cap_initiator_test_unicast_start_fixture_init()
52 struct bt_bap_stream *bap_stream = &fixture->cap_streams[i].bap_stream; in cap_initiator_test_unicast_start_fixture_init()
54 sys_slist_append(&fixture->unicast_group.streams, &bap_stream->_node); in cap_initiator_test_unicast_start_fixture_init()
55 bap_stream->group = &fixture->unicast_group; in cap_initiator_test_unicast_start_fixture_init()
58 for (size_t i = 0U; i < ARRAY_SIZE(fixture->eps); i++) { in cap_initiator_test_unicast_start_fixture_init()
59 fixture->eps[i].dir = (i & 1) + 1; /* Makes it either 1 or 2 (sink or source)*/ in cap_initiator_test_unicast_start_fixture_init()
[all …]
/Zephyr-latest/tests/drivers/sensor/ina237/src/
Dina237_test.c49 static void test_shunt_cal(struct ina237_fixture *fixture) in test_shunt_cal() argument
52 double shunt_cal = 819.2e6 * fixture->current_lsb_uA * 1e-6 * fixture->rshunt_uOhms * 1e-6; in test_shunt_cal()
54 if (fixture->config & INA237_CFG_HIGH_PRECISION) { in test_shunt_cal()
62 zassert_ok(ina237_mock_get_register(fixture->mock->data, INA237_REG_CALIB, in test_shunt_cal()
68 static void test_current(struct ina237_fixture *fixture) in test_current() argument
86 double current_expected_A = fixture->current_lsb_uA * 1e-6 * current_register; in test_current()
89 ina237_mock_set_register(fixture->mock->data, INA237_REG_CURRENT, current_register); in test_current()
92 zassert_ok(sensor_sample_fetch(fixture->dev)); in test_current()
93 zassert_ok(sensor_channel_get(fixture->dev, SENSOR_CHAN_CURRENT, &sensor_val)); in test_current()
96 zexpect_within(current_expected_A, current_actual_A, fixture->current_lsb_uA*1e-6, in test_current()
[all …]
/Zephyr-latest/tests/drivers/stepper/stepper_api/src/
Dmain.c43 static struct stepper_fixture fixture = { in stepper_setup() local
52 zassert_not_null(fixture.dev); in stepper_setup()
53 (void)stepper_enable(fixture.dev, true); in stepper_setup()
54 return &fixture; in stepper_setup()
59 struct stepper_fixture *fixture = f; in stepper_before() local
60 (void)stepper_set_reference_position(fixture->dev, 0); in stepper_before()
68 (void)stepper_set_micro_step_res(fixture->dev, 2); in ZTEST_F()
70 (void)stepper_get_micro_step_res(fixture->dev, &res); in ZTEST_F()
77 (void)stepper_set_reference_position(fixture->dev, pos); in ZTEST_F()
78 (void)stepper_get_actual_position(fixture->dev, &pos); in ZTEST_F()
[all …]

12345678