[education/rkward] rkward/rbackend: Add some asserts for diagnostics

Thomas Friedrichsmeier null at kde.org
Thu Jul 28 12:51:29 BST 2022


Git commit f94c81d8ad2464af1a7ad1e80ccca0d55d0a5004 by Thomas Friedrichsmeier.
Committed on 28/07/2022 at 11:51.
Pushed by tfry into branch 'master'.

Add some asserts for diagnostics

M  +3    -1    rkward/rbackend/rkrbackend.cpp

https://invent.kde.org/education/rkward/commit/f94c81d8ad2464af1a7ad1e80ccca0d55d0a5004

diff --git a/rkward/rbackend/rkrbackend.cpp b/rkward/rbackend/rkrbackend.cpp
index f6926ec7..8d3d83c4 100644
--- a/rkward/rbackend/rkrbackend.cpp
+++ b/rkward/rbackend/rkrbackend.cpp
@@ -1692,7 +1692,8 @@ void RKRBackend::initialize (const QString &locale_dir) {
 
 	// in RInterface::RInterface() we have created a fake RCommand to capture all the output/errors during startup. Fetch it
 	repl_status.eval_depth++;
-	fetchNextCommand ();
+	fetchNextCommand();
+	RK_ASSERT(current_command);
 
 	startR ();
 
@@ -1738,6 +1739,7 @@ void RKRBackend::initialize (const QString &locale_dir) {
 	// in fact, a number of sub-commands are run while handling this request!
 	handleRequest (&req);
 
+	RK_ASSERT(current_command);
 	commandFinished ();		// the fake startup command
 	repl_status.eval_depth--;
 }


More information about the rkward-tracker mailing list