If WriteFile() fails with ERROR_DISK_FULL or fflush() with ENOSPC then skip
the whole test. It can happen on older WinNT system without sparse file
support and with small disk.
---
mingw-w64-crt/testcases/t_fseeki64.c | 5 +++++
mingw-w64-crt/testcases/t_fseeko64.c | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/mingw-w64-crt/testcases/t_fseeki64.c
b/mingw-w64-crt/testcases/t_fseeki64.c
index 63d30ca14c4d..2ad581849f23 100644
--- a/mingw-w64-crt/testcases/t_fseeki64.c
+++ b/mingw-w64-crt/testcases/t_fseeki64.c
@@ -71,6 +71,11 @@ int main() {
assert(fputs("_", file) >= 0);
/* flush all data, so they can be accessed via WinAPI */
+ if (fflush(file) == EOF && errno == ENOSPC) {
+ /* skip the test for DISK FULL error */
+ printf("DISK FULL\n");
+ return 77;
+ }
assert(fflush(file) == 0);
/* now read all data via WinAPI and check that they were written at
correct offsets */
diff --git a/mingw-w64-crt/testcases/t_fseeko64.c
b/mingw-w64-crt/testcases/t_fseeko64.c
index c7bace6c8175..7db1ffd218de 100644
--- a/mingw-w64-crt/testcases/t_fseeko64.c
+++ b/mingw-w64-crt/testcases/t_fseeko64.c
@@ -18,6 +18,12 @@ static int writefile(const char *path){
return 1;
}
if (!WriteFile(fd, writebuf, strlen(writebuf), &dwResult, NULL)) {
+ if (GetLastError() == ERROR_DISK_FULL) {
+ /* skip the test for DISK FULL error */
+ printf("DISK FULL\n");
+ CloseHandle(fd);
+ return 77;
+ }
printf("writefile: write failed: winerror=%lu\n", GetLastError());
CloseHandle(fd);
return 1;
--
2.20.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public