[Libreoffice-commits] online.git: loolwsd/test
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Sun May 8 04:33:45 UTC 2016
loolwsd/test/httpwstest.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit b3acb4001d20bdb820e45c27543321f392995ca5
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sat May 7 23:38:25 2016 -0400
loolwsd: add tests to validate Impress page changes
Validate the pages before/after insert/delete and
undo/redo operations.
Change-Id: I16aa14f022a8bb0a4b126ea9bc222b788dc7d2dc
Reviewed-on: https://gerrit.libreoffice.org/24747
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 6d9be1b..42acae9 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -891,6 +891,8 @@ void HTTPWSTest::testInsertDelete()
getPartHashCodes(response, parts);
CPPUNIT_ASSERT_EQUAL(1, (int)parts.size());
+ const auto slide1Hash = parts[0];
+
// insert 10 slides
std::cerr << "Inserting 10 slides." << std::endl;
for (size_t it = 1; it <= 10; it++)
@@ -902,6 +904,9 @@ void HTTPWSTest::testInsertDelete()
CPPUNIT_ASSERT_EQUAL(it + 1, parts.size());
}
+ CPPUNIT_ASSERT_MESSAGE("Hash code of slide #1 changed after inserting extra slides.", parts[0] == slide1Hash);
+ const std::vector<std::string> parts_after_insert(parts.begin(), parts.end());
+
// delete 10 slides
std::cerr << "Deleting 10 slides." << std::endl;
for (size_t it = 1; it <= 10; it++)
@@ -913,6 +918,8 @@ void HTTPWSTest::testInsertDelete()
CPPUNIT_ASSERT_EQUAL(11 - it, parts.size());
}
+ CPPUNIT_ASSERT_MESSAGE("Hash code of slide #1 changed after deleting extra slides.", parts[0] == slide1Hash);
+
// undo delete slides
std::cerr << "Undoing 10 slide deletes." << std::endl;
for (size_t it = 1; it <= 10; it++)
@@ -924,6 +931,10 @@ void HTTPWSTest::testInsertDelete()
CPPUNIT_ASSERT_EQUAL(it + 1, parts.size());
}
+ CPPUNIT_ASSERT_MESSAGE("Hash code of slide #1 changed after undoing slide delete.", parts[0] == slide1Hash);
+ const std::vector<std::string> parts_after_undo(parts.begin(), parts.end());
+ CPPUNIT_ASSERT_MESSAGE("Hash codes changed between deleting and undo.", parts_after_insert == parts_after_undo);
+
// redo inserted slides
std::cerr << "Redoing 10 slide deletes." << std::endl;
for (size_t it = 1; it <= 10; it++)
@@ -935,6 +946,8 @@ void HTTPWSTest::testInsertDelete()
CPPUNIT_ASSERT_EQUAL(11 - it, parts.size());
}
+ CPPUNIT_ASSERT_MESSAGE("Hash code of slide #1 changed after redoing slide delete.", parts[0] == slide1Hash);
+
// check total slides 1
std::cerr << "Expecting 1 slide." << std::endl;
sendTextFrame(socket, "status");
More information about the Libreoffice-commits
mailing list