#include "uint-bset.h"
#include "curl_trc.h"
-static void check_set(const char *name, unsigned int capacity,
- const unsigned int *s, size_t slen)
+static void check_set(const char *name, uint32_t capacity,
+ const uint32_t *s, size_t slen)
{
struct uint32_bset bset;
size_t i, j;
- unsigned int n, c;
+ uint32_t n, c;
- curl_mfprintf(stderr, "test %s, capacity=%u, %zu numbers\n",
+ curl_mfprintf(stderr, "test %s, capacity=%" PRIu32 ", %zu numbers\n",
name, capacity, slen);
Curl_uint32_bset_init(&bset);
fail_unless(!Curl_uint32_bset_resize(&bset, capacity), "bset resize failed");
for(i = 1; i < slen; ++i) {
fail_unless(Curl_uint32_bset_next(&bset, n, &n), "next failed");
if(n != s[i]) {
- curl_mfprintf(stderr, "expected next to be %u, not %u\n", s[i], n);
+ curl_mfprintf(stderr, "expected next to be %" PRIu32
+ ", not %" PRIu32 "\n", s[i], n);
fail_unless(n == s[i], "next not correct number");
}
}
{
UNITTEST_BEGIN_SIMPLE
- static const unsigned int s1[] = {
+ static const uint32_t s1[] = {
/* spread numbers, some at slot edges */
0, 1, 4, 17, 63, 64, 65, 66, 90, 99,
};
- static const unsigned int s2[] = {
+ static const uint32_t s2[] = {
/* set with all bits in slot1 set */
64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79,
#include "curl_trc.h"
#include "unitprotos.h"
-static void check_spbset(const char *name, const unsigned int *s, size_t slen)
+static void check_spbset(const char *name, const uint32_t *s, size_t slen)
{
struct uint32_spbset bset;
size_t i, j;
- unsigned int n, c;
+ uint32_t c, n;
curl_mfprintf(stderr, "test %s, %zu numbers\n", name, slen);
for(i = 1; i < slen; ++i) {
fail_unless(Curl_uint32_spbset_next(&bset, n, &n), "next failed");
if(n != s[i]) {
- curl_mfprintf(stderr, "expected next to be %u, not %u\n", s[i], n);
+ curl_mfprintf(stderr, "expected next to be %" PRIu32
+ ", not %" PRIu32 "\n", s[i], n);
fail_unless(n == s[i], "next not correct number");
}
}
{
UNITTEST_BEGIN_SIMPLE
- static const unsigned int s1[] = {
+ static const uint32_t s1[] = {
/* spread numbers, some at slot edges */
0, 1, 4, 17, 63, 64, 65, 66, 90, 99,
};
- static const unsigned int s2[] = {
+ static const uint32_t s2[] = {
/* set with all bits in slot1 set */
64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79,
112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125, 126, 127,
};
- static const unsigned int s3[] = {
+ static const uint32_t s3[] = {
/* very spread numbers */
2232, 5167, 8204, 8526, 8641, 10056, 10140, 10611,
10998, 11626, 13735, 15539, 17947, 24295, 27833, 30318,