loolwsd/TileCache.hpp | 1 + loolwsd/test/Makefile.am | 1 + loolwsd/test/UnitTileCache.cpp | 30 ++++++++++++++++++++++++++++++ loolwsd/test/helpers.hpp | 1 + 4 files changed, 33 insertions(+)
New commits: commit a800d366ba0fcc4408bef2d3a8733869be3763b5 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Sun May 1 11:53:37 2016 -0400 loolwsd: missing header Change-Id: Ib03f6fa048b0b38c0cba4216c4ca9b60f663f3f4 Reviewed-on: https://gerrit.libreoffice.org/24572 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/TileCache.hpp b/loolwsd/TileCache.hpp index 1d523db..1cf2cbe 100644 --- a/loolwsd/TileCache.hpp +++ b/loolwsd/TileCache.hpp @@ -12,6 +12,7 @@ #include <fstream> #include <memory> +#include <mutex> #include <set> #include <string> #include <vector> commit 461fd40b49e35c663d90f0369ab1148b0531bc04 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Sun May 1 11:20:41 2016 -0400 loolwsd: more support for TileCache unittest Change-Id: I7b09fdde8179c855bbb1545f3a2188be1c929d20 Reviewed-on: https://gerrit.libreoffice.org/24571 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/test/Makefile.am b/loolwsd/test/Makefile.am index 5ec0722..90d2c5f 100644 --- a/loolwsd/test/Makefile.am +++ b/loolwsd/test/Makefile.am @@ -25,6 +25,7 @@ unit_timeout_la_SOURCES = UnitTimeout.cpp unit_prefork_la_SOURCES = UnitPrefork.cpp unit_storage_la_SOURCES = UnitStorage.cpp unit_tilecache_la_SOURCES = UnitTileCache.cpp +unit_tilecache_la_CPPFLAGS = -DTDOC=\"$(top_srcdir)/test/data\" if HAVE_LO_PATH SYSTEM_STAMP = @SYSTEMPLATE_PATH@/system_stamp diff --git a/loolwsd/test/UnitTileCache.cpp b/loolwsd/test/UnitTileCache.cpp index 6ebf377..00898f2 100644 --- a/loolwsd/test/UnitTileCache.cpp +++ b/loolwsd/test/UnitTileCache.cpp @@ -12,14 +12,21 @@ #include <cassert> #include <iostream> #include <fstream> +#include <thread> #include "Util.hpp" #include "Unit.hpp" #include "UnitHTTP.hpp" +#include "helpers.hpp" class UnitTileCache: public UnitWSD { public: + UnitTileCache() : + _retValue(0) + { + } + virtual void lookupTile(int part, int width, int height, int tilePosX, int tilePosY, int tileWidth, int tileHeight, std::unique_ptr<std::fstream>& cacheFile) { @@ -30,6 +37,11 @@ public: cacheFile.reset(); } + virtual void returnValue(int & retValue) + { + retValue = _retValue; + } + virtual void invokeTest() { // FIXME: push through to the right place to exercise this. @@ -39,6 +51,24 @@ public: UnitWSD::testHandleRequest(TestRequest::TEST_REQ_PRISONER, request, response); } + +private: + void clientThread() + { + std::thread t([&]() + { + try + { + } + catch (const Poco::Exception& exc) + { + _retValue = 1; + } + }); + } + +private: + int _retValue; }; UnitBase *unit_create_wsd(void) diff --git a/loolwsd/test/helpers.hpp b/loolwsd/test/helpers.hpp index b7dae3d..9da8e69 100644 --- a/loolwsd/test/helpers.hpp +++ b/loolwsd/test/helpers.hpp @@ -36,6 +36,7 @@ #include <Poco/StringTokenizer.h> #include <Poco/Thread.h> #include <Poco/URI.h> +#include <cppunit/extensions/HelperMacros.h> #include <Common.hpp> #include <UserMessages.hpp> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits