Unit tests for the indicator value and page size callback merging.

Change-Id: Id97fcf9bad37669eb649f73b38b4dba0b2e9a00e
This commit is contained in:
Jan Holesovsky 2017-04-07 12:29:01 +02:00
parent 1585cbdb6b
commit 8ea0bd03b2

View file

@ -50,6 +50,8 @@ class TileQueueTests : public CPPUNIT_NS::TestFixture
CPPUNIT_TEST(testSenderQueueTileDeduplication);
CPPUNIT_TEST(testInvalidateViewCursorDeduplication);
CPPUNIT_TEST(testCallbackInvalidation);
CPPUNIT_TEST(testCallbackIndicatorValue);
CPPUNIT_TEST(testCallbackPageSize);
CPPUNIT_TEST_SUITE_END();
@ -62,6 +64,8 @@ class TileQueueTests : public CPPUNIT_NS::TestFixture
void testSenderQueueTileDeduplication();
void testInvalidateViewCursorDeduplication();
void testCallbackInvalidation();
void testCallbackIndicatorValue();
void testCallbackPageSize();
};
void TileQueueTests::testTileQueuePriority()
@ -444,6 +448,30 @@ void TileQueueTests::testCallbackInvalidation()
CPPUNIT_ASSERT_EQUAL(std::string("callback all 0 EMPTY, 0"), payloadAsString(queue.get()));
}
void TileQueueTests::testCallbackIndicatorValue()
{
TileQueue queue;
// join tiles
queue.put("callback all 10 25");
queue.put("callback all 10 50");
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(queue._queue.size()));
CPPUNIT_ASSERT_EQUAL(std::string("callback all 10 50"), payloadAsString(queue.get()));
}
void TileQueueTests::testCallbackPageSize()
{
TileQueue queue;
// join tiles
queue.put("callback all 13 12474, 188626");
queue.put("callback all 13 12474, 205748");
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(queue._queue.size()));
CPPUNIT_ASSERT_EQUAL(std::string("callback all 13 12474, 205748"), payloadAsString(queue.get()));
}
CPPUNIT_TEST_SUITE_REGISTRATION(TileQueueTests);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */