test/httpwstest.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
New commits: commit 23f23068ddd1e241e34aea4f6a1e19fc56d4ad66 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Fri Apr 7 00:32:01 2017 -0400 wsd: fix testSlideShow Change-Id: I2acf7f0ee509f193b0be46af6ba4363b8aecb98f Reviewed-on: https://gerrit.libreoffice.org/36244 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp index 5b364fd2..0a629ceb 100644 --- a/test/httpwstest.cpp +++ b/test/httpwstest.cpp @@ -31,6 +31,7 @@ #include <Poco/Net/Socket.h> #include <Poco/Path.h> #include <Poco/RegularExpression.h> +#include <Poco/StreamCopier.h> #include <Poco/StringTokenizer.h> #include <Poco/URI.h> @@ -82,7 +83,7 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture CPPUNIT_TEST(testPasswordProtectedOOXMLDocument); CPPUNIT_TEST(testPasswordProtectedBinaryMSOfficeDocument); CPPUNIT_TEST(testInsertDelete); - // FIXME CPPUNIT_TEST(testSlideShow); + CPPUNIT_TEST(testSlideShow); CPPUNIT_TEST(testInactiveClient); CPPUNIT_TEST(testMaxColumn); CPPUNIT_TEST(testMaxRow); @@ -1170,12 +1171,19 @@ void HTTPWSTest::testSlideShow() session->sendRequest(requestSVG); Poco::Net::HTTPResponse responseSVG; - session->receiveResponse(responseSVG); + std::istream& rs = session->receiveResponse(responseSVG); CPPUNIT_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, responseSVG.getStatus()); CPPUNIT_ASSERT_EQUAL(std::string("image/svg+xml"), responseSVG.getContentType()); + std::cerr << "SVG file size: " << responseSVG.getContentLength() << std::endl; + // std::ofstream ofs("/tmp/slide.svg"); + // Poco::StreamCopier::copyStream(rs, ofs); + // ofs.close(); + (void)rs; // Some setups render differently; recognize these two valid output sizes for now. - CPPUNIT_ASSERT(responseSVG.getContentLength() == std::streamsize(451329) || - responseSVG.getContentLength() == std::streamsize(467345)); + // Seems LO generates different svg content, even though visually identical. + // Current known sizes: 434748, 451329, 467345. + CPPUNIT_ASSERT(responseSVG.getContentLength() >= std::streamsize(434748) && + responseSVG.getContentLength() <= std::streamsize(467345)); } catch (const Poco::Exception& exc) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits