Skip to content

Commit

Permalink
testsuite: cover reversed idset_range_clear() range
Browse files Browse the repository at this point in the history
  • Loading branch information
garlick committed Dec 12, 2018
1 parent 48abac1 commit ef29cdc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/common/libidset/test/idset.c
Expand Up @@ -275,7 +275,7 @@ void test_range_set (void)

ok (idset_range_set (idset, 0, 2) == 0,
"idset_range_set 0-2 worked");
ok (idset_range_set (idset, 80, 79) == 0,
ok (idset_range_set (idset, 80, 79) == 0, // revsersed
"idset_set 80-79 worked");

errno = 0;
Expand Down Expand Up @@ -353,8 +353,10 @@ void test_range_clear (void)
if (!(idset = idset_decode ("1-10")))
BAIL_OUT ("idset_decode [1-10] failed");

ok (idset_range_clear (idset, 2, 9) == 0,
"idset_range_clear 2-9 works");
ok (idset_range_clear (idset, 2, 5) == 0,
"idset_range_clear 2-5 works");
ok (idset_range_clear (idset, 9, 6) == 0, // reversed
"idset_range_clear 9-6 works");
errno = 0;
ok (idset_range_clear (idset, IDSET_INVALID_ID, 2) < 0 && errno == EINVAL,
"idset_range_clear lo=INVALID fails with EINVAL");
Expand Down

0 comments on commit ef29cdc

Please sign in to comment.