summaryrefslogtreecommitdiff
path: root/src/test/test-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test-util.c')
-rw-r--r--src/test/test-util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 3c79f8f4d9..d529a213cc 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -1415,6 +1415,15 @@ static void test_same_fd(void) {
assert_se(same_fd(b, a) == 0);
}
+static void test_uid_ptr(void) {
+
+ assert_se(UID_TO_PTR(0) != NULL);
+ assert_se(UID_TO_PTR(1000) != NULL);
+
+ assert_se(PTR_TO_UID(UID_TO_PTR(0)) == 0);
+ assert_se(PTR_TO_UID(UID_TO_PTR(1000)) == 1000);
+}
+
int main(int argc, char *argv[]) {
log_parse_environment();
log_open();
@@ -1490,6 +1499,7 @@ int main(int argc, char *argv[]) {
test_parse_proc_cmdline();
test_raw_clone();
test_same_fd();
+ test_uid_ptr();
return 0;
}