From 2795c0a17a8ee1d8bf34bbc57730e12e0c8ebde9 Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Mon, 13 Apr 2020 21:04:24 -0400 Subject: [PATCH] Attempt to fix PartTest build https://invent.kde.org/kde/konsole/-/merge_requests/70 https://build.kde.org/job/Applications/job/konsole/job/kf5-qt5%20SUSEQt5.12/184/testReport/junit/projectroot.src/autotests/PartTest/ --- src/autotests/PartTest.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/autotests/PartTest.cpp b/src/autotests/PartTest.cpp index bf36d65f..267c7835 100644 --- a/src/autotests/PartTest.cpp +++ b/src/autotests/PartTest.cpp @@ -104,11 +104,17 @@ void PartTest::testFd(bool runShell) // test that the 2nd argument of openTeletype is optional, // to run without shell - auto optArgRunShell = runShell ? QGenericArgument() : Q_ARG(bool, false); - // connect to an existing pty - bool result = QMetaObject::invokeMethod(terminalPart, "openTeletype", - Qt::DirectConnection, Q_ARG(int, fd), optArgRunShell); - QVERIFY(result); + if (runShell) { + // connect to an existing pty + bool result = QMetaObject::invokeMethod(terminalPart, "openTeletype", + Qt::DirectConnection, Q_ARG(int, fd)); + QVERIFY(result); + } else { + // test the optional 2nd argument of openTeletype, to run without shell + bool result = QMetaObject::invokeMethod(terminalPart, "openTeletype", + Qt::DirectConnection, Q_ARG(int, fd), Q_ARG(bool, false)); + QVERIFY(result); + } // suspend the KPtyDevice so that the embedded terminal gets a chance to // read from the pty. Otherwise the KPtyDevice will simply read everything