Skip to content

Commit

Permalink
testsuite: Correct error handling in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Oct 22, 2024
1 parent 95abcaf commit 254a667
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
6 changes: 5 additions & 1 deletion test/testsuite/T2_FPRead.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ STATIC void test109()
goto test_exit;
}

if (adouble == AD_EA) {
test_skipped(T_ADV2);
goto test_exit;
}

if (FPCreateFile(Conn, vol, 0, DIRDID_ROOT , name)) {
nottested();
goto test_exit;
Expand All @@ -45,7 +50,6 @@ STATIC void test109()
/* ----------------- */
if (chmod_unix_rfork(Path, "", name, 0400) != 0) {
failed();
exit(1);
goto fin;
}
fork = FPOpenFork(Conn, vol, OPENFORK_RSCS , bitmap ,DIRDID_ROOT, name, OPENACC_RD);
Expand Down
5 changes: 3 additions & 2 deletions test/testsuite/T2_FPSetFileParms.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ STATIC void test426()

ENTER_TEST

// FIXME: test stalls indefinitely with Netatalk 4.0
// FIXME: unexpected failure with Netatalk 4.0
if (Exclude) {
test_skipped(T_EXCLUDE);
goto test_exit;
Expand Down Expand Up @@ -206,11 +206,12 @@ STATIC void test426()
failed();
}

test_exit:
if (fork) {
FPCloseFork(Conn,fork);
}
FAIL (FPDelete(Conn, vol, DIRDID_ROOT , name))

test_exit:
exit_test("FPSetFileParms:test426: Create a dangling symlink");
}

Expand Down
10 changes: 5 additions & 5 deletions test/testsuite/adoublehelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static int chmod_unix_adouble(char *path,char *name, int mode)

/* --------------------
*/
int chmod_unix_meta(char *path, char *name, char *file, int mode)
int chmod_unix_meta(char *path, char *name, char *file, mode_t mode)
{
if (adouble == AD_EA) {
#ifdef HAVE_EAFD
Expand All @@ -270,7 +270,7 @@ int chmod_unix_meta(char *path, char *name, char *file, int mode)
} else {
sprintf(temp, "%s/%s/.AppleDouble/%s", path, name, file);
if (!Quiet) {
fprintf(stdout, "chmod (%s, %o)\n", temp, mode);
fprintf(stdout, "chmod (%s, 0%o)\n", temp, mode);
}
if (chmod(temp, mode)) {
if (!Quiet) {
Expand All @@ -285,7 +285,7 @@ int chmod_unix_meta(char *path, char *name, char *file, int mode)

/* --------------------
*/
int chmod_unix_rfork(char *path, char *name, char *file, int mode)
int chmod_unix_rfork(char *path, char *name, char *file, mode_t mode)
{
if (adouble == AD_EA) {
#ifdef HAVE_EAFD
Expand All @@ -304,7 +304,7 @@ int chmod_unix_rfork(char *path, char *name, char *file, int mode)
#else
sprintf(temp, "%s/%s/._%s", path, name, file);
if (!Quiet) {
fprintf(stdout, "chmod(%s, %d)\n", temp, mode);
fprintf(stdout, "chmod(%s, 0%o)\n", temp, mode);
}
if (chmod(temp, mode)) {
if (!Quiet) {
Expand All @@ -318,7 +318,7 @@ int chmod_unix_rfork(char *path, char *name, char *file, int mode)
} else {
sprintf(temp, "%s/%s/.AppleDouble/%s", path, name, file);
if (!Quiet) {
fprintf(stdout, "chmod (%s, %o)\n", temp, mode);
fprintf(stdout, "chmod (%s, 0%o)\n", temp, mode);
}
if (chmod(temp, mode)) {
if (!Quiet) {
Expand Down
4 changes: 2 additions & 2 deletions test/testsuite/adoublehelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern int rename_unix_file(char *path, char *dir, char *src, char *dst);
extern int unlink_unix_file(char *path, char *name, char *file);
extern int symlink_unix_file(char *target, char *path, char *source);

extern int chmod_unix_meta(char *path, char *name, char *file, int mode);
extern int chmod_unix_rfork(char *path, char *name, char *file, int mode);
extern int chmod_unix_meta(char *path, char *name, char *file, mode_t mode);
extern int chmod_unix_rfork(char *path, char *name, char *file, mode_t mode);
/* -------------------
*/

0 comments on commit 254a667

Please sign in to comment.