summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-10-25 15:14:24 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-10-26 08:00:21 -0400
commit580374daba2ab2c6075a7d0de9512abff133e2e9 (patch)
treedfd9abe14efa5f6c79291ef72b1d2ac0b8326334 /src/tests
parent13147b598a8409c338abb9472e74bbd606f224bd (diff)
downloadsssd-580374daba2ab2c6075a7d0de9512abff133e2e9.tar.gz
sssd-580374daba2ab2c6075a7d0de9512abff133e2e9.tar.bz2
sssd-580374daba2ab2c6075a7d0de9512abff133e2e9.zip
Always use uint32_t for UID/GID numbers
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/strtonum-tests.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tests/strtonum-tests.c b/src/tests/strtonum-tests.c
index 6c260189..2b91d482 100644
--- a/src/tests/strtonum-tests.c
+++ b/src/tests/strtonum-tests.c
@@ -38,15 +38,15 @@
#define CHECK_RESULT(expected, actual) \
do { \
- fail_unless(result == expected, "Expected %ld, got %ld", \
- expected, result); \
+ fail_unless(actual == expected, "Expected %ld, got %ld", \
+ expected, actual); \
} while(0)
#define CHECK_ERRNO(expected, actual) \
do { \
- fail_unless(error == ERANGE, "Expected errno %d[%s], got %d[%s]", \
- ERANGE, strerror(ERANGE), \
- error, strerror(ERANGE)); \
+ fail_unless(actual == expected, "Expected errno %d[%s], got %d[%s]", \
+ expected, strerror(expected), \
+ actual, strerror(actual)); \
} while(0)
#define CHECK_ENDPTR(expected, actual) \
@@ -146,7 +146,7 @@ START_TEST (test_strtoint32_pos_integer_overflow_base_10)
CHECK_ERRNO(ERANGE, error);
CHECK_ZERO_ENDPTR(endptr);
- CHECK_RESULT(expected, actual);
+ CHECK_RESULT(expected, result);
}
END_TEST
@@ -163,7 +163,7 @@ START_TEST (test_strtoint32_pos_integer_underflow_base_10)
CHECK_ERRNO(ERANGE, error);
CHECK_ZERO_ENDPTR(endptr);
- CHECK_RESULT(expected, actual);
+ CHECK_RESULT(expected, result);
}
END_TEST
@@ -265,14 +265,14 @@ START_TEST (test_strtouint32_neg_integer_base_10)
{
uint32_t result;
const char *input = "-123";
- uint32_t expected = -123;
+ uint32_t expected = UINT32_MAX;
char *endptr;
errno_t error;
result = strtouint32(input, &endptr, 10);
error = errno;
- EXPECT_UNSET_ERRNO(error);
+ CHECK_ERRNO(ERANGE, error);
CHECK_ZERO_ENDPTR(endptr);
CHECK_RESULT(expected, result);
}
@@ -309,7 +309,7 @@ START_TEST (test_strtouint32_pos_integer_overflow_base_10)
CHECK_ERRNO(ERANGE, error);
CHECK_ZERO_ENDPTR(endptr);
- CHECK_RESULT(expected, actual);
+ CHECK_RESULT(expected, result);
}
END_TEST