Lines Matching refs:arr
12 cbor_item_t *arr; variable
18 arr = cbor_load(data1, 2, &res); in test_empty_array()
19 assert_non_null(arr); in test_empty_array()
20 assert_true(cbor_typeof(arr) == CBOR_TYPE_ARRAY); in test_empty_array()
21 assert_true(cbor_isa_array(arr)); in test_empty_array()
22 assert_true(cbor_array_size(arr) == 0); in test_empty_array()
24 cbor_decref(&arr); in test_empty_array()
25 assert_null(arr); in test_empty_array()
31 arr = cbor_load(data2, 3, &res); in test_simple_array()
32 assert_non_null(arr); in test_simple_array()
33 assert_true(cbor_typeof(arr) == CBOR_TYPE_ARRAY); in test_simple_array()
34 assert_true(cbor_isa_array(arr)); in test_simple_array()
35 assert_size_equal(cbor_array_size(arr), 1); in test_simple_array()
37 assert_size_equal(cbor_array_allocated(arr), 1); in test_simple_array()
39 assert_uint8(cbor_array_handle(arr)[0], 1); in test_simple_array()
40 cbor_item_t *intermediate = cbor_array_get(arr, 0); in test_simple_array()
44 assert_false(cbor_array_set(arr, 1, new_val)); in test_simple_array()
45 assert_false(cbor_array_set(arr, 3, new_val)); in test_simple_array()
48 cbor_decref(&arr); in test_simple_array()
50 assert_null(arr); in test_simple_array()
57 arr = cbor_load(data3, 5, &res); in test_nested_arrays()
58 assert_non_null(arr); in test_nested_arrays()
59 assert_true(cbor_typeof(arr) == CBOR_TYPE_ARRAY); in test_nested_arrays()
60 assert_true(cbor_isa_array(arr)); in test_nested_arrays()
61 assert_true(cbor_array_size(arr) == 2); in test_nested_arrays()
64 assert_uint8(cbor_array_handle(arr)[0], 1); in test_nested_arrays()
66 cbor_item_t *nested = cbor_array_handle(arr)[1]; in test_nested_arrays()
71 cbor_decref(&arr); in test_nested_arrays()
72 assert_null(arr); in test_nested_arrays()
78 arr = cbor_load(test_indef_arrays_data, 4, &res); in test_indef_arrays()
79 assert_non_null(arr); in test_indef_arrays()
80 assert_true(cbor_typeof(arr) == CBOR_TYPE_ARRAY); in test_indef_arrays()
81 assert_true(cbor_isa_array(arr)); in test_indef_arrays()
82 assert_true(cbor_array_size(arr) == 2); in test_indef_arrays()
85 assert_uint8(cbor_array_handle(arr)[0], 1); in test_indef_arrays()
86 assert_uint8(cbor_array_handle(arr)[1], 2); in test_indef_arrays()
88 assert_true(cbor_array_set(arr, 1, cbor_move(cbor_build_uint8(10)))); in test_indef_arrays()
90 cbor_decref(&arr); in test_indef_arrays()
91 assert_null(arr); in test_indef_arrays()
98 arr = cbor_load(test_nested_indef_arrays_data, 7, &res); in test_nested_indef_arrays()
99 assert_non_null(arr); in test_nested_indef_arrays()
100 assert_true(cbor_typeof(arr) == CBOR_TYPE_ARRAY); in test_nested_indef_arrays()
101 assert_true(cbor_isa_array(arr)); in test_nested_indef_arrays()
102 assert_size_equal(cbor_array_size(arr), 3); in test_nested_indef_arrays()
105 assert_uint8(cbor_array_handle(arr)[0], 1); in test_nested_indef_arrays()
107 cbor_item_t *nested = cbor_array_handle(arr)[1]; in test_nested_indef_arrays()
112 cbor_decref(&arr); in test_nested_indef_arrays()
113 assert_null(arr); in test_nested_indef_arrays()