/Zephyr-latest/tests/drivers/eeprom/api/src/ |
D | main.c | 28 int rc; in ZTEST_USER() local 32 rc = eeprom_write(eeprom, size - 1, data, sizeof(data)); in ZTEST_USER() 33 zassert_equal(-EINVAL, rc, "Unexpected error code (%d)", rc); in ZTEST_USER() 44 int rc; in ZTEST_USER() local 50 rc = eeprom_write(eeprom, address, wr_buf1, sizeof(wr_buf1)); in ZTEST_USER() 51 zassert_equal(0, rc, "Unexpected error code (%d)", rc); in ZTEST_USER() 53 rc = eeprom_read(eeprom, address, rd_buf, sizeof(rd_buf)); in ZTEST_USER() 54 zassert_equal(0, rc, "Unexpected error code (%d)", rc); in ZTEST_USER() 56 rc = memcmp(wr_buf1, rd_buf, sizeof(wr_buf1)); in ZTEST_USER() 57 zassert_equal(0, rc, "Unexpected error code (%d)", rc); in ZTEST_USER() [all …]
|
/Zephyr-latest/tests/drivers/flash/negative_tests/src/ |
D | main.c | 55 int rc; in flash_driver_setup() local 65 rc = flash_get_page_info_by_offs(flash_dev, TEST_AREA_OFFSET, &page_info); in flash_driver_setup() 66 zassert_true(rc == 0, "flash_get_page_info_by_offs returned %d", rc); in flash_driver_setup() 78 int rc; in ZTEST() local 92 rc = flash_erase(flash_dev, (TEST_FLASH_START - page_info.size), page_info.size); in ZTEST() 93 zassert_true(rc < 0, "Invalid use of flash_erase returned %d", rc); in ZTEST() 96 rc = flash_erase(flash_dev, (TEST_FLASH_START + TEST_FLASH_SIZE), page_info.size); in ZTEST() 97 zassert_true(rc < 0, "Invalid use of flash_erase returned %d", rc); in ZTEST() 100 rc = flash_erase(flash_dev, (TEST_AREA_OFFSET + 1), (TEST_FLASH_SIZE + 1)); in ZTEST() 101 zassert_true(rc < 0, "Invalid use of flash_erase returned %d", rc); in ZTEST() [all …]
|
/Zephyr-latest/samples/subsys/fs/zms/src/ |
D | main.c | 34 int rc = 0; in delete_and_verify_items() local 36 rc = zms_delete(fs, id); in delete_and_verify_items() 37 if (rc) { in delete_and_verify_items() 40 rc = zms_get_data_length(fs, id); in delete_and_verify_items() 41 if (rc > 0) { in delete_and_verify_items() 47 printk("Error while deleting item rc=%d\n", rc); in delete_and_verify_items() 48 return rc; in delete_and_verify_items() 56 int rc = 0; in delete_basic_items() local 58 rc = delete_and_verify_items(fs, IP_ADDRESS_ID); in delete_basic_items() 59 if (rc) { in delete_basic_items() [all …]
|
/Zephyr-latest/tests/drivers/gpio/gpio_basic_api/src/ |
D | test_gpio_port.c | 19 int rc = gpio_port_get_raw(dev_in, &v); in raw_in() local 23 rc = gpio_port_get_raw(dev_in, &v); in raw_in() 25 zassert_equal(rc, 0, in raw_in() 34 int rc = gpio_port_get(dev_in, &v); in logic_in() local 38 rc = gpio_port_get(dev_in, &v); in logic_in() 40 zassert_equal(rc, 0, in logic_in() 48 int rc; in raw_out() local 51 rc = gpio_port_set_bits_raw(dev_out, BIT(PIN_OUT)); in raw_out() 53 rc = gpio_port_clear_bits_raw(dev_out, BIT(PIN_OUT)); in raw_out() 55 zassert_equal(rc, 0, in raw_out() [all …]
|
/Zephyr-latest/tests/boards/nrf/qdec/src/ |
D | main.c | 57 int rc; in qenc_emulate_reset_pin() local 59 rc = gpio_pin_set_dt(gpio_dt, 0); in qenc_emulate_reset_pin() 60 zassert_ok(rc, "%s: pin set failed: %d", gpio_dt->port->name, rc); in qenc_emulate_reset_pin() 65 int rc; in qenc_emulate_setup_pin() local 67 rc = gpio_is_ready_dt(gpio_dt); in qenc_emulate_setup_pin() 68 zassert_true(rc, "%s: device not ready: %d", gpio_dt->port->name, rc); in qenc_emulate_setup_pin() 70 rc = gpio_pin_configure_dt(gpio_dt, GPIO_OUTPUT); in qenc_emulate_setup_pin() 71 zassert_true(rc == 0, "%s: pin configure failed: %d", gpio_dt->port->name, rc); in qenc_emulate_setup_pin() 95 int rc; in qenc_emulate_verify_reading() local 110 rc = sensor_sample_fetch(qdec_dev); in qenc_emulate_verify_reading() [all …]
|
/Zephyr-latest/tests/unit/cbprintf/ |
D | main.c | 239 #define TEST_PRF2(rc, _fmt, ...) do { \ argument 266 *rc = prf(sp_buf, _fmt, __VA_ARGS__); \ 269 #define TEST_PRF(rc, _fmt, ...) \ argument 270 TEST_PRF2(rc, WRAP_FMT(_fmt), PASS_ARG(__VA_ARGS__)) 273 #define TEST_PRF_LONG_DOUBLE(rc, _fmt, ...) \ argument 274 TEST_PRF(rc, _fmt, __VA_ARGS__) 277 #define TEST_PRF_LONG_DOUBLE(rc, _fmt, ...) \ argument 278 *rc = prf(NULL, WRAP_FMT(_fmt), PASS_ARG(__VA_ARGS__)) 319 int rc; in prf_check() local 322 rc = match_pfx(&str); in prf_check() [all …]
|
/Zephyr-latest/tests/subsys/mgmt/mcumgr/mcumgr_client/src/ |
D | main.c | 32 int rc; in ZTEST() local 40 rc = img_mgmt_client_upload_init(&img_client, TEST_IMAGE_SIZE, TEST_IMAGE_NUM, image_hash); in ZTEST() 41 zassert_equal(MGMT_ERR_EOK, rc, "Expected to receive %d response %d", MGMT_ERR_EOK, rc); in ZTEST() 43 rc = img_mgmt_client_upload(&img_client, image_dummy, 1024, &response); in ZTEST() 44 zassert_equal(MGMT_ERR_ETIMEOUT, rc, "Expected to receive %d response %d", in ZTEST() 45 MGMT_ERR_ETIMEOUT, rc); in ZTEST() 48 rc = img_mgmt_client_upload_init(&img_client, TEST_IMAGE_SIZE, TEST_IMAGE_NUM, image_hash); in ZTEST() 49 zassert_equal(MGMT_ERR_EOK, rc, "Expected to receive %d response %d", MGMT_ERR_EOK, rc); in ZTEST() 50 rc = img_mgmt_client_upload_init(&img_client, TEST_IMAGE_SIZE, TEST_IMAGE_NUM, image_hash); in ZTEST() 51 zassert_equal(MGMT_ERR_EOK, rc, "Expected to receive %d response %d", MGMT_ERR_EOK, rc); in ZTEST() [all …]
|
/Zephyr-latest/tests/drivers/flash_simulator/flash_sim_impl/src/ |
D | main.c | 68 int rc; in test_check_pattern32() local 71 rc = flash_read(flash_dev, start + off, &r_val32, in test_check_pattern32() 73 zassert_equal(0, rc, "flash_write should succeed"); in test_check_pattern32() 86 int rc; in test_check_erase() local 99 rc = flash_read(flash_dev, offset + i, in test_check_erase() 101 if (rc < 0) { in test_check_erase() 104 return rc; in test_check_erase() 130 int rc; in ZTEST() local 132 rc = flash_erase(flash_dev, FLASH_SIMULATOR_BASE_OFFSET, in ZTEST() 134 zassert_equal(0, rc, "flash_erase should succeed"); in ZTEST() [all …]
|
/Zephyr-latest/tests/subsys/fs/fcb/src/ |
D | fcb_test_reset.c | 13 int rc; in ZTEST() local 22 rc = fcb_walk(fcb, 0, fcb_test_data_walk_cb, &var_cnt); in ZTEST() 23 zassert_true(rc == 0, "fcb_walk call failure"); in ZTEST() 27 rc = fcb_append(fcb, 32, &loc); in ZTEST() 28 zassert_true(rc == 0, "fcb_append call failure"); in ZTEST() 34 rc = fcb_walk(fcb, 0, fcb_test_data_walk_cb, &var_cnt); in ZTEST() 35 zassert_true(rc == 0, "fcb_walk call failure"); in ZTEST() 42 rc = flash_area_write(fcb->fap, FCB_ENTRY_FA_DATA_OFF(loc), test_data, in ZTEST() 44 zassert_true(rc == 0, "flash_area_write call failure"); in ZTEST() 46 rc = fcb_append_finish(fcb, &loc); in ZTEST() [all …]
|
/Zephyr-latest/tests/subsys/storage/flash_map/src/ |
D | main_sha.c | 98 int rc; in ZTEST() local 100 rc = flash_area_open(SLOT1_PARTITION_ID, &fa); in ZTEST() 101 zassert_true(rc == 0, "flash_area_open() fail, error %d\n", rc); in ZTEST() 102 rc = flash_area_erase(fa, 0, fa->fa_size); in ZTEST() 103 zassert_true(rc == 0, "Flash erase failure (%d), error %d\n", rc); in ZTEST() 104 rc = flash_area_write(fa, 0, tst_vec, sizeof(tst_vec)); in ZTEST() 105 zassert_true(rc == 0, "Flash img write, error %d\n", rc); in ZTEST() 107 rc = flash_area_check_int_sha256(NULL, NULL); in ZTEST() 108 zassert_true(rc == -EINVAL, "Flash area check int 256 params 1, 2\n"); in ZTEST() 109 rc = flash_area_check_int_sha256(NULL, &fac); in ZTEST() [all …]
|
/Zephyr-latest/lib/posix/options/ |
D | fs.c | 84 int rc, fd; in zvfs_open() local 99 rc = -EMFILE; in zvfs_open() 108 rc = fs_open(&ptr->file, name, FS_O_CREATE | (mode & O_ACCMODE)); in zvfs_open() 109 if (rc < 0) { in zvfs_open() 112 rc = fs_close(&ptr->file); in zvfs_open() 113 if (rc < 0) { in zvfs_open() 118 rc = fs_open(&ptr->file, name, zmode); in zvfs_open() 119 if (rc < 0) { in zvfs_open() 133 errno = -rc; in zvfs_open() 143 int rc; in fs_close_vmeth() local [all …]
|
/Zephyr-latest/tests/drivers/sensor/temp_sensor/src/ |
D | main.c | 18 int rc; in ZTEST() local 26 rc = sensor_sample_fetch_chan(temp_dev, chan_to_use); in ZTEST() 27 zassert_ok(rc, "Cannot fetch chan sample: %d.", rc); in ZTEST() 29 rc = sensor_channel_get(temp_dev, chan_to_use, &val); in ZTEST() 30 zassert_ok(rc, "Cannot read from channel %d: %d.", in ZTEST() 31 chan_to_use, rc); in ZTEST() 60 int rc; in ZTEST() local 68 rc = sensor_trigger_set(temp_dev, &trig, NULL); in ZTEST() 69 if (rc == -ENOSYS || rc == -ENOTSUP) { in ZTEST() 74 rc = sensor_channel_get(temp_dev, chan_to_use, &val); in ZTEST() [all …]
|
/Zephyr-latest/tests/lib/onoff/src/ |
D | main.c | 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 [all …]
|
/Zephyr-latest/drivers/sensor/silabs/si7210/ |
D | si7210.c | 115 int rc; in si7210_sleep() local 121 rc = i2c_reg_write_byte_dt(&config->bus, SI7210_REG_CTRL3, 0); in si7210_sleep() 122 if (rc < 0) { in si7210_sleep() 124 return rc; in si7210_sleep() 128 rc = i2c_reg_write_byte_dt(&config->bus, SI7210_REG_POWER_CTRL, in si7210_sleep() 130 if (rc < 0) { in si7210_sleep() 132 return rc; in si7210_sleep() 147 int rc; in si7210_wakeup() local 154 rc = i2c_read_dt(&config->bus, &val, 1); in si7210_wakeup() 155 if (rc < 0) { in si7210_wakeup() [all …]
|
/Zephyr-latest/subsys/fs/ |
D | fs.c | 136 int rc = -EINVAL; in fs_open() local 149 rc = fs_get_mnt_point(&mp, file_name, NULL); in fs_open() 150 if (rc < 0) { in fs_open() 152 return rc; in fs_open() 178 rc = mp->fs->open(zfp, file_name, flags); in fs_open() 179 if (rc < 0) { in fs_open() 180 LOG_ERR("file open error (%d)", rc); in fs_open() 182 return rc; in fs_open() 190 rc = mp->fs->truncate(zfp, 0); in fs_open() 191 if (rc < 0) { in fs_open() [all …]
|
/Zephyr-latest/tests/drivers/disk/disk_access/src/ |
D | main.c | 77 int rc; in setup_loopback_backing() local 79 rc = fs_mkfs(FS_FATFS, (uintptr_t)&BACKING_PATH[1], NULL, 0); in setup_loopback_backing() 80 zassert_equal(rc, 0, "Failed to format backing file system"); in setup_loopback_backing() 82 rc = fs_mount(&backing_mount); in setup_loopback_backing() 83 zassert_equal(rc, 0, "Failed to mount backing file system"); in setup_loopback_backing() 88 rc = fs_open(&f, BACKING_PATH "/loopback.img", FS_O_WRITE | FS_O_CREATE); in setup_loopback_backing() 89 zassert_equal(rc, 0, "Failed to create backing file"); in setup_loopback_backing() 91 rc = fs_write(&f, zero_kb, sizeof(zero_kb)); in setup_loopback_backing() 92 zassert_equal(rc, sizeof(zero_kb), "Failed to enlarge backing file"); in setup_loopback_backing() 94 rc = fs_close(&f); in setup_loopback_backing() [all …]
|
/Zephyr-latest/tests/subsys/storage/stream/stream_flash/src/ |
D | main.c | 50 rc = flash_read(fdev, FLASH_BASE + start, read_buf, size); \ 51 zassert_equal(rc, 0, "should succeed"); \ 76 int rc; in erase_flash() local 86 rc = flash_erase(fdev, in erase_flash() 89 zassert_equal(rc, 0, "should succeed"); in erase_flash() 97 int rc; in init_target() local 111 rc = stream_flash_init(&ctx, fdev, generic_buf, BUF_LEN, FLASH_BASE, 0, in init_target() 113 zassert_equal(rc, 0, "expected success"); in init_target() 118 int rc; in ZTEST() local 123 rc = stream_flash_init(&ctx, fdev, generic_buf, BUF_LEN, FLASH_BASE, in ZTEST() [all …]
|
/Zephyr-latest/tests/subsys/settings/file/src/ |
D | settings_test_save_one_file.c | 19 int rc; in ZTEST() local 23 rc = fs_mkdir(TEST_CONFIG_DIR); in ZTEST() 24 zassert_true(rc == 0 || rc == -EEXIST, "can't create directory"); in ZTEST() 29 rc = settings_file_src(&cf); in ZTEST() 30 zassert_true(rc == 0, "can't register FS as configuration source"); in ZTEST() 32 rc = settings_file_dst(&cf); in ZTEST() 33 zassert_true(rc == 0, in ZTEST() 37 rc = settings_save(); in ZTEST() 38 zassert_true(rc == 0, "fs write error"); in ZTEST() 40 rc = test_config_save_one_byte_value("myfoo/mybar", 42); in ZTEST() [all …]
|
D | settings_test_compress_file.c | 25 int rc; in ZTEST() local 30 rc = fs_mkdir(TEST_CONFIG_DIR); in ZTEST() 31 zassert_true(rc == 0 || rc == -EEXIST, "can't create directory"); in ZTEST() 37 rc = settings_file_src(&cf); in ZTEST() 38 zassert_true(rc == 0, "can't register FS as configuration source"); in ZTEST() 41 rc = settings_file_dst(&cf); in ZTEST() 42 zassert_true(rc == 0, in ZTEST() 50 rc = settings_save(); in ZTEST() 51 zassert_true(rc == 0, "fs write error"); in ZTEST() 59 rc = settings_save(); in ZTEST() [all …]
|
/Zephyr-latest/samples/subsys/fs/littlefs/src/ |
D | main.c | 72 int rc, ret; in littlefs_increase_infile_value() local 75 rc = fs_open(&file, fname, FS_O_CREATE | FS_O_RDWR); in littlefs_increase_infile_value() 76 if (rc < 0) { in littlefs_increase_infile_value() 77 LOG_ERR("FAIL: open %s: %d", fname, rc); in littlefs_increase_infile_value() 78 return rc; in littlefs_increase_infile_value() 81 rc = fs_read(&file, &boot_count, sizeof(boot_count)); in littlefs_increase_infile_value() 82 if (rc < 0) { in littlefs_increase_infile_value() 83 LOG_ERR("FAIL: read %s: [rd:%d]", fname, rc); in littlefs_increase_infile_value() 86 LOG_PRINTK("%s read count:%u (bytes: %d)\n", fname, boot_count, rc); in littlefs_increase_infile_value() 88 rc = fs_seek(&file, 0, FS_SEEK_SET); in littlefs_increase_infile_value() [all …]
|
/Zephyr-latest/subsys/dfu/boot/ |
D | mcuboot.c | 81 int rc; in boot_fetch_active_slot() local 84 rc = blinfo_lookup(BLINFO_RUNNING_SLOT, &slot, sizeof(slot)); in boot_fetch_active_slot() 86 if (rc <= 0) { in boot_fetch_active_slot() 87 LOG_ERR("Failed to fetch active slot: %d", rc); in boot_fetch_active_slot() 102 int rc; in boot_read_v1_header() local 104 rc = flash_area_open(area_id, &fa); in boot_read_v1_header() 105 if (rc) { in boot_read_v1_header() 106 return rc; in boot_read_v1_header() 112 rc = flash_area_read(fa, 0, v1_raw, sizeof(*v1_raw)); in boot_read_v1_header() 114 if (rc) { in boot_read_v1_header() [all …]
|
/Zephyr-latest/subsys/logging/backends/ |
D | log_backend_fs.c | 42 int rc = 0; in check_log_volume_available() local 44 while (rc == 0) { in check_log_volume_available() 45 rc = fs_readmount(&index, &name); in check_log_volume_available() 46 if (rc == 0) { in check_log_volume_available() 64 int rc, len; in create_log_dir() local 92 rc = fs_opendir(&dir, w_path); in create_log_dir() 93 if (rc) { in create_log_dir() 95 rc = fs_mkdir(w_path); in create_log_dir() 96 if (rc) { in create_log_dir() 100 rc = fs_closedir(&dir); in create_log_dir() [all …]
|
/Zephyr-latest/tests/unit/base64/ |
D | main.c | 66 int rc; in ZTEST() local 75 rc = base64_encode(buffer, sizeof(buffer), &len, src, 64); in ZTEST() 76 zassert_equal(rc, 0, "Encode test return value"); in ZTEST() 77 rc = memcmp(base64_test_enc, buffer, 88); in ZTEST() 78 zassert_equal(rc, 0, "Encode test comparison"); in ZTEST() 83 rc = base64_decode(buffer, sizeof(buffer), &len, src, 88); in ZTEST() 84 zassert_equal(rc, 0, "Decode test return value"); in ZTEST() 85 rc = memcmp(base64_test_dec, buffer, 64); in ZTEST() 86 zassert_equal(rc, 0, "Decode test comparison"); in ZTEST() 89 rc = base64_encode(buffer, sizeof(buffer), &len, src, 0); in ZTEST() [all …]
|
/Zephyr-latest/subsys/fs/fcb/ |
D | fcb_getnext.c | 16 int rc; in fcb_getnext_in_sector() local 18 rc = fcb_elem_info(fcb, loc); in fcb_getnext_in_sector() 19 if (rc == 0 || rc == -EBADMSG) { in fcb_getnext_in_sector() 24 rc = fcb_elem_info(fcb, loc); in fcb_getnext_in_sector() 25 if (rc != -EBADMSG) { in fcb_getnext_in_sector() 28 } while (rc == -EBADMSG); in fcb_getnext_in_sector() 30 return rc; in fcb_getnext_in_sector() 46 int rc; in fcb_getnext_nolock() local 59 rc = fcb_elem_info(fcb, loc); in fcb_getnext_nolock() 60 switch (rc) { in fcb_getnext_nolock() [all …]
|
/Zephyr-latest/tests/subsys/settings/fcb/src/ |
D | settings_test_save_one_fcb.c | 18 int rc; in ZTEST() local 21 rc = settings_register(&c_test_handlers[0]); in ZTEST() 22 zassert_true(rc == 0 || rc == -EEXIST, "settings_register fail"); in ZTEST() 30 rc = settings_fcb_src(&cf); in ZTEST() 31 zassert_true(rc == 0, "can't register FCB as configuration source"); in ZTEST() 34 rc = settings_fcb_dst(&cf); in ZTEST() 35 zassert_true(rc == 0, in ZTEST() 39 rc = settings_save(); in ZTEST() 40 zassert_true(rc == 0, "fcb write error"); in ZTEST() 42 rc = test_config_save_one_byte_value("myfoo/mybar", 42); in ZTEST() [all …]
|