summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-03 18:23:26 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-04 09:07:31 +0200
commitef5c570edfd8afb20e3b04d3711e111a1dea0548 (patch)
tree458750d6fc37079a2948f2f72220c2ecc96839ff /src/test
parentb3ac818be8d73c97dc4f74ba8bbd2091506df2e6 (diff)
util: document why parse_uid() returns ENXIO
parse_uid() returns EINVAL for invalid strings, but ENXIO for the (uid_t) -1 user ids in order to distinguish these two cases. Document this.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/test-util.c b/src/test/test-util.c
index dff38ab6f6..10d8d210d5 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -282,6 +282,9 @@ static void test_parse_uid(void) {
r = parse_uid("65535", &uid);
assert_se(r == -ENXIO);
+
+ r = parse_uid("asdsdas", &uid);
+ assert_se(r == -EINVAL);
}
static void test_safe_atou16(void) {