[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - test/WopiProofTests.cpp
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 6 04:36:23 UTC 2020
test/WopiProofTests.cpp | 15 +++++++++++++++
1 file changed, 15 insertions(+)
New commits:
commit 64e83c1640c581a38aa79a64c095004ac12cb709
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Jul 2 10:54:59 2020 +0300
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jul 6 06:36:04 2020 +0200
tdf#134041: add a unit test
Change-Id: Ic040adb7a2a73635041146f6d6425db1b02c2e61
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97721
Tested-by: Jenkins
Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit 04709ab7fc37f25b33be54c84fc262bc8e79e646)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97678
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/test/WopiProofTests.cpp b/test/WopiProofTests.cpp
index 3e4aa5418..cfa1f57dc 100644
--- a/test/WopiProofTests.cpp
+++ b/test/WopiProofTests.cpp
@@ -137,6 +137,21 @@ void WopiProofTests::testOurProof()
int64_t ticks = std::stoll(timestamp.c_str(), nullptr, 10);
verifySignature(access_token, uri, ticks, modulus, exponent, proof);
+
+ // tdf#134041: test another data
+
+ access_token = "~!@#$%^&*()_+`1234567890-=";
+ uri = "https://user2@short.com:12345/blah?query_string=bar";
+ pairs = gen.GetProofHeaders(access_token, uri);
+ len = pairs.size();
+ LOK_ASSERT_EQUAL(2, len);
+ LOK_ASSERT_EQUAL(pairs[0].first, std::string("X-WOPI-TimeStamp"));
+ timestamp = pairs[0].second;
+ LOK_ASSERT_EQUAL(pairs[1].first, std::string("X-WOPI-Proof"));
+ proof = pairs[1].second;
+
+ ticks = std::stoll(timestamp.c_str(), nullptr, 10);
+ verifySignature(access_token, uri, ticks, modulus, exponent, proof);
}
CPPUNIT_TEST_SUITE_REGISTRATION(WopiProofTests);
More information about the Libreoffice-commits
mailing list