From 254a6673bbc04eacbd67679b200bc9f1f75c0a07 Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Tue, 22 Oct 2024 18:31:28 +0200 Subject: [PATCH] testsuite: Correct error handling in tests --- test/testsuite/T2_FPRead.c | 6 +++++- test/testsuite/T2_FPSetFileParms.c | 5 +++-- test/testsuite/adoublehelper.c | 10 +++++----- test/testsuite/adoublehelper.h | 4 ++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/test/testsuite/T2_FPRead.c b/test/testsuite/T2_FPRead.c index 21f8b86dae..5665f2966d 100644 --- a/test/testsuite/T2_FPRead.c +++ b/test/testsuite/T2_FPRead.c @@ -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; @@ -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); diff --git a/test/testsuite/T2_FPSetFileParms.c b/test/testsuite/T2_FPSetFileParms.c index 016cd78905..fa1edd862f 100644 --- a/test/testsuite/T2_FPSetFileParms.c +++ b/test/testsuite/T2_FPSetFileParms.c @@ -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; @@ -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"); } diff --git a/test/testsuite/adoublehelper.c b/test/testsuite/adoublehelper.c index 58e521200b..dd96c0b8ca 100644 --- a/test/testsuite/adoublehelper.c +++ b/test/testsuite/adoublehelper.c @@ -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 @@ -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) { @@ -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 @@ -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) { @@ -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) { diff --git a/test/testsuite/adoublehelper.h b/test/testsuite/adoublehelper.h index 184ab4e83d..0e8c0bb5cf 100644 --- a/test/testsuite/adoublehelper.h +++ b/test/testsuite/adoublehelper.h @@ -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); /* ------------------- */