summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-09-14 22:25:58 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-09-14 22:47:21 +0200
commit20755373b1494f1b718b1ac3a611c6f807905fe6 (patch)
tree6cc7e9ed94ae46de776ede705e49f977537b801f
parent86be3e1e6558f4e7e20c537e644656eb6f37b7d0 (diff)
test: fix test of uid-range
The number of uid's in the range should be tested instead of written directly. The test still passes with the fix checks. Found with Coverity. Fixes: CID#1237714 - 1237722
-rw-r--r--src/test/test-uid-range.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/test/test-uid-range.c b/src/test/test-uid-range.c
index 5f3d871b6c..06b4d43426 100644
--- a/src/test/test-uid-range.c
+++ b/src/test/test-uid-range.c
@@ -32,7 +32,7 @@ int main(int argc, char *argv[]) {
assert_se(uid_range_add_str(&p, &n, "500-999") >= 0);
assert_se(n == 1);
assert_se(p[0].start == 500);
- assert_se(p[0].nr = 500);
+ assert_se(p[0].nr == 500);
assert_se(!uid_range_contains(p, n, 499));
assert_se(uid_range_contains(p, n, 500));
@@ -52,40 +52,40 @@ int main(int argc, char *argv[]) {
assert_se(uid_range_add_str(&p, &n, "1000") >= 0);
assert_se(n == 1);
assert_se(p[0].start == 500);
- assert_se(p[0].nr = 501);
+ assert_se(p[0].nr == 501);
assert_se(uid_range_add_str(&p, &n, "30-40") >= 0);
assert_se(n == 2);
assert_se(p[0].start == 30);
- assert_se(p[0].nr = 11);
+ assert_se(p[0].nr == 11);
assert_se(p[1].start == 500);
- assert_se(p[1].nr = 501);
+ assert_se(p[1].nr == 501);
assert_se(uid_range_add_str(&p, &n, "60-70") >= 0);
assert_se(n == 3);
assert_se(p[0].start == 30);
- assert_se(p[0].nr = 11);
+ assert_se(p[0].nr == 11);
assert_se(p[1].start == 60);
- assert_se(p[1].nr = 11);
+ assert_se(p[1].nr == 11);
assert_se(p[2].start == 500);
- assert_se(p[2].nr = 501);
+ assert_se(p[2].nr == 501);
assert_se(uid_range_add_str(&p, &n, "20-2000") >= 0);
assert_se(n == 1);
assert_se(p[0].start == 20);
- assert_se(p[0].nr = 1981);
+ assert_se(p[0].nr == 1981);
assert_se(uid_range_add_str(&p, &n, "2002") >= 0);
assert_se(n == 2);
assert_se(p[0].start == 20);
- assert_se(p[0].nr = 1981);
+ assert_se(p[0].nr == 1981);
assert_se(p[1].start == 2002);
- assert_se(p[1].nr = 1);
+ assert_se(p[1].nr == 1);
assert_se(uid_range_add_str(&p, &n, "2001") >= 0);
assert_se(n == 1);
assert_se(p[0].start == 20);
- assert_se(p[0].nr = 1983);
+ assert_se(p[0].nr == 1983);
return 0;
}