diff --git a/tests/convert_numbers_test.c b/tests/convert_numbers_test.c index 697241ae8..edc534079 100644 --- a/tests/convert_numbers_test.c +++ b/tests/convert_numbers_test.c @@ -45,7 +45,7 @@ static void test_utils_textToInt(void) int64_t res; int converted; - converted = utils_textToInt((uint8_t*)ints_text[i], strlen(ints_text[i]), &res); + converted = utils_textToInt((const uint8_t*)ints_text[i], strlen(ints_text[i]), &res); CU_ASSERT(converted); if (converted) @@ -70,7 +70,7 @@ static void test_utils_textToUInt(void) uint64_t res; int converted; - converted = utils_textToUInt((uint8_t*)uints_text[i], strlen(uints_text[i]), &res); + converted = utils_textToUInt((const uint8_t*)uints_text[i], strlen(uints_text[i]), &res); CU_ASSERT(converted); if (converted) @@ -95,7 +95,7 @@ static void test_utils_textToFloat(void) double res; int converted; - converted = utils_textToFloat((uint8_t*)floats_text[i], strlen(floats_text[i]), &res, false); + converted = utils_textToFloat((const uint8_t*)floats_text[i], strlen(floats_text[i]), &res, false); CU_ASSERT(converted); if (converted) @@ -120,7 +120,7 @@ static void test_utils_textToFloatExponential(void) double res; int converted; - converted = utils_textToFloat((uint8_t*)floats_exponential[i], strlen(floats_exponential[i]), &res, true); + converted = utils_textToFloat((const uint8_t*)floats_exponential[i], strlen(floats_exponential[i]), &res, true); CU_ASSERT(converted); if (converted) @@ -145,21 +145,21 @@ static void test_utils_textToObjLink(void) uint16_t objectId; uint16_t objectInstanceId; CU_ASSERT_EQUAL(utils_textToObjLink(NULL, 0, &objectId, &objectInstanceId), 0); - CU_ASSERT_EQUAL(utils_textToObjLink((uint8_t*)"", 0, &objectId, &objectInstanceId), 0); - CU_ASSERT_EQUAL(utils_textToObjLink((uint8_t*)":", 1, &objectId, &objectInstanceId), 0); - CU_ASSERT_EQUAL(utils_textToObjLink((uint8_t*)"0:", 2, &objectId, &objectInstanceId), 0); - CU_ASSERT_EQUAL(utils_textToObjLink((uint8_t*)":0", 2, &objectId, &objectInstanceId), 0); - CU_ASSERT_EQUAL(utils_textToObjLink((uint8_t*)"0:0", 3, &objectId, &objectInstanceId), 1); + CU_ASSERT_EQUAL(utils_textToObjLink((const uint8_t*)"", 0, &objectId, &objectInstanceId), 0); + CU_ASSERT_EQUAL(utils_textToObjLink((const uint8_t*)":", 1, &objectId, &objectInstanceId), 0); + CU_ASSERT_EQUAL(utils_textToObjLink((const uint8_t*)"0:", 2, &objectId, &objectInstanceId), 0); + CU_ASSERT_EQUAL(utils_textToObjLink((const uint8_t*)":0", 2, &objectId, &objectInstanceId), 0); + CU_ASSERT_EQUAL(utils_textToObjLink((const uint8_t*)"0:0", 3, &objectId, &objectInstanceId), 1); CU_ASSERT_EQUAL(objectId, 0); CU_ASSERT_EQUAL(objectInstanceId, 0); - CU_ASSERT_EQUAL(utils_textToObjLink((uint8_t*)"1:2", 3, &objectId, &objectInstanceId), 1); + CU_ASSERT_EQUAL(utils_textToObjLink((const uint8_t*)"1:2", 3, &objectId, &objectInstanceId), 1); CU_ASSERT_EQUAL(objectId, 1); CU_ASSERT_EQUAL(objectInstanceId, 2); - CU_ASSERT_EQUAL(utils_textToObjLink((uint8_t*)"65535:65535", 11, &objectId, &objectInstanceId), 1); + CU_ASSERT_EQUAL(utils_textToObjLink((const uint8_t*)"65535:65535", 11, &objectId, &objectInstanceId), 1); CU_ASSERT_EQUAL(objectId, 65535); CU_ASSERT_EQUAL(objectInstanceId, 65535); - CU_ASSERT_EQUAL(utils_textToObjLink((uint8_t*)"65536:65535", 11, &objectId, &objectInstanceId), 0); - CU_ASSERT_EQUAL(utils_textToObjLink((uint8_t*)"65535:65536", 11, &objectId, &objectInstanceId), 0); + CU_ASSERT_EQUAL(utils_textToObjLink((const uint8_t*)"65536:65535", 11, &objectId, &objectInstanceId), 0); + CU_ASSERT_EQUAL(utils_textToObjLink((const uint8_t*)"65535:65536", 11, &objectId, &objectInstanceId), 0); } static void test_utils_intToText(void)