Skip to content

Commit 3b152c1

Browse files
committed
Avoid printing on stdout with exit()
1 parent 175b529 commit 3b152c1

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/scriptable/scriptable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ void Scriptable::exit()
861861
{
862862
m_skipArguments = 0;
863863
QByteArray message = fromString( tr("Terminating server.\n") );
864-
print(message);
864+
printError(message);
865865
m_proxy->exit();
866866
}
867867

src/tests/tests_other.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,8 @@ void Tests::startServerAndRunCommand()
818818
// The sleep() call ensures that the server finishes and terminates the
819819
// client connection.
820820
QCOMPARE( run(Args("--start-server") << "exit();sleep(10000)", &stdoutActual, &stderrActual), 0 );
821-
QCOMPARE(stdoutActual, "Terminating server.\n");
821+
QCOMPARE(stdoutActual, "");
822+
QCOMPARE(stderrActual, "Terminating server.\n");
822823

823824
// Try to start new client.
824825
SleepTimer t(10000);

src/tests/tests_scripts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
void Tests::commandExit()
1414
{
15-
RUN("exit", "Terminating server.\n");
15+
RUN("exit", "");
1616

1717
TEST( m_test->waitForServerToStop() );
1818

0 commit comments

Comments
 (0)