summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Masei <gabriel.masei@1and1.ro>2020-09-21 18:41:20 +0300
committerJan Holesovsky <kendy@collabora.com>2020-10-07 16:16:54 +0200
commit21373089c03af04205aa8ce1a4c311c516eddee7 (patch)
tree76390a2febf8fcc45c490726c4c323b9480b83b0
parentcypress: reenable some impress tests. (diff)
downloadonline-21373089c03af04205aa8ce1a4c311c516eddee7.tar.gz
online-21373089c03af04205aa8ce1a4c311c516eddee7.zip
Unit test for skipping ModifiedStatus from deduplication for-code-assets
Change-Id: Ie20da2f0060b86c05b1f45e930f31ca5cab6d9fa
-rw-r--r--test/TileQueueTests.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/TileQueueTests.cpp b/test/TileQueueTests.cpp
index 30886cdb35..0d8f286c4e 100644
--- a/test/TileQueueTests.cpp
+++ b/test/TileQueueTests.cpp
@@ -47,6 +47,7 @@ class TileQueueTests : public CPPUNIT_NS::TestFixture
CPPUNIT_TEST(testSenderQueue);
CPPUNIT_TEST(testSenderQueueTileDeduplication);
CPPUNIT_TEST(testInvalidateViewCursorDeduplication);
+ CPPUNIT_TEST(testCallbackModifiedStatusIsSkipped);
CPPUNIT_TEST(testCallbackInvalidation);
CPPUNIT_TEST(testCallbackIndicatorValue);
CPPUNIT_TEST(testCallbackPageSize);
@@ -61,6 +62,7 @@ class TileQueueTests : public CPPUNIT_NS::TestFixture
void testSenderQueue();
void testSenderQueueTileDeduplication();
void testInvalidateViewCursorDeduplication();
+ void testCallbackModifiedStatusIsSkipped();
void testCallbackInvalidation();
void testCallbackIndicatorValue();
void testCallbackPageSize();
@@ -469,6 +471,33 @@ void TileQueueTests::testCallbackPageSize()
LOK_ASSERT_EQUAL(std::string("callback all 13 12474, 205748"), payloadAsString(queue.get()));
}
+void TileQueueTests::testCallbackModifiedStatusIsSkipped()
+{
+ TileQueue queue;
+ std::stringstream ss;
+ ss << "callback all " << LOK_CALLBACK_STATE_CHANGED;
+
+ const std::vector<std::string> messages =
+ {
+ ss.str() + " .uno:ModifiedStatus=false",
+ ss.str() + " .uno:ModifiedStatus=true",
+ ss.str() + " .uno:ModifiedStatus=true",
+ ss.str() + " .uno:ModifiedStatus=false"
+ };
+
+ for (const auto& msg : messages)
+ {
+ queue.put(msg);
+ }
+
+ LOK_ASSERT_EQUAL(static_cast<size_t>(4), queue.getQueue().size());
+
+ LOK_ASSERT_EQUAL(messages[0], payloadAsString(queue.get()));
+ LOK_ASSERT_EQUAL(messages[1], payloadAsString(queue.get()));
+ LOK_ASSERT_EQUAL(messages[2], payloadAsString(queue.get()));
+ LOK_ASSERT_EQUAL(messages[3], payloadAsString(queue.get()));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(TileQueueTests);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */