mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-25 02:55:15 +00:00
Fixed unsigned assignment warnings in tests
This commit is contained in:
parent
68a53c4565
commit
ac60bf66a9
@ -49,7 +49,7 @@ START_TEST(test_base32_encode)
|
||||
b32 = get_base32_encoder();
|
||||
|
||||
len = sizeof(buf);
|
||||
val = b32->encode(buf, &len, testpairs[_i].a, strlen(testpairs[_i].a));
|
||||
val = b32->encode((uint8_t *)buf, &len, (uint8_t *)testpairs[_i].a, strlen(testpairs[_i].a));
|
||||
|
||||
fail_unless(val == strlen(testpairs[_i].b));
|
||||
fail_unless(strcmp(buf, testpairs[_i].b) == 0,
|
||||
@ -67,7 +67,7 @@ START_TEST(test_base32_decode)
|
||||
b32 = get_base32_encoder();
|
||||
|
||||
len = sizeof(buf);
|
||||
val = b32->decode(buf, &len, testpairs[_i].b, strlen(testpairs[_i].b));
|
||||
val = b32->decode((uint8_t *)buf, &len, (uint8_t *)testpairs[_i].b, strlen(testpairs[_i].b));
|
||||
|
||||
fail_unless(val == strlen(testpairs[_i].a));
|
||||
fail_unless(strcmp(buf, testpairs[_i].a) == 0,
|
||||
@ -110,7 +110,7 @@ START_TEST(test_base32_blksize)
|
||||
}
|
||||
rawbuf[i] = 0;
|
||||
|
||||
val = b32->encode(encbuf, &enclen, rawbuf, rawlen);
|
||||
val = b32->encode((uint8_t *)encbuf, &enclen, (uint8_t *)rawbuf, rawlen);
|
||||
|
||||
fail_unless(rawlen == 5, "raw length was %d not 5", rawlen);
|
||||
fail_unless(enclen == 5, "encoded %d bytes, not 5", enclen);
|
||||
@ -119,7 +119,7 @@ START_TEST(test_base32_blksize)
|
||||
memset(rawbuf, 0, rawlen + 16);
|
||||
|
||||
enclen = val;
|
||||
val = b32->decode(rawbuf, &rawlen, encbuf, enclen);
|
||||
val = b32->decode((uint8_t *)rawbuf, &rawlen, (uint8_t *)encbuf, enclen);
|
||||
|
||||
fail_unless(rawlen == 5, "raw length was %d not 5", rawlen);
|
||||
fail_unless(val == 5, "val was not 5 but %d", val);
|
||||
|
@ -75,7 +75,7 @@ START_TEST(test_base64_encode)
|
||||
b64 = get_base64_encoder();
|
||||
|
||||
len = sizeof(buf);
|
||||
val = b64->encode(buf, &len, testpairs[_i].a, strlen(testpairs[_i].a));
|
||||
val = b64->encode((uint8_t *)buf, &len, (uint8_t *)testpairs[_i].a, strlen(testpairs[_i].a));
|
||||
|
||||
fail_unless(val == strlen(testpairs[_i].b));
|
||||
fail_unless(strcmp(buf, testpairs[_i].b) == 0,
|
||||
@ -93,7 +93,7 @@ START_TEST(test_base64_decode)
|
||||
b64 = get_base64_encoder();
|
||||
|
||||
len = sizeof(buf);
|
||||
val = b64->decode(buf, &len, testpairs[_i].b, strlen(testpairs[_i].b));
|
||||
val = b64->decode((uint8_t *)buf, &len, (uint8_t *)testpairs[_i].b, strlen(testpairs[_i].b));
|
||||
|
||||
fail_unless(val == strlen(testpairs[_i].a));
|
||||
fail_unless(strcmp(buf, testpairs[_i].a) == 0,
|
||||
@ -124,7 +124,7 @@ START_TEST(test_base64_blksize)
|
||||
}
|
||||
rawbuf[i] = 0;
|
||||
|
||||
val = b64->encode(encbuf, &enclen, rawbuf, rawlen);
|
||||
val = b64->encode((uint8_t *)encbuf, &enclen, (uint8_t *)rawbuf, rawlen);
|
||||
|
||||
fail_unless(rawlen == 3, "raw length was %d not 3", rawlen);
|
||||
fail_unless(enclen == 3, "encoded %d bytes, not 3", enclen);
|
||||
@ -133,7 +133,7 @@ START_TEST(test_base64_blksize)
|
||||
memset(rawbuf, 0, rawlen + 16);
|
||||
|
||||
enclen = val;
|
||||
val = b64->decode(rawbuf, &rawlen, encbuf, enclen);
|
||||
val = b64->decode((uint8_t *)rawbuf, &rawlen, (uint8_t *)encbuf, enclen);
|
||||
|
||||
fail_unless(rawlen == 3, "raw length was %d not 3", rawlen);
|
||||
fail_unless(val == 3);
|
||||
|
@ -86,7 +86,7 @@ START_TEST(test_encode_query)
|
||||
enc = get_base32_encoder();
|
||||
|
||||
*d++ = 'A';
|
||||
enc->encode(d, &enclen, innerData, strlen(innerData));
|
||||
enc->encode((uint8_t *)d, &enclen, (uint8_t *)innerData, strlen(innerData));
|
||||
d = resolv + strlen(resolv);
|
||||
if (*d != '.') {
|
||||
*d++ = '.';
|
||||
@ -123,7 +123,7 @@ START_TEST(test_decode_query)
|
||||
dns_decode(buf, sizeof(buf), &q, QR_QUERY, query_packet, len);
|
||||
domain = strstr(q.name, topdomain);
|
||||
len = sizeof(buf);
|
||||
unpack_data(buf, len, &(q.name[1]), (int) (domain - q.name) - 1, enc);
|
||||
unpack_data((uint8_t *)buf, len, (uint8_t *)(q.name + 1), (int) (domain - q.name) - 1, enc);
|
||||
|
||||
fail_unless(strncmp(buf, innerData, strlen(innerData)) == 0, "Did not extract expected host: '%s'", buf);
|
||||
fail_unless(strlen(buf) == strlen(innerData), "Bad host length: %d, expected %d: '%s'", strlen(buf), strlen(innerData), buf);
|
||||
|
@ -50,7 +50,7 @@ START_TEST(test_inline_dotify)
|
||||
memset(temp, 0, sizeof(temp));
|
||||
strcpy(temp, dottests[_i].a);
|
||||
b = temp;
|
||||
inline_dotify(b, sizeof(temp));
|
||||
inline_dotify((uint8_t *)b, sizeof(temp));
|
||||
|
||||
fail_unless(strcmp(dottests[_i].b, temp) == 0,
|
||||
"'%s' != '%s'", temp, dottests[_i].b);
|
||||
@ -65,7 +65,7 @@ START_TEST(test_inline_undotify)
|
||||
memset(temp, 0, sizeof(temp));
|
||||
strcpy(temp, dottests[_i].b);
|
||||
b = temp;
|
||||
inline_undotify(b, sizeof(temp));
|
||||
inline_undotify((uint8_t *)b, sizeof(temp));
|
||||
|
||||
fail_unless(strcmp(dottests[_i].a, temp) == 0,
|
||||
"'%s' != '%s'", temp, dottests[_i].a);
|
||||
@ -89,7 +89,7 @@ START_TEST(test_build_hostname)
|
||||
for (int j = 0; j < 10; j++) /* dummy header length */
|
||||
for (i = 1; i < sizeof(data); i++) {
|
||||
buf[j] = j + 'A';
|
||||
int len = build_hostname(buf, buflen, data, i, topdomain, get_base32_encoder(), buflen, j);
|
||||
int len = build_hostname((uint8_t *)buf, buflen, (uint8_t *)data, i, topdomain, get_base32_encoder(), buflen, j);
|
||||
|
||||
fail_if(len > i);
|
||||
fail_if((strstr(buf, ".") - buf) > 63, "First label in encoded hostname >63 bytes!");
|
||||
|
Loading…
Reference in New Issue
Block a user