23
23
#define CBOR_GETSTREAMREQUEST_ITEM_COUNT 6
24
24
25
25
/* ============================ TEST GLOBALS ============================= */
26
- const uint8_t * decodeMessageBuffer = "decodeMessageBuffer" ;
27
- uint8_t * encodeMessageBuffer = "encodeMessageBuffer" ;
28
- const uint8_t * blockBitmap = "blockBitmap" ;
26
+ const uint8_t * decodeMessageBuffer = ( const uint8_t * ) "decodeMessageBuffer" ;
27
+ uint8_t * encodeMessageBuffer = ( uint8_t * ) "encodeMessageBuffer" ;
28
+ const uint8_t * blockBitmap = ( const uint8_t * ) "blockBitmap" ;
29
29
const char * clientToken = "clientToken" ;
30
30
int32_t blockId = 1 ;
31
31
int32_t blockSize = 2 ;
@@ -102,7 +102,7 @@ void cborFindsBlockIdKey( void )
102
102
103
103
void cborBlockIdKeyCorrectType ( void )
104
104
{
105
- cbor_value_get_type_ExpectAndReturn ( & cborValue , CborNoError );
105
+ cbor_value_get_type_ExpectAndReturn ( & cborValue , ( CborType ) CborNoError );
106
106
cbor_value_get_int_ExpectAndReturn ( & cborValue , & blockId , CborNoError );
107
107
}
108
108
@@ -115,7 +115,7 @@ void cborFindsBlockSizeKey( void )
115
115
116
116
void cborBlockSizeKeyCorrectType ( void )
117
117
{
118
- cbor_value_get_type_ExpectAndReturn ( & cborValue , CborNoError );
118
+ cbor_value_get_type_ExpectAndReturn ( & cborValue , ( CborType ) CborNoError );
119
119
cbor_value_get_int_ExpectAndReturn ( & cborValue , & blockSize , CborNoError );
120
120
}
121
121
@@ -187,7 +187,6 @@ void cborEncodesNumberOfBlocks( void )
187
187
188
188
void test_Decode_succeeds ( void )
189
189
{
190
- uint8_t payload ;
191
190
uint8_t * payloadPtr ;
192
191
193
192
payloadSizeReceived = payloadSize - 1 ;
@@ -325,7 +324,7 @@ void test_Decode_returnsFalse_cannotGetBlockIdValue( void )
325
324
cborFileIdKeyCorrectType ();
326
325
cborFindsBlockIdKey ();
327
326
cbor_value_get_type_ExpectAndReturn ( & cborValue , CborNoError );
328
- cbor_value_get_int_ExpectAndReturn ( & cborValue , & blockId , CborUnknownError );
327
+ cbor_value_get_int_ExpectAndReturn ( & cborValue , & blockId , ( CborType ) CborUnknownError );
329
328
330
329
result = CBOR_Decode_GetStreamResponseMessage ( decodeMessageBuffer , 1234U , & fileId , & blockId , & blockSize , payload , & payloadSize );
331
330
TEST_ASSERT_FALSE ( result );
@@ -354,7 +353,7 @@ void test_Decode_returnsFalse_blockSizeWrongTypeInMap( void )
354
353
cborFindsBlockIdKey ();
355
354
cborBlockIdKeyCorrectType ();
356
355
cborFindsBlockSizeKey ();
357
- cbor_value_get_type_ExpectAndReturn ( & cborValue , CborUnknownError );
356
+ cbor_value_get_type_ExpectAndReturn ( & cborValue , ( CborType ) CborUnknownError );
358
357
359
358
result = CBOR_Decode_GetStreamResponseMessage ( decodeMessageBuffer , 1234U , & fileId , & blockId , & blockSize , payload , & payloadSize );
360
359
TEST_ASSERT_FALSE ( result );
@@ -369,7 +368,7 @@ void test_Decode_returnsFalse_cannotGetBlockSizeValue( void )
369
368
cborFindsBlockIdKey ();
370
369
cborBlockIdKeyCorrectType ();
371
370
cborFindsBlockSizeKey ();
372
- cbor_value_get_type_ExpectAndReturn ( & cborValue , CborNoError );
371
+ cbor_value_get_type_ExpectAndReturn ( & cborValue , ( CborType ) CborNoError );
373
372
cbor_value_get_int_ExpectAndReturn ( & cborValue , & blockSize , CborUnknownError );
374
373
375
374
result = CBOR_Decode_GetStreamResponseMessage ( decodeMessageBuffer , 1234U , & fileId , & blockId , & blockSize , payload , & payloadSize );
@@ -404,7 +403,7 @@ void test_Decode_returnsFalse_blockPayloadWrongTypeInMap( void )
404
403
cborBlockSizeKeyCorrectType ();
405
404
cborFindsPayloadKeyInMap ();
406
405
407
- cbor_value_get_type_ExpectAndReturn ( & cborValue , CborUnknownError );
406
+ cbor_value_get_type_ExpectAndReturn ( & cborValue , ( CborType ) CborUnknownError );
408
407
409
408
result = CBOR_Decode_GetStreamResponseMessage ( decodeMessageBuffer , 1234U , & fileId , & blockId , & blockSize , payload , & payloadSize );
410
409
TEST_ASSERT_FALSE ( result );
@@ -451,7 +450,6 @@ void test_Decode_returnsFalse_blockPayloadLargerThanBuffer( void )
451
450
452
451
void test_Decode_returnsFalse_failsCopyingPayloadByteString ( void )
453
452
{
454
- uint8_t payload ;
455
453
uint8_t * payloadPtr ;
456
454
457
455
payloadSizeReceived = payloadSize - 1 ;
0 commit comments