diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-11-21 08:58:06 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-12-05 16:24:54 +0100 |
commit | 0a535147f9bed7856e7ab3513fe3f6c38549a099 (patch) | |
tree | b220a1d531b8fa74babbf3f40ff26f7d91143df0 /sfx2/qa | |
parent | acd9e2165c42f0d6977e1ffd883983fe33c5d073 (diff) |
cool#9992 doc electronic sign: make return type for .uno:Signature consistent
It turns out the majority of getCommandValues() return values specify a
commandName and a commandValues key, which is helpful when we don't
track the request for this reply.
Fix .uno:Signature to do the same for consistency.
Change-Id: I46ffe5c36047ef2b59113d0221a1874ba28d335b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177857
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sfx2/qa')
-rw-r--r-- | sfx2/qa/cppunit/view.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sfx2/qa/cppunit/view.cxx b/sfx2/qa/cppunit/view.cxx index d2c81d6e9a6e..8c5be5920a07 100644 --- a/sfx2/qa/cppunit/view.cxx +++ b/sfx2/qa/cppunit/view.cxx @@ -132,8 +132,14 @@ CPPUNIT_TEST_FIXTURE(Sfx2ViewTest, testLokHelperCommandValuesSignature) std::stringstream aStream{ std::string(aJson) }; boost::property_tree::ptree aTree; boost::property_tree::read_json(aStream, aTree); + auto it = aTree.find("commandName"); + CPPUNIT_ASSERT(it != aTree.not_found()); + CPPUNIT_ASSERT_EQUAL(std::string(".uno:Signature"), it->second.get_value<std::string>()); + it = aTree.find("commandValues"); + CPPUNIT_ASSERT(it != aTree.not_found()); + aTree = it->second; // Non-zero timestamp: - auto it = aTree.find("signatureTime"); + it = aTree.find("signatureTime"); CPPUNIT_ASSERT(it != aTree.not_found()); auto nSignatureTime = it->second.get_value<sal_Int64>(); CPPUNIT_ASSERT(nSignatureTime != 0); @@ -157,7 +163,10 @@ OUString GetSignatureHash() std::stringstream aStream{ std::string(aJson) }; boost::property_tree::ptree aTree; boost::property_tree::read_json(aStream, aTree); - auto it = aTree.find("digest"); + auto it = aTree.find("commandValues"); + CPPUNIT_ASSERT(it != aTree.not_found()); + aTree = it->second; + it = aTree.find("digest"); CPPUNIT_ASSERT(it != aTree.not_found()); return OUString::fromUtf8(it->second.get_value<std::string>()); } |