From e65246b854b09ca418936843ee61aebefdc7f863 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 Reviewed-by: Assam Boudjelthia (cherry picked from commit f7559904d0e8f7966e726fd04801cb58a1bd4a2d) Reviewed-by: Qt Cherry-pick Bot --- 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 d3f8e7cfb24..9fe8dee040b 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -2634,7 +2634,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)); } @@ -2658,10 +2658,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); @@ -2671,10 +2667,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);