diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-08-24 17:23:52 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-08-24 17:23:52 +0100 |
commit | 3948e6b783c15f3d3a2f1a2a89aaef3f5b0a26ee (patch) | |
tree | a8fc61c847c9f238161cb09e45abf3bb77a4a7dd /p2pvr/daemon | |
parent | Add missing link dependencies for tests (diff) | |
download | p2pvr-3948e6b783c15f3d3a2f1a2a89aaef3f5b0a26ee.tar.bz2 p2pvr-3948e6b783c15f3d3a2f1a2a89aaef3f5b0a26ee.tar.xz p2pvr-3948e6b783c15f3d3a2f1a2a89aaef3f5b0a26ee.zip |
In the event of an error handling/processing SI table data, discard any progress so far before propergating the exception
Diffstat (limited to 'p2pvr/daemon')
-rw-r--r-- | p2pvr/daemon/unittests/testErrorHandling.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/p2pvr/daemon/unittests/testErrorHandling.cpp b/p2pvr/daemon/unittests/testErrorHandling.cpp index 5b53999..be44ebc 100644 --- a/p2pvr/daemon/unittests/testErrorHandling.cpp +++ b/p2pvr/daemon/unittests/testErrorHandling.cpp @@ -66,6 +66,14 @@ class FailingTestNetworkParser : public SiNetworkInformationParser { throw DataHandlingException(); } }; + +class BrokenTestNetworkParser : public SiNetworkInformationParser { + public: + bool HandleTable(const ::DVBSI::NetworkPtr &) override + { + throw std::runtime_error("Unexpected"); + } +}; } } @@ -109,5 +117,14 @@ BOOST_AUTO_TEST_CASE(TestParserWithError) BOOST_REQUIRE_THROW(devices->SendNetworkInformation(del, a), DataHandlingException); } +BOOST_AUTO_TEST_CASE(TestParserBroken) +{ + BOOST_TEST_CHECKPOINT("Setup"); + auto del = si->GetDeliveryForSi(); + TemporaryIceAdapterObject<RawDataClient> a(getAdapter(), new BrokenTestNetworkParser()); + BOOST_TEST_CHECKPOINT("Make failing call"); + BOOST_REQUIRE_THROW(devices->SendNetworkInformation(del, a), Ice::UnknownException); +} + BOOST_AUTO_TEST_SUITE_END() |