[Libreoffice-commits] online.git: test/TileCacheTests.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Jan 9 06:24:43 UTC 2017
test/TileCacheTests.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
New commits:
commit 92ac46e5f1988adf5458a97e089d18ef13dff6ca
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sun Jan 8 21:28:20 2017 -0500
wsd: no need to render all tiles of all parts in unittests
Change-Id: I4d2eadf64f0c86e4b83af2f25a772f4b88d6a987
Reviewed-on: https://gerrit.libreoffice.org/32869
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index 78e54c5..44a3484 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -981,8 +981,9 @@ void TileCacheTests::checkTiles(std::shared_ptr<LOOLWebSocket>& socket, const st
// random setclientpart
std::srand(std::time(nullptr));
- std::vector<int> vParts = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ std::vector<int> vParts = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
std::random_shuffle(vParts.begin(), vParts.end());
+ int requests = 0;
for (auto it : vParts)
{
if (currentPart != it)
@@ -996,6 +997,12 @@ void TileCacheTests::checkTiles(std::shared_ptr<LOOLWebSocket>& socket, const st
assertResponseString(socket, "setpart:", name);
requestTiles(socket, it, docWidth, docHeight, name);
+
+ if (++requests >= 3)
+ {
+ // No need to test all parts.
+ break;
+ }
}
currentPart = it;
More information about the Libreoffice-commits
mailing list