BIND 10 trac1407, updated. 207038a3ff7503cd2b2ab44238c71da55912bb4a [1407] Cleanups
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Nov 25 08:36:20 UTC 2011
The branch, trac1407 has been updated
via 207038a3ff7503cd2b2ab44238c71da55912bb4a (commit)
from 5dc772648fb9779359b4d409086d55745afccad9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 207038a3ff7503cd2b2ab44238c71da55912bb4a
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Nov 25 09:35:58 2011 +0100
[1407] Cleanups
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/python/rdata_python.cc | 22 ++++++++--------------
src/lib/dns/python/tests/rdata_python_test.py | 5 +----
2 files changed, 9 insertions(+), 18 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/python/rdata_python.cc b/src/lib/dns/python/rdata_python.cc
index 9eeb058..763fa09 100644
--- a/src/lib/dns/python/rdata_python.cc
+++ b/src/lib/dns/python/rdata_python.cc
@@ -100,31 +100,25 @@ Rdata_init(s_Rdata* self, PyObject* args) {
input_buffer, len);
return (0);
}
- }
- catch (const isc::dns::rdata::InvalidRdataText& irdt) {
+ } catch (const isc::dns::rdata::InvalidRdataText& irdt) {
PyErr_SetString(po_InvalidRdataText, irdt.what());
return (-1);
- }
- catch (const isc::dns::rdata::InvalidRdataLength& irdl) {
+ } catch (const isc::dns::rdata::InvalidRdataLength& irdl) {
PyErr_SetString(po_InvalidRdataLength, irdl.what());
return (-1);
- }
- catch (const isc::dns::rdata::CharStringTooLong& cstl) {
+ } catch (const isc::dns::rdata::CharStringTooLong& cstl) {
PyErr_SetString(po_CharStringTooLong, cstl.what());
return (-1);
- }
- catch (const isc::dns::DNSMessageFORMERR& dmfe) {
+ } catch (const isc::dns::DNSMessageFORMERR& dmfe) {
PyErr_SetString(po_DNSMessageFORMERR, dmfe.what());
return (-1);
- }
- // FIXME: These exceptions are not tested, I don't know how or if
- // at all they can be triggered. But they are caught just in the case.
- catch (const std::exception& ex) {
+ } catch (const std::exception& ex) {
+ // FIXME: These exceptions are not tested, I don't know how or if
+ // at all they can be triggered. But they are caught just in the case.
PyErr_SetString(PyExc_Exception, (std::string("Unknown exception: ") +
ex.what()).c_str());
return (-1);
- }
- catch (...) {
+ } catch (...) {
PyErr_SetString(PyExc_Exception, "Unknown exception");
return (-1);
}
diff --git a/src/lib/dns/python/tests/rdata_python_test.py b/src/lib/dns/python/tests/rdata_python_test.py
index 57c5b3c..81dea5f 100644
--- a/src/lib/dns/python/tests/rdata_python_test.py
+++ b/src/lib/dns/python/tests/rdata_python_test.py
@@ -37,11 +37,8 @@ class RdataTest(unittest.TestCase):
self.assertRaises(TypeError, Rdata, RRType("A"), RRClass("IN"), 1)
self.assertRaises(InvalidRdataText, Rdata, RRType("A"), RRClass("IN"),
"Invalid Rdata Text")
- s = ""
- for i in range(0, 256):
- s += ' '
self.assertRaises(CharStringTooLong, Rdata, RRType("TXT"),
- RRClass("IN"), s)
+ RRClass("IN"), ' ' * 256)
self.assertRaises(InvalidRdataLength, Rdata, RRType("TXT"),
RRClass("IN"), bytes(65536))
self.assertRaises(DNSMessageFORMERR, Rdata, RRType("TXT"),
More information about the bind10-changes
mailing list