Lines Matching defs:stack

10 #include "cbor/internal/stack.h"
35 struct _cbor_stack stack = _cbor_stack_init();
37 _cbor_stack_push(&stack, cbor_new_indefinite_bytestring(), 0));
42 .stack = &stack,
49 assert_size_equal(context.stack->size, 1);
51 cbor_item_t* bytestring = stack.top->item;
70 _cbor_stack_pop(&stack);
75 struct _cbor_stack stack = _cbor_stack_init();
77 _cbor_stack_push(&stack, cbor_new_indefinite_bytestring(), 0));
82 .stack = &stack,
90 assert_size_equal(context.stack->size, 1);
92 // The stack remains unchanged
93 cbor_item_t* bytestring = stack.top->item;
102 _cbor_stack_pop(&stack);
107 struct _cbor_stack stack = _cbor_stack_init();
109 _cbor_stack_push(&stack, cbor_new_indefinite_bytestring(), 0));
114 .stack = &stack,
124 assert_size_equal(context.stack->size, 1);
126 // The stack remains unchanged
127 cbor_item_t* bytestring = stack.top->item;
136 _cbor_stack_pop(&stack);
141 struct _cbor_stack stack = _cbor_stack_init();
143 _cbor_stack_push(&stack, cbor_new_indefinite_bytestring(), 0));
148 .stack = &stack,
151 // Allocate new item, but fail to push it into the parent on the stack
158 assert_size_equal(context.stack->size, 1);
160 // The stack remains unchanged
161 cbor_item_t* bytestring = stack.top->item;
170 _cbor_stack_pop(&stack);
175 struct _cbor_stack stack = _cbor_stack_init();
176 assert_non_null(_cbor_stack_push(&stack, cbor_new_indefinite_string(), 0));
181 .stack = &stack,
188 assert_size_equal(context.stack->size, 1);
190 cbor_item_t* string = stack.top->item;
207 _cbor_stack_pop(&stack);
212 struct _cbor_stack stack = _cbor_stack_init();
213 assert_non_null(_cbor_stack_push(&stack, cbor_new_indefinite_string(), 0));
218 .stack = &stack,
226 assert_size_equal(context.stack->size, 1);
228 // The stack remains unchanged
229 cbor_item_t* string = stack.top->item;
238 _cbor_stack_pop(&stack);
243 struct _cbor_stack stack = _cbor_stack_init();
244 assert_non_null(_cbor_stack_push(&stack, cbor_new_indefinite_string(), 0));
249 .stack = &stack,
258 assert_size_equal(context.stack->size, 1);
260 // The stack remains unchanged
261 cbor_item_t* string = stack.top->item;
270 _cbor_stack_pop(&stack);
275 struct _cbor_stack stack = _cbor_stack_init();
276 assert_non_null(_cbor_stack_push(&stack, cbor_new_indefinite_string(), 0));
281 .stack = &stack,
284 // Allocate new item, but fail to push it into the parent on the stack
290 assert_size_equal(context.stack->size, 1);
292 // The stack remains unchanged
293 cbor_item_t* string = stack.top->item;
302 _cbor_stack_pop(&stack);
306 struct _cbor_stack stack = _cbor_stack_init();
307 assert_non_null(_cbor_stack_push(&stack, cbor_new_definite_array(0), 0));
308 stack.top->subitems = 1;
313 .stack = &stack,
321 assert_size_equal(context.stack->size, 1);
323 // The stack remains unchanged
324 cbor_item_t* array = stack.top->item;
331 _cbor_stack_pop(&stack);
335 struct _cbor_stack stack = _cbor_stack_init();
337 _cbor_stack_push(&stack, cbor_new_indefinite_map(), /*subitems=*/0));
342 .stack = &stack,
350 assert_size_equal(context.stack->size, 1);
352 // The stack remains unchanged
353 cbor_item_t* map = stack.top->item;
360 _cbor_stack_pop(&stack);
375 struct _cbor_stack stack = _cbor_stack_init();
376 assert_non_null(_cbor_stack_push(&stack, cbor_new_int8(), /*subitems=*/0));
381 .stack = &stack,
388 assert_size_equal(context.stack->size, 1);
389 // The stack remains unchanged
390 cbor_item_t* small_int = stack.top->item;
395 _cbor_stack_pop(&stack);