Skip to content

Commit

Permalink
testsuite: Remove test387, since crlf conversion option is long gone
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Oct 29, 2024
1 parent ee7f55e commit cf691f3
Showing 1 changed file with 0 additions and 101 deletions.
101 changes: 0 additions & 101 deletions test/testsuite/T2_FPOpenFork.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,107 +779,6 @@ int fd;
exit_test("FPRead:test372: no crlf convertion for TEXT file");
}

/* -------------------------
* for this test you need a volume with options:crlf
* in AppleVolumes.default
*
* not run by default (need -f test387)
*/

/* --------------------- */
STATIC void test387()
{
char *name = "t387 file name.txt";
char data[20];
uint16_t vol = VolID;
int fork;
int ofs = 3 * sizeof( uint16_t );
struct afp_filedir_parms filedir;
DSI *dsi = &Conn->dsi;
uint16_t bitmap;
int fd;

ENTER_TEST

if (!Mac && Path[0] == '\0') {
test_skipped(T_MAC_PATH);
goto test_exit;
}

if (FPCreateFile(Conn, vol, 0, DIRDID_ROOT , name)) {
test_nottested();
goto fin;
}
bitmap = (1<< DIRPBIT_ATTR) | (1<<DIRPBIT_ATTR) | (1<<FILPBIT_FINFO) |
(1<<DIRPBIT_CDATE) | (1<<DIRPBIT_BDATE) | (1<<DIRPBIT_MDATE) |
(1<< DIRPBIT_LNAME) | (1<< DIRPBIT_PDID);

if (FPGetFileDirParams(Conn, vol, DIRDID_ROOT , name, bitmap,0)) {
test_failed();
goto fin;
}
else {
filedir.isdir = 0;
afp_filedir_unpack(&filedir, dsi->data +ofs, bitmap, 0);
memcpy(filedir.finder_info, "TEXTttxt", 8);

FAIL (FPSetFileParams(Conn, vol, DIRDID_ROOT , name, (1<<FILPBIT_FINFO), &filedir))
FAIL (FPGetFileDirParams(Conn, vol, DIRDID_ROOT , name, bitmap,0))
}
fork = FPOpenFork(Conn, vol, OPENFORK_DATA , bitmap ,DIRDID_ROOT, name,OPENACC_WR | OPENACC_RD);
if (!fork) {
test_failed();
goto fin;
}
if (FPWrite(Conn, fork, 0, 5, "test\r", 0 )) {
test_failed();
goto fin1;
}

if (FPRead(Conn, fork, 0, 5, data)) {
test_failed();
goto fin1;
}
if (memcmp(data, "test\r", 5)) {
if (!Quiet) {
fprintf(stdout, "\tFAILED wrote \"test\\r\" get \"%s\"\n", data);
}
test_failed();
}
if (!Mac) {
sprintf(temp,"%s/%s", Path, name);
fd = open(temp, O_RDWR , 0666);
if (fd < 0) {
if (!Quiet) {
fprintf(stdout,"\tFAILED unable to open %s :%s\n", temp, strerror(errno));
}
test_failed();
goto fin1;
}
if (read(fd, data, 5) != 5) {
if (!Quiet) {
fprintf(stdout,"\tFAILED unable to read data:%s\n", strerror(errno));
}
test_failed();
}
if (memcmp(data, "test\n", 5)) {
if (!Quiet) {
fprintf(stdout, "\tFAILED not \"test\\n\" get 0x%x 0x%x 0x%x 0x%x 0x%x\n",
data[0],data[1],data[2],data[3],data[4]);
}
test_failed();
}
close(fd);
}

fin1:
FAIL (FPCloseFork(Conn,fork))
fin:
FPDelete(Conn, vol, DIRDID_ROOT , name);
test_exit:
exit_test("FPRead:test387: crlf convertion for TEXT file");
}

/* --------------------- */
STATIC void test388()
{
Expand Down

0 comments on commit cf691f3

Please sign in to comment.