Fixed code to make unit test pass for bacapp module.

This commit is contained in:
skarg
2006-02-20 21:10:49 +00:00
parent bde803b7f3
commit d8de24f171
3 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -1704,7 +1704,7 @@ void testBACDCodeSignedValue(Test * pTest, int32_t value)
{
uint8_t array[5] = { 0 };
uint8_t encoded_array[5] = { 0 };
int decoded_value = 0;
long decoded_value = 0;
int len = 0, apdu_len = 0;
uint8_t apdu[MAX_APDU] = { 0 };
uint8_t tag_number = 0;
@@ -1717,14 +1717,14 @@ void testBACDCodeSignedValue(Test * pTest, int32_t value)
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_SIGNED_INT);
ct_test(pTest, decoded_value == value);
if (decoded_value != value) {
printf("value=%d decoded_value=%d\n", value, decoded_value);
printf("value=%d decoded_value=%ld\n", value, decoded_value);
print_apdu(&array[0], sizeof(array));
}
encode_tagged_signed(&encoded_array[0], decoded_value);
diff = memcmp(&array[0], &encoded_array[0], sizeof(array));
ct_test(pTest, diff == 0);
if (diff) {
printf("value=%d decoded_value=%d\n", value, decoded_value);
printf("value=%d decoded_value=%ld\n", value, decoded_value);
print_apdu(&array[0], sizeof(array));
print_apdu(&encoded_array[0], sizeof(array));
}