X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fintmap%2Ftest%2Frun-signed-int.c;h=14e5a2e568515b27afd82c9c91647120b57dd7d7;hb=7d1f0c73e4d321561abb74f82c8be97f10d69836;hp=7c86a940c8538ef9a28e66099ed4e1fe57c473cb;hpb=b796c0318151ce34b56d2973f567335fbf20aae7;p=ccan diff --git a/ccan/intmap/test/run-signed-int.c b/ccan/intmap/test/run-signed-int.c index 7c86a940..14e5a2e5 100644 --- a/ccan/intmap/test/run-signed-int.c +++ b/ccan/intmap/test/run-signed-int.c @@ -9,13 +9,14 @@ int main(void) int64_t s; /* This is how many tests you plan to run */ - plan_tests(35); + plan_tests(38); sintmap_init(&map); /* Test boundaries. */ ok1(!sintmap_get(&map, 0x7FFFFFFFFFFFFFFFLL)); ok1(!sintmap_get(&map, -0x8000000000000000LL)); ok1(sintmap_first(&map, &s) == NULL); + ok1(sintmap_last(&map, &s) == NULL); ok1(errno == ENOENT); s = 0x7FFFFFFFFFFFFFFFLL; ok1(sintmap_after(&map, &s) == NULL); @@ -29,12 +30,14 @@ int main(void) ok1(sintmap_add(&map, 0x7FFFFFFFFFFFFFFFLL, first)); ok1(sintmap_get(&map, 0x7FFFFFFFFFFFFFFFLL) == first); ok1(sintmap_first(&map, &s) == first && s == 0x7FFFFFFFFFFFFFFFLL); + ok1(sintmap_last(&map, &s) == first && s == 0x7FFFFFFFFFFFFFFFLL); ok1(errno == 0); ok1(sintmap_add(&map, -0x8000000000000000LL, second)); ok1(sintmap_get(&map, 0x7FFFFFFFFFFFFFFFLL) == first); ok1(sintmap_get(&map, -0x8000000000000000LL) == second); ok1(sintmap_first(&map, &s) == second && s == -0x8000000000000000LL); ok1(sintmap_after(&map, &s) == first && s == 0x7FFFFFFFFFFFFFFFLL); + ok1(sintmap_last(&map, &s) == first && s == 0x7FFFFFFFFFFFFFFFLL); ok1(errno == 0); s = 0x7FFFFFFFFFFFFFFELL; ok1(sintmap_after(&map, &s) == first && s == 0x7FFFFFFFFFFFFFFFLL);