chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify execute_directory()
[elogind.git]
/
src
/
test
/
test-util.c
diff --git
a/src/test/test-util.c
b/src/test/test-util.c
index 3c79f8f4d98719282187ec26624eb1975c3fdcef..d862149fa83927fc7685afc6f133fadd3ae802b5 100644
(file)
--- a/
src/test/test-util.c
+++ b/
src/test/test-util.c
@@
-1219,7
+1219,7
@@
static void test_execute_directory(void) {
assert_se(chmod(name2, 0755) == 0);
assert_se(touch(name3) >= 0);
assert_se(chmod(name2, 0755) == 0);
assert_se(touch(name3) >= 0);
- execute_directory(tempdir,
NULL,
DEFAULT_TIMEOUT_USEC, NULL);
+ execute_directory(tempdir, DEFAULT_TIMEOUT_USEC, NULL);
assert_se(access("/tmp/test-execute_directory/it_works", F_OK) >= 0);
assert_se(access("/tmp/test-execute_directory/it_works2", F_OK) >= 0);
assert_se(access("/tmp/test-execute_directory/it_works", F_OK) >= 0);
assert_se(access("/tmp/test-execute_directory/it_works2", F_OK) >= 0);
@@
-1415,6
+1415,15
@@
static void test_same_fd(void) {
assert_se(same_fd(b, a) == 0);
}
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();
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_parse_proc_cmdline();
test_raw_clone();
test_same_fd();
+ test_uid_ptr();
return 0;
}
return 0;
}