From f7559904d0e8f7966e726fd04801cb58a1bd4a2d Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Mon, 19 Dec 2022 13:36:47 +0200 Subject: [PATCH] Autoclose a FILE* if we open it Task-number: QTBUG-105736 Change-Id: I2bc10b54b77436cad914ec21fd85678c54de4305 Pick-to: 6.5 6.4 6.2 Reviewed-by: Assam Boudjelthia --- tests/auto/corelib/io/qfile/tst_qfile.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 625de417959..a7fbef2485e 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -2627,7 +2627,7 @@ static void unixPipe_helper(int pipes[2]) QFile f; if (useStdio) { FILE *fh = fdopen(pipes[0], "rb"); - QVERIFY(f.open(fh, QIODevice::ReadOnly | QIODevice::Unbuffered)); + QVERIFY(f.open(fh, QIODevice::ReadOnly | QIODevice::Unbuffered, QFileDevice::AutoCloseHandle)); } else { QVERIFY(f.open(pipes[0], QIODevice::ReadOnly | QIODevice::Unbuffered)); } @@ -2651,10 +2651,6 @@ void tst_QFile::unixPipe_data() void tst_QFile::unixPipe() { -#ifdef Q_OS_ANDROID - if (QNativeInterface::QAndroidApplication::sdkVersion() >= 31) - QSKIP("Crashes on Android 12 (QTBUG-105736)"); -#endif int pipes[2] = { -1, -1 }; QVERIFY2(pipe(pipes) == 0, qPrintable(qt_error_string())); unixPipe_helper(pipes); @@ -2664,10 +2660,6 @@ void tst_QFile::unixPipe() void tst_QFile::socketPair() { -#ifdef Q_OS_ANDROID - if (QNativeInterface::QAndroidApplication::sdkVersion() >= 31) - QSKIP("Crashes on Android 12 (QTBUG-105736)"); -#endif int pipes[2] = { -1, -1 }; QVERIFY2(socketpair(AF_UNIX, SOCK_STREAM, 0, pipes) == 0, qPrintable(qt_error_string())); unixPipe_helper(pipes);