]> git.ozlabs.org Git - ccan/blobdiff - ccan/strmap/test/run.c
strmap: set errno on strmap_add() failures.
[ccan] / ccan / strmap / test / run.c
index 349ef4f7176c040511defc65cfe87fa45e360728..34302846f120f873aa856e2c08f750c48af5745d 100644 (file)
@@ -14,7 +14,7 @@ int main(void)
        char *v;
 
        /* This is how many tests you plan to run */
-       plan_tests(31);
+       plan_tests(32);
 
        strmap_init(&map);
 
@@ -31,6 +31,7 @@ int main(void)
 
        /* Add a duplicate should fail. */
        ok1(!strmap_add(&map, dup, val));
+       ok1(errno == EEXIST);
        ok1(strmap_get(&map, dup) == val);
 
        /* Delete should return original string. */