memfd_create.test: rewrite from match_grep to match_diff

* tests/memfd_create.c (main): Print expected output.
* tests/memfd_create.test: Use run_strace_match_diff.
* tests/memfd_create.expected: Remove.
* tests/Makefile.am (EXTRA_DIST): Remove it.
This commit is contained in:
Дмитрий Левин 2016-07-30 22:52:27 +00:00
parent b9bc216fdd
commit c4fdce5cea
4 changed files with 12 additions and 11 deletions

View File

@ -738,7 +738,6 @@ EXTRA_DIST = init.sh run.sh match.awk \
ipc_msgbuf.expected \
ksysent.sed \
lstatx.c \
memfd_create.expected \
mq.expected \
net.expected \
oldselect.expected \

View File

@ -1,13 +1,21 @@
#include "tests.h"
#include <unistd.h>
#include <sys/syscall.h>
#ifdef __NR_memfd_create
# include <stdio.h>
# include <unistd.h>
int
main(void)
{
syscall(__NR_memfd_create, "strace", 7);
static const char text[] = "strace";
int rc = syscall(__NR_memfd_create, text, 7);
printf("memfd_create(\"%s\", %s) = %d %s (%m)\n",
text, "MFD_CLOEXEC|MFD_ALLOW_SEALING|0x4", rc, errno2name());
puts("+++ exited with 0 +++");
return 0;
}

View File

@ -1 +0,0 @@
memfd_create\("strace", MFD_CLOEXEC\|MFD_ALLOW_SEALING\|0x4\) += -1 .*

View File

@ -1,11 +1,6 @@
#!/bin/sh
# Check memfd_create syscall decoding.
# Check decoding of memfd_create syscall.
. "${srcdir=.}/init.sh"
run_prog
run_strace -e memfd_create $args
match_grep
exit 0
run_strace_match_diff