Fixed some warnings detected by CSTAT.
Consolidated some unit tests and added a single test prototype to header file.
This commit is contained in:
@@ -608,7 +608,7 @@ void handler_cov_timer_seconds(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void handler_cov_task(
|
bool handler_cov_fsm(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
static int index = 0;
|
static int index = 0;
|
||||||
@@ -739,6 +739,13 @@ void handler_cov_task(
|
|||||||
cov_task_state = COV_STATE_IDLE;
|
cov_task_state = COV_STATE_IDLE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return (cov_task_state == COV_STATE_IDLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void handler_cov_task(
|
||||||
|
void)
|
||||||
|
{
|
||||||
|
handler_cov_fsm();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool cov_subscribe(
|
static bool cov_subscribe(
|
||||||
|
|||||||
@@ -143,11 +143,12 @@ uint8_t Send_COV_Subscribe(
|
|||||||
bytes_sent =
|
bytes_sent =
|
||||||
datalink_send_pdu(&dest, &npdu_data,
|
datalink_send_pdu(&dest, &npdu_data,
|
||||||
&Handler_Transmit_Buffer[0], pdu_len);
|
&Handler_Transmit_Buffer[0], pdu_len);
|
||||||
|
if (bytes_sent <= 0) {
|
||||||
#if PRINT_ENABLED
|
#if PRINT_ENABLED
|
||||||
if (bytes_sent <= 0)
|
|
||||||
fprintf(stderr, "Failed to Send SubscribeCOV Request (%s)!\n",
|
fprintf(stderr, "Failed to Send SubscribeCOV Request (%s)!\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
tsm_free_invoke_id(invoke_id);
|
tsm_free_invoke_id(invoke_id);
|
||||||
invoke_id = 0;
|
invoke_id = 0;
|
||||||
|
|||||||
@@ -80,11 +80,13 @@ void Send_I_Am_To_Network(
|
|||||||
bytes_sent =
|
bytes_sent =
|
||||||
datalink_send_pdu(target_address, &npdu_data,
|
datalink_send_pdu(target_address, &npdu_data,
|
||||||
&Handler_Transmit_Buffer[0], pdu_len);
|
&Handler_Transmit_Buffer[0], pdu_len);
|
||||||
|
if (bytes_sent <= 0) {
|
||||||
#if PRINT_ENABLED
|
#if PRINT_ENABLED
|
||||||
if (bytes_sent <= 0)
|
|
||||||
fprintf(stderr, "Failed to Send I-Am Request (%s)!\n",
|
fprintf(stderr, "Failed to Send I-Am Request (%s)!\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Encode an I Am message to be broadcast.
|
/** Encode an I Am message to be broadcast.
|
||||||
@@ -227,10 +229,9 @@ void Send_I_Am_Unicast(
|
|||||||
/* send data */
|
/* send data */
|
||||||
bytes_sent = datalink_send_pdu(&dest, &npdu_data, &buffer[0], pdu_len);
|
bytes_sent = datalink_send_pdu(&dest, &npdu_data, &buffer[0], pdu_len);
|
||||||
|
|
||||||
|
if (bytes_sent <= 0) {
|
||||||
#if PRINT_ENABLED
|
#if PRINT_ENABLED
|
||||||
if (bytes_sent <= 0)
|
|
||||||
fprintf(stderr, "Failed to Send I-Am Reply (%s)!\n", strerror(errno));
|
fprintf(stderr, "Failed to Send I-Am Reply (%s)!\n", strerror(errno));
|
||||||
#else
|
|
||||||
(void)bytes_sent;
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
/** @file s_upt.c Send an Unconfirmed Private Transfer request. */
|
/** @file s_upt.c Send an Unconfirmed Private Transfer request. */
|
||||||
|
|
||||||
void Send_UnconfirmedPrivateTransfer(
|
int Send_UnconfirmedPrivateTransfer(
|
||||||
BACNET_ADDRESS * dest,
|
BACNET_ADDRESS * dest,
|
||||||
BACNET_PRIVATE_TRANSFER_DATA * private_data)
|
BACNET_PRIVATE_TRANSFER_DATA * private_data)
|
||||||
{
|
{
|
||||||
@@ -56,7 +56,7 @@ void Send_UnconfirmedPrivateTransfer(
|
|||||||
BACNET_ADDRESS my_address;
|
BACNET_ADDRESS my_address;
|
||||||
|
|
||||||
if (!dcc_communication_enabled())
|
if (!dcc_communication_enabled())
|
||||||
return;
|
return bytes_sent;
|
||||||
|
|
||||||
datalink_get_my_address(&my_address);
|
datalink_get_my_address(&my_address);
|
||||||
/* encode the NPDU portion of the packet */
|
/* encode the NPDU portion of the packet */
|
||||||
@@ -73,10 +73,13 @@ void Send_UnconfirmedPrivateTransfer(
|
|||||||
bytes_sent =
|
bytes_sent =
|
||||||
datalink_send_pdu(dest, &npdu_data, &Handler_Transmit_Buffer[0],
|
datalink_send_pdu(dest, &npdu_data, &Handler_Transmit_Buffer[0],
|
||||||
pdu_len);
|
pdu_len);
|
||||||
|
if (bytes_sent <= 0) {
|
||||||
#if PRINT_ENABLED
|
#if PRINT_ENABLED
|
||||||
if (bytes_sent <= 0)
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Failed to Send UnconfirmedPrivateTransfer Request (%s)!\n",
|
"Failed to Send UnconfirmedPrivateTransfer Request (%s)!\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
return bytes_sent;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -417,9 +417,13 @@ extern "C" {
|
|||||||
/* true if the tag is a closing tag */
|
/* true if the tag is a closing tag */
|
||||||
#define IS_CLOSING_TAG(x) ((x & 0x07) == 7)
|
#define IS_CLOSING_TAG(x) ((x & 0x07) == 7)
|
||||||
|
|
||||||
|
#ifdef TEST
|
||||||
|
#include "ctest.h"
|
||||||
|
void test_BACDCode(
|
||||||
|
Test * pTest);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ extern "C" {
|
|||||||
uint32_t device_id,
|
uint32_t device_id,
|
||||||
BACNET_ALARM_ACK_DATA * data);
|
BACNET_ALARM_ACK_DATA * data);
|
||||||
|
|
||||||
void Send_UnconfirmedPrivateTransfer(
|
int Send_UnconfirmedPrivateTransfer(
|
||||||
BACNET_ADDRESS * dest,
|
BACNET_ADDRESS * dest,
|
||||||
BACNET_PRIVATE_TRANSFER_DATA * private_data);
|
BACNET_PRIVATE_TRANSFER_DATA * private_data);
|
||||||
|
|
||||||
|
|||||||
@@ -190,8 +190,7 @@ extern "C" {
|
|||||||
int handler_timesync_encode_recipients(
|
int handler_timesync_encode_recipients(
|
||||||
uint8_t * apdu,
|
uint8_t * apdu,
|
||||||
int max_apdu);
|
int max_apdu);
|
||||||
void handler_timesync_task(
|
void handler_timesync_task(BACNET_DATE_TIME *bdatetime);
|
||||||
void);
|
|
||||||
void handler_timesync_init(
|
void handler_timesync_init(
|
||||||
void);
|
void);
|
||||||
bool handler_timesync_recipient_write(
|
bool handler_timesync_recipient_write(
|
||||||
@@ -233,6 +232,8 @@ extern "C" {
|
|||||||
uint16_t service_len,
|
uint16_t service_len,
|
||||||
BACNET_ADDRESS * src,
|
BACNET_ADDRESS * src,
|
||||||
BACNET_CONFIRMED_SERVICE_DATA * service_data);
|
BACNET_CONFIRMED_SERVICE_DATA * service_data);
|
||||||
|
bool handler_cov_fsm(
|
||||||
|
void);
|
||||||
void handler_cov_task(
|
void handler_cov_task(
|
||||||
void);
|
void);
|
||||||
void handler_cov_timer_seconds(
|
void handler_cov_timer_seconds(
|
||||||
|
|||||||
@@ -331,10 +331,10 @@ uint16_t apdu_decode_confirmed_service_request(
|
|||||||
{
|
{
|
||||||
uint16_t len = 0; /* counts where we are in PDU */
|
uint16_t len = 0; /* counts where we are in PDU */
|
||||||
|
|
||||||
service_data->segmented_message = (apdu[0] & BIT3) ? true : false;
|
service_data->segmented_message = (apdu[0] & BIT(3)) ? true : false;
|
||||||
service_data->more_follows = (apdu[0] & BIT2) ? true : false;
|
service_data->more_follows = (apdu[0] & BIT(2)) ? true : false;
|
||||||
service_data->segmented_response_accepted =
|
service_data->segmented_response_accepted =
|
||||||
(apdu[0] & BIT1) ? true : false;
|
(apdu[0] & BIT(1)) ? true : false;
|
||||||
service_data->max_segs = decode_max_segs(apdu[1]);
|
service_data->max_segs = decode_max_segs(apdu[1]);
|
||||||
service_data->max_resp = decode_max_apdu(apdu[1]);
|
service_data->max_resp = decode_max_apdu(apdu[1]);
|
||||||
service_data->invoke_id = apdu[2];
|
service_data->invoke_id = apdu[2];
|
||||||
@@ -534,9 +534,9 @@ void apdu_handler(
|
|||||||
break;
|
break;
|
||||||
case PDU_TYPE_COMPLEX_ACK:
|
case PDU_TYPE_COMPLEX_ACK:
|
||||||
service_ack_data.segmented_message =
|
service_ack_data.segmented_message =
|
||||||
(apdu[0] & BIT3) ? true : false;
|
(apdu[0] & BIT(3)) ? true : false;
|
||||||
service_ack_data.more_follows =
|
service_ack_data.more_follows =
|
||||||
(apdu[0] & BIT2) ? true : false;
|
(apdu[0] & BIT(2)) ? true : false;
|
||||||
invoke_id = service_ack_data.invoke_id = apdu[1];
|
invoke_id = service_ack_data.invoke_id = apdu[1];
|
||||||
len = 2;
|
len = 2;
|
||||||
if (service_ack_data.segmented_message) {
|
if (service_ack_data.segmented_message) {
|
||||||
|
|||||||
+40
-45
@@ -1855,7 +1855,7 @@ static void print_apdu(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeTags(
|
static void testBACDCodeTags(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU] = { 0 };
|
uint8_t apdu[MAX_APDU] = { 0 };
|
||||||
@@ -1905,7 +1905,7 @@ void testBACDCodeTags(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeEnumerated(
|
static void testBACDCodeEnumerated(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t array[5] = { 0 };
|
uint8_t array[5] = { 0 };
|
||||||
@@ -1949,7 +1949,7 @@ void testBACDCodeEnumerated(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeReal(
|
static void testBACDCodeReal(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t real_array[4] = { 0 };
|
uint8_t real_array[4] = { 0 };
|
||||||
@@ -1983,7 +1983,7 @@ void testBACDCodeReal(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeDouble(
|
static void testBACDCodeDouble(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t double_array[8] = { 0 };
|
uint8_t double_array[8] = { 0 };
|
||||||
@@ -2017,7 +2017,7 @@ void testBACDCodeDouble(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeUnsignedValue(
|
static void testBACDCodeUnsignedValue(
|
||||||
Test * pTest,
|
Test * pTest,
|
||||||
uint32_t value)
|
uint32_t value)
|
||||||
{
|
{
|
||||||
@@ -2050,7 +2050,7 @@ void testBACDCodeUnsignedValue(
|
|||||||
ct_test(pTest, IS_CONTEXT_SPECIFIC(apdu[0]) == false);
|
ct_test(pTest, IS_CONTEXT_SPECIFIC(apdu[0]) == false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeUnsigned(
|
static void testBACDCodeUnsigned(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint32_t value = 1;
|
uint32_t value = 1;
|
||||||
@@ -2066,7 +2066,7 @@ void testBACDCodeUnsigned(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACnetUnsigned(
|
static void testBACnetUnsigned(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[32] = { 0 };
|
uint8_t apdu[32] = { 0 };
|
||||||
@@ -2083,7 +2083,7 @@ void testBACnetUnsigned(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeSignedValue(
|
static void testBACDCodeSignedValue(
|
||||||
Test * pTest,
|
Test * pTest,
|
||||||
int32_t value)
|
int32_t value)
|
||||||
{
|
{
|
||||||
@@ -2125,7 +2125,7 @@ void testBACDCodeSignedValue(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeSigned(
|
static void testBACDCodeSigned(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
int value = 1;
|
int value = 1;
|
||||||
@@ -2150,7 +2150,7 @@ void testBACDCodeSigned(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACnetSigned(
|
static void testBACnetSigned(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[32] = { 0 };
|
uint8_t apdu[32] = { 0 };
|
||||||
@@ -2171,7 +2171,7 @@ void testBACnetSigned(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeOctetString(
|
static void testBACDCodeOctetString(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t array[MAX_APDU] = { 0 };
|
uint8_t array[MAX_APDU] = { 0 };
|
||||||
@@ -2228,7 +2228,7 @@ void testBACDCodeOctetString(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeCharacterString(
|
static void testBACDCodeCharacterString(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t array[MAX_APDU] = { 0 };
|
uint8_t array[MAX_APDU] = { 0 };
|
||||||
@@ -2286,7 +2286,7 @@ void testBACDCodeCharacterString(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeObject(
|
static void testBACDCodeObject(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t object_array[4] = {
|
uint8_t object_array[4] = {
|
||||||
@@ -2323,7 +2323,7 @@ void testBACDCodeObject(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeMaxSegsApdu(
|
static void testBACDCodeMaxSegsApdu(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
int max_segs[8] = { 0, 2, 4, 8, 16, 32, 64, 65 };
|
int max_segs[8] = { 0, 2, 4, 8, 16, 32, 64, 65 };
|
||||||
@@ -2342,7 +2342,7 @@ void testBACDCodeMaxSegsApdu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBACDCodeBitString(
|
static void testBACDCodeBitString(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t bit = 0;
|
uint8_t bit = 0;
|
||||||
@@ -2390,7 +2390,7 @@ void testBACDCodeBitString(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void testUnsignedContextDecodes(
|
static void testUnsignedContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -2484,7 +2484,7 @@ void testUnsignedContextDecodes(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void testSignedContextDecodes(
|
static void testSignedContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -2582,7 +2582,7 @@ void testSignedContextDecodes(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void testEnumeratedContextDecodes(
|
static void testEnumeratedContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -2675,7 +2675,7 @@ void testEnumeratedContextDecodes(
|
|||||||
ct_test(pTest, outLen2 == BACNET_STATUS_ERROR);
|
ct_test(pTest, outLen2 == BACNET_STATUS_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void testFloatContextDecodes(
|
static void testFloatContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -2723,7 +2723,7 @@ void testFloatContextDecodes(
|
|||||||
ct_test(pTest, outLen2 == BACNET_STATUS_ERROR);
|
ct_test(pTest, outLen2 == BACNET_STATUS_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void testDoubleContextDecodes(
|
static void testDoubleContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -2771,7 +2771,7 @@ void testDoubleContextDecodes(
|
|||||||
ct_test(pTest, outLen2 == BACNET_STATUS_ERROR);
|
ct_test(pTest, outLen2 == BACNET_STATUS_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void testObjectIDContextDecodes(
|
static void testObjectIDContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -2812,7 +2812,7 @@ void testObjectIDContextDecodes(
|
|||||||
ct_test(pTest, outLen2 == BACNET_STATUS_ERROR);
|
ct_test(pTest, outLen2 == BACNET_STATUS_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void testCharacterStringContextDecodes(
|
static void testCharacterStringContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -2849,7 +2849,7 @@ void testCharacterStringContextDecodes(
|
|||||||
ct_test(pTest, strcmp(in.value, out.value) == 0);
|
ct_test(pTest, strcmp(in.value, out.value) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void testBitStringContextDecodes(
|
static void testBitStringContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -2888,7 +2888,7 @@ void testBitStringContextDecodes(
|
|||||||
ct_test(pTest, memcmp(in.value, out.value, MAX_BITSTRING_BYTES) == 0);
|
ct_test(pTest, memcmp(in.value, out.value, MAX_BITSTRING_BYTES) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void testOctetStringContextDecodes(
|
static void testOctetStringContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -2925,7 +2925,7 @@ void testOctetStringContextDecodes(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void testTimeContextDecodes(
|
static void testTimeContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -2967,7 +2967,7 @@ void testTimeContextDecodes(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void testDateContextDecodes(
|
static void testDateContextDecodes(
|
||||||
Test * pTest)
|
Test * pTest)
|
||||||
{
|
{
|
||||||
uint8_t apdu[MAX_APDU];
|
uint8_t apdu[MAX_APDU];
|
||||||
@@ -3008,16 +3008,12 @@ void testDateContextDecodes(
|
|||||||
ct_test(pTest, in.year == out.year);
|
ct_test(pTest, in.year == out.year);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_BACDCode(
|
||||||
#ifdef TEST_DECODE
|
Test * pTest)
|
||||||
int main(
|
|
||||||
void)
|
|
||||||
{
|
{
|
||||||
Test *pTest;
|
|
||||||
bool rc;
|
bool rc;
|
||||||
|
|
||||||
pTest = ct_create("BACDCode", NULL);
|
/* add individual tests */
|
||||||
/* individual tests */
|
|
||||||
rc = ct_addTestFunction(pTest, testBACDCodeTags);
|
rc = ct_addTestFunction(pTest, testBACDCodeTags);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
rc = ct_addTestFunction(pTest, testBACDCodeReal);
|
rc = ct_addTestFunction(pTest, testBACDCodeReal);
|
||||||
@@ -3042,42 +3038,41 @@ int main(
|
|||||||
assert(rc);
|
assert(rc);
|
||||||
rc = ct_addTestFunction(pTest, testBACDCodeBitString);
|
rc = ct_addTestFunction(pTest, testBACDCodeBitString);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testUnsignedContextDecodes);
|
rc = ct_addTestFunction(pTest, testUnsignedContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testSignedContextDecodes);
|
rc = ct_addTestFunction(pTest, testSignedContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testEnumeratedContextDecodes);
|
rc = ct_addTestFunction(pTest, testEnumeratedContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testCharacterStringContextDecodes);
|
rc = ct_addTestFunction(pTest, testCharacterStringContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testFloatContextDecodes);
|
rc = ct_addTestFunction(pTest, testFloatContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testDoubleContextDecodes);
|
rc = ct_addTestFunction(pTest, testDoubleContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testObjectIDContextDecodes);
|
rc = ct_addTestFunction(pTest, testObjectIDContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testBitStringContextDecodes);
|
rc = ct_addTestFunction(pTest, testBitStringContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testTimeContextDecodes);
|
rc = ct_addTestFunction(pTest, testTimeContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testDateContextDecodes);
|
rc = ct_addTestFunction(pTest, testDateContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testOctetStringContextDecodes);
|
rc = ct_addTestFunction(pTest, testOctetStringContextDecodes);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
|
||||||
rc = ct_addTestFunction(pTest, testBACDCodeDouble);
|
rc = ct_addTestFunction(pTest, testBACDCodeDouble);
|
||||||
assert(rc);
|
assert(rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef TEST_DECODE
|
||||||
|
int main(
|
||||||
|
void)
|
||||||
|
{
|
||||||
|
Test *pTest;
|
||||||
|
|
||||||
|
pTest = ct_create("BACDCode", NULL);
|
||||||
|
test_BACDCode(pTest);
|
||||||
|
|
||||||
/* configure output */
|
/* configure output */
|
||||||
ct_setStream(pTest, stdout);
|
ct_setStream(pTest, stdout);
|
||||||
ct_run(pTest);
|
ct_run(pTest);
|
||||||
|
|||||||
Reference in New Issue
Block a user