1 #include <setjmp.h> 2 #include <stdarg.h> 3 #include <stddef.h> 4 5 #include <cmocka.h> 6 7 #include "cbor.h" 8 9 #ifndef ASSERTIONS_H_ 10 #define ASSERTIONS_H_ 11 12 void assert_uint8(cbor_item_t* item, uint8_t num); 13 void assert_uint16(cbor_item_t* item, uint16_t num); 14 void assert_uint32(cbor_item_t* item, uint32_t num); 15 void assert_uint64(cbor_item_t* item, uint64_t num); 16 17 /** Assert that result `status` and `read` are equal. */ 18 void assert_decoder_result(size_t read, enum cbor_decoder_status status, 19 struct cbor_decoder_result result); 20 21 /** 22 * Assert that the result is set to CBOR_DECODER_NEDATA with the given 23 * `cbor_decoder_result.required` value. 24 */ 25 void assert_decoder_result_nedata(size_t required, 26 struct cbor_decoder_result result); 27 28 /** 29 * Check that the streaming decoder returns a correct CBOR_DECODER_NEDATA 30 * result for all inputs from data[0..1] through data[0..(expected-1)]. 31 */ 32 void assert_minimum_input_size(size_t expected, cbor_data data); 33 34 #endif 35