diff --git a/test/UnitQuarantine.cpp b/test/UnitQuarantine.cpp index 1be840e46d37..e32ff51685e7 100644 --- a/test/UnitQuarantine.cpp +++ b/test/UnitQuarantine.cpp @@ -24,9 +24,6 @@ #include #include -/// Since our fake URL is always the same, this is the document path in the quarantine directory. -constexpr auto DocumentUrl = "/http%3A%2F%2F127.0.0.1%3A9981%2Fwopi%2Ffiles%2F0/"; - namespace { std::vector getQuarantineFiles(const std::string testname, @@ -238,7 +235,8 @@ class UnitQuarantineConflict : public WOPIUploadConflictCommon LOK_ASSERT_EQUAL_MESSAGE("Unexpected contents in storage", std::string(OriginalDocContent), getFileContent()); - const std::string quarantinePath = _quarantinePath + DocumentUrl; + const std::string documentUrl = Uri::encode(helpers::getTestServerURI() + "/wopi/files/0"); + const std::string quarantinePath = _quarantinePath + '/' + documentUrl; const std::vector files = getQuarantineFiles(testname, quarantinePath); LOK_ASSERT_MESSAGE("Expected 1 quaratined files in [" << quarantinePath << ']', files.size() == 1); @@ -342,7 +340,7 @@ class UnitQuarantineCrash : public WopiTestServer void kitKilled(int count) override { LOG_TST("Kit killed"); - LOK_ASSERT_EQUAL_MESSAGE("Expected only 1 killed kit", 1, count); + LOK_ASSERT(static_cast(count) <= _kitsPids.size()); // This supresses the default handler which fails the test. } @@ -367,7 +365,8 @@ class UnitQuarantineCrash : public WopiTestServer LOG_TST("Testing with dockey [" << docKey << "] closed."); LOK_ASSERT_STATE(_phase, Phase::Unload); - const std::string quarantinePath = _quarantinePath + DocumentUrl; + const std::string documentUrl = Uri::encode(helpers::getTestServerURI() + "/wopi/files/0"); + const std::string quarantinePath = _quarantinePath + '/' + documentUrl; const std::vector files = getQuarantineFiles(testname, quarantinePath); LOK_ASSERT_MESSAGE("Expected 1 quaratined files in [" << quarantinePath << ']', files.size() == 1);