Skip to content

Commit

Permalink
Modify UnitLoadTorture.cpp for JSON.
Browse files Browse the repository at this point in the history
Signed-off-by: Gökay Şatır <[email protected]>
Change-Id: Ibf3588ab4f55d743901342768bfcb3c5b8e1bf3e
  • Loading branch information
gokaysatir committed Oct 7, 2024
1 parent b4fbc7a commit 5ce8c95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/UnitLoadTorture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ void UnitLoadTorture::loadTorture(const std::string& name, const std::string& do
const std::string status = COOLProtocol::getFirstLine(message);

int viewid = -1;
LOK_ASSERT(COOLProtocol::getTokenIntegerFromMessage(status, "viewid", viewid));
Poco::JSON::Parser parser;
Poco::Dynamic::Var statusJsonVar = parser.parse(status.substr(7));
const Poco::SharedPtr<Poco::JSON::Object>& statusJsonObject = statusJsonVar.extract<Poco::JSON::Object::Ptr>();
if (statusJsonObject->has("viewid"))
viewid = std::atoi(statusJsonObject->get("viewid").toString().c_str());

LOK_ASSERT("Failed to create view in time " && viewid >= 0);

Expand Down

0 comments on commit 5ce8c95

Please sign in to comment.