[education/rkward] rkward/autotests: Avoid test crash on Windows

Thomas Friedrichsmeier null at kde.org
Sun Oct 2 16:49:43 BST 2022


Git commit 0a6d83cf430bd5f455b10739d54993046fac19a8 by Thomas Friedrichsmeier.
Committed on 02/10/2022 at 15:49.
Pushed by tfry into branch 'master'.

Avoid test crash on Windows

M  +8    -2    rkward/autotests/core_test.cpp

https://invent.kde.org/education/rkward/commit/0a6d83cf430bd5f455b10739d54993046fac19a8

diff --git a/rkward/autotests/core_test.cpp b/rkward/autotests/core_test.cpp
index a826dace..59ba318e 100644
--- a/rkward/autotests/core_test.cpp
+++ b/rkward/autotests/core_test.cpp
@@ -103,6 +103,12 @@ class RKWardCoreTest: public QObject {
 			testLog("%s", output.data());
 		}
 	}
+
+	QString backendStatus() {
+		if (RInterface::instance()->backendIsDead()) return "dead";
+		if (RInterface::instance()->backendIsIdle()) return "idle";
+		return "dead";
+	}
     
 	QPointer<RKWardMainWindow> main_win;
 private slots:
@@ -111,9 +117,9 @@ private slots:
 	}
 
 	void cleanup() {
-		testLog("Cleanup. Backend status: %s", RInterface::instance()->backendIsDead() ? "dead" : (RInterface::instance()->backendIsIdle() ? "idle" : "busy"));
+		testLog("Cleanup. Backend status: %s", qPrintable(backendStatus()));
 		waitForAllFinished();
-		testLog("Cleanup done. Backend status: %s", RInterface::instance()->backendIsDead() ? "dead" : (RInterface::instance()->backendIsIdle() ? "idle" : "busy"));
+		testLog("Cleanup done. Backend status: %s", qPrintable(backendStatus()));
 	}
 
 	void initTestCase() {


More information about the rkward-tracker mailing list