tests/llseek.c: use libtests
* tests/llseek.c: Use SKIP_MAIN_UNDEFINED. (main): Use assert and perror_msg_and_skip.
This commit is contained in:
parent
b699cb7230
commit
a79617a637
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -30,9 +30,10 @@
|
||||
|
||||
#ifdef __NR__llseek
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
# include <assert.h>
|
||||
# include <errno.h>
|
||||
# include <stdio.h>
|
||||
# include <unistd.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
@ -41,12 +42,12 @@ main(void)
|
||||
const unsigned long low = 0xdeadbeef;
|
||||
const unsigned long long offset = 0xdefaceddeadbeef;
|
||||
unsigned long long result;
|
||||
int rc = syscall(__NR__llseek, -1, high, low, &result, SEEK_SET);
|
||||
|
||||
if (rc != -1 || EBADF != errno)
|
||||
return 77;
|
||||
assert(syscall(__NR__llseek, -1, high, low, &result, SEEK_SET) == -1);
|
||||
if (EBADF != errno)
|
||||
perror_msg_and_skip("_llseek");
|
||||
|
||||
printf("_llseek(-1, %llu, %p, SEEK_SET) = -1 EBADF (Bad file descriptor)\n",
|
||||
printf("_llseek(-1, %llu, %p, SEEK_SET) = -1 EBADF (%m)\n",
|
||||
offset, &result);
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
@ -55,10 +56,6 @@ main(void)
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
return 77;
|
||||
}
|
||||
SKIP_MAIN_UNDEFINED("__NR__llseek")
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user