tests: mgmt: Adapt to API changes in zcbor 0.8.0
zcbor_new_state and zcbor_tstr_put_term Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
This commit is contained in:
parent
527af809f8
commit
223b4c372f
16 changed files with 97 additions and 93 deletions
|
@ -29,7 +29,7 @@ bool create_mcumgr_format_packet(zcbor_state_t *zse, uint8_t *buffer, uint8_t *o
|
|||
|
||||
ok = zcbor_map_start_encode(zse, 2) &&
|
||||
zcbor_tstr_put_lit(zse, "d") &&
|
||||
zcbor_tstr_put_term(zse, "some test data") &&
|
||||
zcbor_tstr_put_lit(zse, "some test data") &&
|
||||
zcbor_map_end_encode(zse, 2);
|
||||
|
||||
*buffer_size = (zse->payload_mut - buffer);
|
||||
|
|
|
@ -97,7 +97,7 @@ ZTEST(fs_mgmt_hash_supported, test_supported)
|
|||
|
||||
/* Search expected type array for this type and update details */
|
||||
zcbor_new_decode_state(state, 10, &nb->data[sizeof(struct smp_hdr)],
|
||||
(nb->len - sizeof(struct smp_hdr)), 1);
|
||||
(nb->len - sizeof(struct smp_hdr)), 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_start_decode(state);
|
||||
|
||||
|
|
|
@ -120,9 +120,10 @@ void img_read_response(int count)
|
|||
zcbor_tstr_put_lit(zse, "slot") &&
|
||||
zcbor_uint32_put(zse, image_dummy_info[i].slot_num) &&
|
||||
zcbor_tstr_put_lit(zse, "version") &&
|
||||
zcbor_tstr_put_term(zse, image_dummy_info[i].version) &&
|
||||
zcbor_tstr_put_term(zse, image_dummy_info[i].version,
|
||||
sizeof(image_dummy_info[i].version)) &&
|
||||
|
||||
zcbor_tstr_put_term(zse, "hash") &&
|
||||
zcbor_tstr_put_lit(zse, "hash") &&
|
||||
zcbor_bstr_encode_ptr(zse, image_dummy_info[i].hash, IMG_MGMT_DATA_SHA_LEN) &&
|
||||
ZCBOR_ENCODE_FLAG(zse, "bootable", image_dummy_info[i].flags.bootable) &&
|
||||
ZCBOR_ENCODE_FLAG(zse, "pending", image_dummy_info[i].flags.pending) &&
|
||||
|
@ -180,7 +181,8 @@ void img_state_write_verify(struct net_buf *nb)
|
|||
ZCBOR_MAP_DECODE_KEY_DECODER("hash", zcbor_bstr_decode, &hash)
|
||||
};
|
||||
|
||||
zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data + sizeof(struct smp_hdr), nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data + sizeof(struct smp_hdr), nb->len, 1,
|
||||
NULL, 0);
|
||||
|
||||
decoded = 0;
|
||||
/* Init buffer values */
|
||||
|
@ -231,7 +233,8 @@ void img_upload_init_verify(struct net_buf *nb)
|
|||
ZCBOR_MAP_DECODE_KEY_DECODER("sha", zcbor_bstr_decode, &sha)
|
||||
};
|
||||
|
||||
zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data + sizeof(struct smp_hdr), nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data + sizeof(struct smp_hdr), nb->len, 1,
|
||||
NULL, 0);
|
||||
|
||||
decoded = 0;
|
||||
/* Init buffer values */
|
||||
|
|
|
@ -225,12 +225,12 @@ ZTEST(mcumgr_client, test_os_echo)
|
|||
smp_stub_set_rx_data_verify(NULL);
|
||||
smp_client_send_status_stub(MGMT_ERR_EOK);
|
||||
/* Test timeout */
|
||||
rc = os_mgmt_client_echo(&os_client, os_echo_test);
|
||||
rc = os_mgmt_client_echo(&os_client, os_echo_test, sizeof(os_echo_test));
|
||||
zassert_equal(MGMT_ERR_ETIMEOUT, rc, "Expected to receive %d response %d",
|
||||
MGMT_ERR_ETIMEOUT, rc);
|
||||
/* Test successfully operation */
|
||||
smp_stub_set_rx_data_verify(os_echo_verify);
|
||||
rc = os_mgmt_client_echo(&os_client, os_echo_test);
|
||||
rc = os_mgmt_client_echo(&os_client, os_echo_test, sizeof(os_echo_test));
|
||||
zassert_equal(MGMT_ERR_EOK, rc, "Expected to receive %d response %d", MGMT_ERR_EOK, rc);
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,8 @@ void os_echo_verify(struct net_buf *nb)
|
|||
ZCBOR_MAP_DECODE_KEY_DECODER("d", zcbor_tstr_decode, &echo_data)
|
||||
};
|
||||
|
||||
zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data + sizeof(struct smp_hdr), nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data + sizeof(struct smp_hdr), nb->len, 1,
|
||||
NULL, 0);
|
||||
echo_data.len = 0;
|
||||
|
||||
rc = zcbor_map_decode_bulk(zsd, list_res_decode, ARRAY_SIZE(list_res_decode), &decoded);
|
||||
|
|
|
@ -191,7 +191,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_get_not_set_v1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -253,7 +253,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_get_not_set_v2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -318,7 +318,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v1_1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -365,7 +365,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v1_1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -428,7 +428,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v1_2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -475,7 +475,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v1_2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -538,7 +538,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v1_3)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -585,7 +585,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v1_3)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -648,7 +648,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v2_1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -695,7 +695,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v2_1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -760,7 +760,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v2_2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -807,7 +807,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v2_2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -872,7 +872,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v2_3)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -919,7 +919,7 @@ ZTEST(os_mgmt_datetime_not_set, test_datetime_set_invalid_v2_3)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -984,7 +984,7 @@ ZTEST(os_mgmt_datetime_set, test_datetime_set_v1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -1030,7 +1030,7 @@ ZTEST(os_mgmt_datetime_set, test_datetime_set_v1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -1098,7 +1098,7 @@ ZTEST(os_mgmt_datetime_set, test_datetime_set_v2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -1144,7 +1144,7 @@ ZTEST(os_mgmt_datetime_set, test_datetime_set_v2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -1225,7 +1225,7 @@ ZTEST(os_mgmt_datetime_hook, test_datetime_set_valid_hook_v1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -1287,7 +1287,7 @@ ZTEST(os_mgmt_datetime_hook, test_datetime_set_valid_hook_v1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -1357,7 +1357,7 @@ ZTEST(os_mgmt_datetime_hook, test_datetime_set_valid_hook_v2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -1418,7 +1418,7 @@ ZTEST(os_mgmt_datetime_hook, test_datetime_set_valid_hook_v2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
|
|
@ -51,7 +51,7 @@ bool create_mcumgr_datetime_set_packet_str(zcbor_state_t *zse, bool version2, co
|
|||
{
|
||||
bool ok = zcbor_map_start_encode(zse, 2) &&
|
||||
zcbor_tstr_put_lit(zse, "datetime") &&
|
||||
zcbor_tstr_put_term(zse, data) &&
|
||||
zcbor_tstr_put_term(zse, data, CONFIG_ZCBOR_MAX_STR_LEN) &&
|
||||
zcbor_map_end_encode(zse, 2);
|
||||
|
||||
*buffer_size = (zse->payload_mut - buffer);
|
||||
|
|
|
@ -121,7 +121,7 @@ ZTEST(os_mgmt_info_build_date, test_info_build_date_1_build_date)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -197,7 +197,7 @@ ZTEST(os_mgmt_info_build_date, test_info_build_date_2_all)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ ZTEST(os_mgmt_info_limited, test_info_1_kernel_name)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -147,7 +147,7 @@ ZTEST(os_mgmt_info_limited, test_info_2_all)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
/* Ensure only an error is received */
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
@ -155,7 +155,7 @@ ZTEST(os_mgmt_info_limited, test_info_2_all)
|
|||
zassert_true(ok, "Expected decode to be successful\n");
|
||||
zassert_equal(decoded, 0, "Expected to receive 0 decoded zcbor element\n");
|
||||
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, error_decode, ARRAY_SIZE(error_decode), &decoded) == 0;
|
||||
|
||||
zassert_true(ok, "Expected decode to be successful\n");
|
||||
|
|
|
@ -338,7 +338,7 @@ ZTEST(os_mgmt_info, test_info_2_kernel_name)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -399,7 +399,7 @@ ZTEST(os_mgmt_info, test_info_3_node_name)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -461,7 +461,7 @@ ZTEST(os_mgmt_info, test_info_4_kernel_release)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -523,7 +523,7 @@ ZTEST(os_mgmt_info, test_info_5_kernel_version)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -584,7 +584,7 @@ ZTEST(os_mgmt_info, test_info_6_machine)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -645,7 +645,7 @@ ZTEST(os_mgmt_info, test_info_7_processor)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -706,7 +706,7 @@ ZTEST(os_mgmt_info, test_info_8_platform)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -778,7 +778,7 @@ ZTEST(os_mgmt_info, test_info_9_os)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -839,7 +839,7 @@ ZTEST(os_mgmt_info, test_info_10_all)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -914,7 +914,7 @@ ZTEST(os_mgmt_info, test_info_11_multi_1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -979,7 +979,7 @@ ZTEST(os_mgmt_info, test_info_12_multi_2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -1051,7 +1051,7 @@ ZTEST(os_mgmt_info, test_info_13_invalid_1)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
/* Ensure only an error is received */
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
@ -1059,7 +1059,7 @@ ZTEST(os_mgmt_info, test_info_13_invalid_1)
|
|||
zassert_true(ok, "Expected decode to be successful\n");
|
||||
zassert_equal(decoded, 0, "Expected to receive 0 decoded zcbor element\n");
|
||||
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, error_decode, ARRAY_SIZE(error_decode), &decoded) == 0;
|
||||
|
||||
zassert_true(ok, "Expected decode to be successful\n");
|
||||
|
@ -1122,7 +1122,7 @@ ZTEST(os_mgmt_info, test_info_14_invalid_2)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
/* Ensure only an error is received */
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
@ -1130,7 +1130,7 @@ ZTEST(os_mgmt_info, test_info_14_invalid_2)
|
|||
zassert_true(ok, "Expected decode to be successful\n");
|
||||
zassert_equal(decoded, 0, "Expected to receive 0 decoded zcbor element\n");
|
||||
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, error_decode, ARRAY_SIZE(error_decode), &decoded) == 0;
|
||||
|
||||
zassert_true(ok, "Expected decode to be successful\n");
|
||||
|
@ -1199,7 +1199,7 @@ ZTEST(os_mgmt_info_custom_os, test_info_os_custom)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -1260,7 +1260,7 @@ ZTEST(os_mgmt_info_custom_os_disabled, test_info_os_custom_disabled)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -1333,7 +1333,7 @@ ZTEST(os_mgmt_info_custom_cmd, test_info_cmd_custom)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
|
@ -1399,14 +1399,14 @@ ZTEST(os_mgmt_info_custom_cmd_disabled, test_info_cmd_custom_disabled)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
zassert_true(ok, "Expected decode to be successful\n");
|
||||
zassert_equal(decoded, 0, "Expected to receive 0 decoded zcbor element\n");
|
||||
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, error_decode, ARRAY_SIZE(error_decode), &decoded) == 0;
|
||||
|
||||
zassert_true(ok, "Expected decode to be successful\n");
|
||||
|
@ -1468,14 +1468,14 @@ ZTEST(os_mgmt_info_custom_cmd_disabled_verify, test_info_cmd_custom_disabled)
|
|||
|
||||
/* Process received data by removing header */
|
||||
(void)net_buf_pull(nb, sizeof(struct smp_hdr));
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
zassert_true(ok, "Expected decode to be successful\n");
|
||||
zassert_equal(decoded, 0, "Expected to receive 0 decoded zcbor element\n");
|
||||
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, error_decode, ARRAY_SIZE(error_decode), &decoded) == 0;
|
||||
|
||||
zassert_true(ok, "Expected decode to be successful\n");
|
||||
|
|
|
@ -31,7 +31,7 @@ bool create_mcumgr_format_packet(zcbor_state_t *zse, const uint8_t *format, uint
|
|||
|
||||
ok = zcbor_map_start_encode(zse, 2) &&
|
||||
zcbor_tstr_put_lit(zse, "format") &&
|
||||
zcbor_tstr_put_term(zse, format) &&
|
||||
zcbor_tstr_put_term(zse, format, CONFIG_ZCBOR_MAX_STR_LEN) &&
|
||||
zcbor_map_end_encode(zse, 2);
|
||||
|
||||
*buffer_size = (zse->payload_mut - buffer);
|
||||
|
|
|
@ -487,7 +487,7 @@ ZTEST(settings_mgmt, test_set_read)
|
|||
zassert_equal(smp_header->nh_version, 1, "SMP header version mismatch");
|
||||
|
||||
/* Get the response value to compare */
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode),
|
||||
&decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -590,7 +590,7 @@ ZTEST(settings_mgmt, test_read_max_size)
|
|||
zassert_equal(smp_header->nh_version, 1, "SMP header version mismatch");
|
||||
|
||||
/* Get the response value to compare */
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
zassert_equal(decoded, 2, "Expected to receive 2 decoded zcbor elements");
|
||||
|
@ -745,7 +745,7 @@ ZTEST(settings_mgmt, test_set_disallowed)
|
|||
zassert_equal(smp_header->nh_version, 1, "SMP header version mismatch");
|
||||
|
||||
/* Get the response value to compare */
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
zassert_equal(decoded, 1, "Expected to receive 1 decoded zcbor element");
|
||||
|
@ -875,7 +875,7 @@ ZTEST(settings_mgmt, test_set_disallowed)
|
|||
zassert_equal(smp_header->nh_version, 1, "SMP header version mismatch");
|
||||
|
||||
/* Get the response value to compare */
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
zassert_equal(decoded, 1, "Expected to receive 1 decoded zcbor element");
|
||||
|
@ -1147,7 +1147,7 @@ ZTEST(settings_mgmt, test_delete)
|
|||
zassert_equal(smp_header->nh_version, 1, "SMP header version mismatch");
|
||||
|
||||
/* Get the response value to compare */
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
zassert_equal(decoded, 1, "Expected to receive 1 decoded zcbor element");
|
||||
|
@ -1274,7 +1274,7 @@ ZTEST(settings_mgmt, test_delete)
|
|||
zassert_equal(smp_header->nh_version, 1, "SMP header version mismatch");
|
||||
|
||||
/* Get the response value to compare */
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
zassert_equal(decoded, 1, "Expected to receive 1 decoded zcbor element");
|
||||
|
@ -1519,7 +1519,7 @@ ZTEST(settings_mgmt, test_delete)
|
|||
zassert_equal(smp_header->nh_version, 1, "SMP header version mismatch");
|
||||
|
||||
/* Get the response value to compare */
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
zassert_equal(decoded, 1, "Expected to receive 1 decoded zcbor element");
|
||||
|
|
|
@ -31,7 +31,7 @@ bool create_settings_mgmt_read_packet(zcbor_state_t *zse, uint8_t *buffer, uint8
|
|||
|
||||
ok = zcbor_map_start_encode(zse, 2) &&
|
||||
zcbor_tstr_put_lit(zse, "name") &&
|
||||
zcbor_tstr_put_term(zse, name) &&
|
||||
zcbor_tstr_put_term(zse, name, CONFIG_ZCBOR_MAX_STR_LEN) &&
|
||||
(max_size == 0 || (zcbor_tstr_put_lit(zse, "max_size") &&
|
||||
zcbor_uint32_put(zse, max_size))) &&
|
||||
zcbor_map_end_encode(zse, 2);
|
||||
|
@ -53,7 +53,7 @@ bool create_settings_mgmt_write_packet(zcbor_state_t *zse, uint8_t *buffer, uint
|
|||
|
||||
ok = zcbor_map_start_encode(zse, 2) &&
|
||||
zcbor_tstr_put_lit(zse, "name") &&
|
||||
zcbor_tstr_put_term(zse, name) &&
|
||||
zcbor_tstr_put_term(zse, name, CONFIG_ZCBOR_MAX_STR_LEN) &&
|
||||
zcbor_tstr_put_lit(zse, "val") &&
|
||||
zcbor_bstr_encode_ptr(zse, val, val_size) &&
|
||||
zcbor_map_end_encode(zse, 2);
|
||||
|
@ -74,7 +74,7 @@ bool create_settings_mgmt_delete_packet(zcbor_state_t *zse, uint8_t *buffer,
|
|||
|
||||
ok = zcbor_map_start_encode(zse, 2) &&
|
||||
zcbor_tstr_put_lit(zse, "name") &&
|
||||
zcbor_tstr_put_term(zse, name) &&
|
||||
zcbor_tstr_put_term(zse, name, CONFIG_ZCBOR_MAX_STR_LEN) &&
|
||||
zcbor_map_end_encode(zse, 2);
|
||||
|
||||
*buffer_size = (zse->payload_mut - buffer);
|
||||
|
|
|
@ -155,7 +155,7 @@ ZTEST(smp_version, test_legacy_command)
|
|||
zassert_equal(smp_header->nh_version, LEGACY_VERSION,
|
||||
"Expected response header version mismatch");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -242,7 +242,7 @@ ZTEST(smp_version, test_current_command)
|
|||
zassert_equal(smp_header->nh_version, CURRENT_VERSION,
|
||||
"Expected response header version mismatch");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
@ -328,7 +328,7 @@ ZTEST(smp_version, test_new_command)
|
|||
zassert_equal(smp_header->nh_version, CURRENT_VERSION,
|
||||
"Expected response header version mismatch");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1);
|
||||
zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0);
|
||||
ok = zcbor_map_decode_bulk(zsd, output_decode, ARRAY_SIZE(output_decode), &decoded) == 0;
|
||||
|
||||
zassert_true(ok, "Expected decode to be successful");
|
||||
|
|
|
@ -32,7 +32,7 @@ bool create_mcumgr_format_packet(zcbor_state_t *zse, const uint8_t *format, uint
|
|||
|
||||
ok = zcbor_map_start_encode(zse, 2) &&
|
||||
zcbor_tstr_put_lit(zse, "format") &&
|
||||
zcbor_tstr_put_term(zse, format) &&
|
||||
zcbor_tstr_put_term(zse, format, CONFIG_ZCBOR_MAX_STR_LEN) &&
|
||||
zcbor_map_end_encode(zse, 2);
|
||||
|
||||
*buffer_size = (zse->payload_mut - buffer);
|
||||
|
|
|
@ -60,7 +60,7 @@ ZTEST(zcbor_bulk, test_correct)
|
|||
|
||||
zassert_true(ok, "Expected to be successful in encoding test pattern");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
@ -101,7 +101,7 @@ ZTEST(zcbor_bulk, test_correct_out_of_order)
|
|||
|
||||
zassert_true(ok, "Expected to be successful in encoding test pattern");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
@ -140,7 +140,7 @@ ZTEST(zcbor_bulk, test_not_map)
|
|||
|
||||
zassert_true(ok, "Expected to be successful in encoding test pattern");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
@ -175,7 +175,7 @@ ZTEST(zcbor_bulk, test_bad_type)
|
|||
|
||||
zassert_true(ok, "Expected to be successful in encoding test pattern");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
@ -211,7 +211,7 @@ ZTEST(zcbor_bulk, test_bad_type_2)
|
|||
zcbor_tstr_put_lit(zsd, "bool val") && zcbor_true_put(zsd) &&
|
||||
zcbor_map_end_encode(zsd, 10);
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
@ -252,7 +252,7 @@ ZTEST(zcbor_bulk, test_bad_type_encoded)
|
|||
|
||||
zassert_true(ok, "Expected to be successful in encoding test pattern");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
@ -287,7 +287,7 @@ ZTEST(zcbor_bulk, test_duplicate)
|
|||
zcbor_tstr_put_lit(zsd, "hello") && zcbor_tstr_put_lit(zsd, "world") &&
|
||||
zcbor_map_end_encode(zsd, 10);
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
@ -366,7 +366,7 @@ ZTEST(zcbor_bulk, test_map_in_map_correct)
|
|||
|
||||
zassert_true(ok, "Expected to be successful in encoding test pattern");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
@ -445,7 +445,7 @@ ZTEST(zcbor_bulk, test_map_in_map_bad)
|
|||
|
||||
zassert_true(ok, "Expected to be successful in encoding test pattern");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
@ -486,7 +486,7 @@ ZTEST(zcbor_bulk, test_key_found)
|
|||
|
||||
zassert_true(ok, "Expected to be successful in encoding test pattern");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
@ -528,7 +528,7 @@ ZTEST(zcbor_bulk, test_reset)
|
|||
|
||||
zassert_true(ok, "Expected to be successful in encoding test pattern");
|
||||
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1);
|
||||
zcbor_new_decode_state(zsd, 4, buffer, ARRAY_SIZE(buffer), 1, NULL, 0);
|
||||
|
||||
int rc = zcbor_map_decode_bulk(zsd, dm, ARRAY_SIZE(dm), &decoded);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue