[Libreoffice-commits] online.git: loolwsd/test
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Sun Oct 23 21:00:45 UTC 2016
loolwsd/test/helpers.hpp | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit 58bf5bbf37eb339ac46d3841061bd35ed982603c
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Fri Oct 21 22:02:15 2016 -0400
loolwsd: throw on unexpected errors in getResponseMessage
Tests should read errors and parse them if they are
expected. Otherwise, we should not ignore them and move
on, because they are (by the above definition) unexpected.
Change-Id: I9d7a9fb23879044ac4f11461e92c5f6fd6b03fa1
Reviewed-on: https://gerrit.libreoffice.org/30194
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/test/helpers.hpp b/loolwsd/test/helpers.hpp
index cb96a87..3bbac6a 100644
--- a/loolwsd/test/helpers.hpp
+++ b/loolwsd/test/helpers.hpp
@@ -222,6 +222,12 @@ std::vector<char> getResponseMessage(Poco::Net::WebSocket& ws, const std::string
if ((flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE)
{
+ // Don't ignore errors.
+ if (LOOLProtocol::matchPrefix("error:", message))
+ {
+ throw std::runtime_error(message);
+ }
+
std::cerr << name << "Ignored: " << message << std::endl;
}
}
More information about the Libreoffice-commits
mailing list