Skip to content

Commit 8f7eb20

Browse files
authored
Do not print a warning when querying the dashboard server for a running program (#287)
Before, the dashboard client was printing a warning when no program was running and the `commandRunning` call was made. However, not having a program running is an absolutely valid result of that command, so it should not produce a warning about an unexpected answer.
1 parent 187e959 commit 8f7eb20

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ur/dashboard_client.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ bool DashboardClient::commandQuit()
322322
bool DashboardClient::commandRunning()
323323
{
324324
assertVersion("5.0.0", "1.6", "running");
325-
return sendRequest("running", "Program running: true");
325+
std::string const response = sendAndReceive("running");
326+
return std::regex_match(response, std::regex("Program running: true"));
326327
}
327328

328329
bool DashboardClient::commandIsProgramSaved()

tests/test_dashboard_client.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ TEST_F(DashboardClientTest, run_program)
8989
EXPECT_TRUE(dashboard_client_->commandPlay());
9090
EXPECT_TRUE(dashboard_client_->commandPause());
9191
EXPECT_TRUE(dashboard_client_->commandPlay());
92+
EXPECT_TRUE(dashboard_client_->commandRunning());
9293
EXPECT_TRUE(dashboard_client_->commandStop());
94+
EXPECT_FALSE(dashboard_client_->commandRunning());
9395
EXPECT_TRUE(dashboard_client_->commandPowerOff());
9496
dashboard_client_->commandClosePopup(); // Necessary for CB3 test
9597
}

0 commit comments

Comments
 (0)