From 19a7f1d288f4ff57129078c339c09a78c0b2c2f4 Mon Sep 17 00:00:00 2001 From: Tamás Zolnai Date: Thu, 12 Mar 2020 16:59:14 +0100 Subject: test: better fix for UnitWOPISaveAs test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't check the full URL, but just test some parts of it. Change-Id: I5367bf4f41dc26f311e03de7ce06349f744d0b85 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90428 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai --- test/UnitWOPISaveAs.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/test/UnitWOPISaveAs.cpp b/test/UnitWOPISaveAs.cpp index 2831aa5433..46f5a23099 100644 --- a/test/UnitWOPISaveAs.cpp +++ b/test/UnitWOPISaveAs.cpp @@ -45,20 +45,14 @@ public: { const std::string message(data, len); - const std::string expected( - "saveas: url=" + helpers::getTestServerURI() - + "/something%20wopi/files/1?access_token=anything&reuse_cookies=cook=well " - "filename=hello%20world%251.pdf xfilename=hello world%1.pdf"); - if (message.find(expected) == 0) + if (message.find("saveas: url=") != std::string::npos && + message.find(helpers::getTestServerURI()) != std::string::npos && + message.find("filename=hello%20world%251.pdf") != std::string::npos) { // successfully exit the test if we also got the outgoing message // notifying about saving the file exitTest(TestResult::Ok); } - else - { - LOG_DBG("UnitWOPISaveAs: Skipping unexpected SendMessage: " << message); - } return false; } -- cgit