Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurence Lundblade committed Jan 22, 2025
1 parent 9e6d24c commit 67cbcec
Showing 1 changed file with 45 additions and 39 deletions.
84 changes: 45 additions & 39 deletions test/qcbor_decode_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -3999,59 +3999,65 @@ struct TestInput {
* but still nice to organize into an array with descriptions. */
static const struct TestInput spTagInput2[] = {
/* 0 */
"55799([4([1, 3])]), CBOR magic number in front of decimal fraction",
{
(uint8_t[]){0xd9, 0xd9, 0xf7, // CBOR magic number
0x81, // Array of one
0xd8, 0x04, // non-preferred serialization of tag 4, decimal fraction
0x82, // Array of two that is the faction 1/3
0x01,
0x03}, 9},
{"55799([4([1, 3])]), CBOR magic number in front of decimal fraction",
{
(uint8_t[]){0xd9, 0xd9, 0xf7, // CBOR magic number
0x81, // Array of one
0xd8, 0x04, // non-preferred serialization of tag 4, decimal fraction
0x82, // Array of two that is the faction 1/3
0x01,
0x03}, 9},
},

/* 1 */
"More than 4 tags on an item 225(226(227(228(229([])))))",
{
(uint8_t[]) {0xd8, 0xe1,
0xd8, 0xe2,
0xd8, 0xe3,
0xd8, 0xe4,
0xd8, 0xe5,
0x80}, 11},
{"More than 4 tags on an item 225(226(227(228(229([])))))",
{
(uint8_t[]) {0xd8, 0xe1,
0xd8, 0xe2,
0xd8, 0xe3,
0xd8, 0xe4,
0xd8, 0xe5,
0x80}, 11},
},

/* 2 */
"10489608748473423768( 2442302356( 21590( 240([]))))",
{
(uint8_t[]) {0xdb, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0xda, 0x91, 0x92, 0x93, 0x94,
{"10489608748473423768( 2442302356( 21590( 240([]))))",
{
(uint8_t[]) {0xdb, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0xda, 0x91, 0x92, 0x93, 0x94,
0xd9, 0x54, 0x56,
0xd8, 0xf0,
0x80}, 20},
0xd8, 0xf0,
0x80}, 20},
},

/* 3 */
"21590(10489608748473423768(2442302357(65534([]))))",
{
(uint8_t[]) {0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x56,
0xdb, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
{"21590(10489608748473423768(2442302357(65534([]))))",
{
(uint8_t[]) {0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x56,
0xdb, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0xda, 0x91, 0x92, 0x93, 0x95,
0xd9, 0xff, 0xfe,
0x80}, 27},
0xd9, 0xff, 0xfe,
0x80}, 27},
},

/* 4 */
"More than 4 tags 269488144( 269488145( 269488146( 269488147( 269488148([])))))",
{
(uint8_t[]) {0xda, 0x10, 0x10, 0x10, 0x10,
0xda, 0x10, 0x10, 0x10, 0x11,
{"More than 4 tags 269488144( 269488145( 269488146( 269488147( 269488148([])))))",
{
(uint8_t[]) {0xda, 0x10, 0x10, 0x10, 0x10,
0xda, 0x10, 0x10, 0x10, 0x11,
0xda, 0x10, 0x10, 0x10, 0x12,
0xda, 0x10, 0x10, 0x10, 0x13,
0xda, 0x10, 0x10, 0x10, 0x14,
0x80}, 26},
0xda, 0x10, 0x10, 0x10, 0x13,
0xda, 0x10, 0x10, 0x10, 0x14,
0x80}, 26},
},

/* 5 */
"An invalid decimal fraction with an additional tag",
{
(uint8_t[]) {0xd9, 0xff, 0xfa,
0xd8, 0x02,
{"An invalid decimal fraction with an additional tag",
{
(uint8_t[]) {0xd9, 0xff, 0xfa,
0xd8, 0x02,
0x00}, 6},
},

{NULL,
NULLUsefulBufC}
Expand Down

0 comments on commit 67cbcec

Please sign in to comment.