tests: add umask.test
* tests/umask.c: New file. * tests/umask.test: New test. * tests/.gitignore: Add umask. * tests/Makefile.am (check_PROGRAMS): Likewise. (TESTS): Add umask.test.
This commit is contained in:
parent
a4128a75f5
commit
eee3476844
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
@ -121,6 +121,7 @@ uid
|
||||
uid16
|
||||
uid32
|
||||
uio
|
||||
umask
|
||||
umount
|
||||
umount2
|
||||
umovestr
|
||||
|
@ -169,6 +169,7 @@ check_PROGRAMS = \
|
||||
uid16 \
|
||||
uid32 \
|
||||
uio \
|
||||
umask \
|
||||
umount \
|
||||
umount2 \
|
||||
umovestr \
|
||||
@ -325,6 +326,7 @@ TESTS = \
|
||||
uid16.test \
|
||||
uid32.test \
|
||||
uio.test \
|
||||
umask.test \
|
||||
umount.test \
|
||||
umount2.test \
|
||||
umovestr.test \
|
||||
|
12
tests/umask.c
Normal file
12
tests/umask.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
mode_t rc = umask(044);
|
||||
printf("umask(%#o) = %#o\n", 044, rc);
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
return 0;
|
||||
}
|
11
tests/umask.test
Executable file
11
tests/umask.test
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check umask syscall decoding.
|
||||
|
||||
. "${srcdir=.}/init.sh"
|
||||
|
||||
run_prog > /dev/null
|
||||
OUT="$LOG.out"
|
||||
run_strace -eumask -a11 $args > "$OUT"
|
||||
match_diff "$LOG" "$OUT"
|
||||
rm -f "$OUT"
|
Loading…
Reference in New Issue
Block a user