projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
t/axmap: use a 64-bit type (not size_t) for axmap tests
[fio.git]
/
t
/
axmap.c
diff --git
a/t/axmap.c
b/t/axmap.c
index 1752439ae66e79a021773cc0d1a581f0c5b4278b..9d6bdee5e8b7f7c18e3388caae096fe879bf1bb3 100644
(file)
--- a/
t/axmap.c
+++ b/
t/axmap.c
@@
-5,7
+5,7
@@
#include "../lib/lfsr.h"
#include "../lib/axmap.h"
#include "../lib/lfsr.h"
#include "../lib/axmap.h"
-static int test_regular(
size
_t size, int seed)
+static int test_regular(
uint64
_t size, int seed)
{
struct fio_lfsr lfsr;
struct axmap *map;
{
struct fio_lfsr lfsr;
struct axmap *map;
@@
-61,11
+61,11
@@
static int check_next_free(struct axmap *map, uint64_t start, uint64_t expected)
return 0;
}
return 0;
}
-static int test_next_free(
size
_t size, int seed)
+static int test_next_free(
uint64
_t size, int seed)
{
struct fio_lfsr lfsr;
struct axmap *map;
{
struct fio_lfsr lfsr;
struct axmap *map;
-
size
_t osize;
+
uint64
_t osize;
uint64_t ff, lastfree;
int err, i;
uint64_t ff, lastfree;
int err, i;
@@
-196,7
+196,7
@@
static int test_next_free(size_t size, int seed)
return 0;
}
return 0;
}
-static int test_multi(
size
_t size, unsigned int bit_off)
+static int test_multi(
uint64
_t size, unsigned int bit_off)
{
unsigned int map_size = size;
struct axmap *map;
{
unsigned int map_size = size;
struct axmap *map;
@@
-351,6
+351,11
@@
static int test_overlap(void)
.nr = 60,
.ret = 14,
},
.nr = 60,
.ret = 14,
},
+ {
+ .start = 22670,
+ .nr = 60,
+ .ret = 0,
+ },
{
.start = -1U,
},
{
.start = -1U,
},
@@
-366,7
+371,7
@@
static int test_overlap(void)
entries = this;
}
entries = this;
}
- printf("Test overlaps...");
+ printf("Test overlaps...
\n
");
fflush(stdout);
map = axmap_new(entries);
fflush(stdout);
map = axmap_new(entries);
@@
-374,25
+379,23
@@
static int test_overlap(void)
for (i = 0; tests[i].start != -1U; i++) {
struct overlap_test *t = &tests[i];
for (i = 0; tests[i].start != -1U; i++) {
struct overlap_test *t = &tests[i];
+ printf("\tstart=%6u, nr=%3u: ", t->start, t->nr);
ret = axmap_set_nr(map, t->start, t->nr);
if (ret != t->ret) {
ret = axmap_set_nr(map, t->start, t->nr);
if (ret != t->ret) {
- printf("fail\n");
- printf("start=%u, nr=%d, ret=%d: %d\n", t->start, t->nr,
- t->ret, ret);
+ printf("%3d (FAIL, wanted %d)\n", ret, t->ret);
err = 1;
break;
}
err = 1;
break;
}
+ printf("%3d (PASS)\n", ret);
}
}
- if (!err)
- printf("pass!\n");
axmap_free(map);
return err;
}
int main(int argc, char *argv[])
{
axmap_free(map);
return err;
}
int main(int argc, char *argv[])
{
-
size_t size = (1U
L << 23) - 200;
+
uint64_t size = (1UL
L << 23) - 200;
int seed = 1;
if (argc > 1) {
int seed = 1;
if (argc > 1) {