loolwsd: formatting

Change-Id: Id71a073c026ddea484fcb7da7d674109f3778c7c
Reviewed-on: https://gerrit.libreoffice.org/25346
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Ashod Nakashian 2016-05-22 18:47:04 -04:00 committed by Ashod Nakashian
parent 157386e3bc
commit dcfa259b4e
2 changed files with 18 additions and 19 deletions

View file

@ -1351,7 +1351,6 @@ void HTTPWSTest::testLimitCursor( std::function<void(const std::shared_ptr<Poco:
checkhandler(docWidth, docHeight, newWidth, newHeight);
}
CPPUNIT_TEST_SUITE_REGISTRATION(HTTPWSTest);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -151,7 +151,8 @@ void HTTPServerTest::testLoleafletPost()
CPPUNIT_ASSERT(html.find(_uri.getHost()) != std::string::npos);
}
namespace {
namespace
{
void assertHTTPFilesExist(const Poco::URI& uri, Poco::RegularExpression& expr, const std::string& html, const std::string& mimetype = std::string())
{
@ -161,29 +162,28 @@ void assertHTTPFilesExist(const Poco::URI& uri, Poco::RegularExpression& expr, c
for (int offset = 0; expr.match(html, offset, matches) > 0; offset = static_cast<int>(matches[0].offset + matches[0].length))
{
found = true;
CPPUNIT_ASSERT_EQUAL(2, (int)matches.size());
Poco::URI uriScript(html.substr(matches[1].offset, matches[1].length));
if (uriScript.getHost().empty())
{
std::string scriptString(uriScript.toString());
CPPUNIT_ASSERT_EQUAL(2, (int)matches.size());
Poco::URI uriScript(html.substr(matches[1].offset, matches[1].length));
if (uriScript.getHost().empty())
{
std::string scriptString(uriScript.toString());
// ignore the branding bits, it's not an error when they are not
// present
if (scriptString.find("/branding.") != std::string::npos)
continue;
// ignore the branding bits, it's not an error when they aren't present.
if (scriptString.find("/branding.") != std::string::npos)
continue;
std::unique_ptr<Poco::Net::HTTPClientSession> session(helpers::createSession(uri));
Poco::Net::HTTPRequest requestScript(Poco::Net::HTTPRequest::HTTP_GET, scriptString);
session->sendRequest(requestScript);
Poco::Net::HTTPRequest requestScript(Poco::Net::HTTPRequest::HTTP_GET, scriptString);
session->sendRequest(requestScript);
Poco::Net::HTTPResponse responseScript;
session->receiveResponse(responseScript);
CPPUNIT_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, responseScript.getStatus());
Poco::Net::HTTPResponse responseScript;
session->receiveResponse(responseScript);
CPPUNIT_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, responseScript.getStatus());
if (!mimetype.empty())
CPPUNIT_ASSERT_EQUAL(mimetype, responseScript.getContentType());
}
if (!mimetype.empty())
CPPUNIT_ASSERT_EQUAL(mimetype, responseScript.getContentType());
}
}
CPPUNIT_ASSERT_MESSAGE("No match found", found);