Added userland/testbin

This commit is contained in:
Guru Prasad Srinivasa
2016-02-29 20:10:59 -05:00
parent a5963a0e31
commit d466eb7102
53 changed files with 1538 additions and 460 deletions

View File

@@ -37,32 +37,46 @@
#include "test.h"
static
void
int
symlink_empty1(void)
{
int rv;
int result;
report_begin("symlink -> empty string");
rv = symlink("", TESTLINK);
report_check2(rv, errno, 0, EINVAL);
result = report_check2(rv, errno, 0, EINVAL);
remove(TESTLINK);
return result;
}
static
void
int
symlink_empty2(void)
{
int rv;
report_begin("symlink named empty string");
rv = symlink("foo", "");
report_check(rv, errno, EINVAL);
return report_check(rv, errno, EINVAL);
}
void
test_symlink(void)
{
test_symlink_paths();
symlink_empty1();
symlink_empty2();
int ntests = 0, lost_points = 0;
int result;
test_symlink_paths(&ntests, &lost_points);
ntests++;
result = symlink_empty1();
handle_result(result, &lost_points);
ntests++;
result = symlink_empty2();
handle_result(result, &lost_points);
partial_credit(SECRET, "/testbin/badcall-symlink", ntests - lost_points, ntests);
}