clang-format
This commit is contained in:
@@ -36,57 +36,45 @@
|
||||
|
||||
#include "test.h"
|
||||
|
||||
static
|
||||
void
|
||||
readlink_file(void)
|
||||
{
|
||||
char buf[128];
|
||||
int fd, rv;
|
||||
static void readlink_file(void) {
|
||||
char buf[128];
|
||||
int fd, rv;
|
||||
|
||||
report_begin("readlink on file");
|
||||
fd = open_testfile("the question contains an invalid assumption");
|
||||
if (fd<0) {
|
||||
report_aborted();
|
||||
return;
|
||||
}
|
||||
close(fd);
|
||||
rv = readlink(TESTFILE, buf, sizeof(buf));
|
||||
report_check(rv, errno, EINVAL);
|
||||
remove(TESTFILE);
|
||||
report_begin("readlink on file");
|
||||
fd = open_testfile("the question contains an invalid assumption");
|
||||
if (fd < 0) {
|
||||
report_aborted();
|
||||
return;
|
||||
}
|
||||
close(fd);
|
||||
rv = readlink(TESTFILE, buf, sizeof(buf));
|
||||
report_check(rv, errno, EINVAL);
|
||||
remove(TESTFILE);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
readlink_dir(void)
|
||||
{
|
||||
char buf[128];
|
||||
int rv;
|
||||
static void readlink_dir(void) {
|
||||
char buf[128];
|
||||
int rv;
|
||||
|
||||
report_begin("readlink on .");
|
||||
rv = readlink(".", buf, sizeof(buf));
|
||||
report_check(rv, errno, EISDIR);
|
||||
report_begin("readlink on .");
|
||||
rv = readlink(".", buf, sizeof(buf));
|
||||
report_check(rv, errno, EISDIR);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
readlink_empty(void)
|
||||
{
|
||||
char buf[128];
|
||||
int rv;
|
||||
static void readlink_empty(void) {
|
||||
char buf[128];
|
||||
int rv;
|
||||
|
||||
report_begin("readlink on empty string");
|
||||
rv = readlink("", buf, sizeof(buf));
|
||||
report_check2(rv, errno, EISDIR, EINVAL);
|
||||
report_begin("readlink on empty string");
|
||||
rv = readlink("", buf, sizeof(buf));
|
||||
report_check2(rv, errno, EISDIR, EINVAL);
|
||||
}
|
||||
|
||||
void
|
||||
test_readlink(void)
|
||||
{
|
||||
test_readlink_path();
|
||||
test_readlink_buf();
|
||||
void test_readlink(void) {
|
||||
test_readlink_path();
|
||||
test_readlink_buf();
|
||||
|
||||
readlink_file();
|
||||
readlink_dir();
|
||||
readlink_empty();
|
||||
readlink_file();
|
||||
readlink_dir();
|
||||
readlink_empty();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user