[Libreoffice-commits] online.git: loolwsd/test
Tor Lillqvist
tml at collabora.com
Wed Apr 13 07:00:16 UTC 2016
loolwsd/test/httpwstest.cpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
New commits:
commit 8f3ec463b8d589dc607670918132ef7deebeba6b
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Apr 13 09:56:14 2016 +0300
Change some cppunit assertion messages to match what is actually being asserted
If you can't come up with a meaningful message to use in a
CPPUNIT_ASSERT_MESSAGE(), just use CPPUNIT_ASSERT() instead. These
messages aren't intended for end-users but for developers, so it is
pointless to make them high-level and dumbed-down.
diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 90711ac..3da76dd 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -593,7 +593,7 @@ void HTTPWSTest::testPasswordProtectedDocumentWithoutPassword()
std::string response;
getResponseMessage(socket, "error:", response, true);
- CPPUNIT_ASSERT_MESSAGE("failed command load: ", !response.empty());
+ CPPUNIT_ASSERT_MESSAGE("did not receive an error: message as expected", !response.empty());
{
Poco::StringTokenizer tokens(response, " ", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), tokens.count());
@@ -634,7 +634,7 @@ void HTTPWSTest::testPasswordProtectedDocumentWithWrongPassword()
std::string response;
getResponseMessage(socket, "error:", response, true);
- CPPUNIT_ASSERT_MESSAGE("failed command load: ", !response.empty());
+ CPPUNIT_ASSERT_MESSAGE("did not receive an error: message as expected", !response.empty());
{
Poco::StringTokenizer tokens(response, " ", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), tokens.count());
@@ -713,7 +713,7 @@ void HTTPWSTest::testImpressPartCountChanged()
std::string response;
getResponseMessage(socket, "status:", response, true);
- CPPUNIT_ASSERT_MESSAGE("failed command status: ", !response.empty());
+ CPPUNIT_ASSERT_MESSAGE("did not receive a status: message as expected", !response.empty());
{
Poco::StringTokenizer tokens(response, " ", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(5), tokens.count());
@@ -730,7 +730,7 @@ void HTTPWSTest::testImpressPartCountChanged()
{
sendTextFrame(socket, "uno .uno:InsertPage");
getResponseMessage(socket, "partscountchanged:", response, false);
- CPPUNIT_ASSERT_MESSAGE("failed command partscountchanged: ", !response.empty());
+ CPPUNIT_ASSERT_MESSAGE("did not receive a partscountchanged: message as expected", !response.empty());
{
Poco::JSON::Parser parser;
Poco::Dynamic::Var result = parser.parse(response);
@@ -744,7 +744,7 @@ void HTTPWSTest::testImpressPartCountChanged()
{
sendTextFrame(socket, "uno .uno:DeletePage");
getResponseMessage(socket, "partscountchanged:", response, false);
- CPPUNIT_ASSERT_MESSAGE("failed command partscountchanged: ", !response.empty());
+ CPPUNIT_ASSERT_MESSAGE("did not receive a partscountchanged: message as expected", !response.empty());
{
Poco::JSON::Parser parser;
Poco::Dynamic::Var result = parser.parse(response);
@@ -758,7 +758,7 @@ void HTTPWSTest::testImpressPartCountChanged()
{
sendTextFrame(socket, "uno .uno:Undo");
getResponseMessage(socket, "partscountchanged:", response, false);
- CPPUNIT_ASSERT_MESSAGE("failed command partscountchanged: ", !response.empty());
+ CPPUNIT_ASSERT_MESSAGE("did not receive a partscountchanged: message as expected", !response.empty());
{
Poco::JSON::Parser parser;
Poco::Dynamic::Var result = parser.parse(response);
@@ -772,7 +772,7 @@ void HTTPWSTest::testImpressPartCountChanged()
{
sendTextFrame(socket, "uno .uno:Redo");
getResponseMessage(socket, "partscountchanged:", response, false);
- CPPUNIT_ASSERT_MESSAGE("failed command partscountchanged: ", !response.empty());
+ CPPUNIT_ASSERT_MESSAGE("did not receive a partscountchanged: message as expected", !response.empty());
{
Poco::JSON::Parser parser;
Poco::Dynamic::Var result = parser.parse(response);
More information about the Libreoffice-commits
mailing list