[svn] commit: r3980 - in /branches/trac440/src/lib/datasrc: zonetable.cc zonetable.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Dec 23 10:47:53 UTC 2010
Author: vorner
Date: Thu Dec 23 10:47:52 2010
New Revision: 3980
Log:
Change AssertError to assert
Modified:
branches/trac440/src/lib/datasrc/zonetable.cc
branches/trac440/src/lib/datasrc/zonetable.h
Modified: branches/trac440/src/lib/datasrc/zonetable.cc
==============================================================================
--- branches/trac440/src/lib/datasrc/zonetable.cc (original)
+++ branches/trac440/src/lib/datasrc/zonetable.cc Thu Dec 23 10:47:52 2010
@@ -87,21 +87,11 @@
case ZoneTree::ALREADYEXIST:
break;
// Can Not Happen
- /*
- * This should generate no code if the implementation is correct
- * (since the compiler has complete code of RBTree right now, it
- * should see it can return only these two values). It is here
- * to catch programmer errors.
- */
default:
- isc_throw(AssertError,
- "RBTree<Zone>::insert returned unexpected result");
+ assert(0);
}
// Can Not Happen
- if (!node) {
- isc_throw(AssertError,
- "RBTree<Zone>::insert gave NULL pointer");
- }
+ assert(node);
// Is it empty? We either just created it or it might be nonterminal
if (node->isEmpty()) {
@@ -130,15 +120,11 @@
return (FindResult(result::NOTFOUND, ConstZonePtr()));
// Can Not Happen
default:
- isc_throw(AssertError,
- "RBTree<Zone>::find returned unexpected result");
+ assert(0);
}
// Can Not Happen (remember, NOTFOUND is handled)
- if (!node) {
- isc_throw(AssertError,
- "RBTree<Zone>::find gave NULL pointer");
- }
+ assert(node);
return (FindResult(my_result, node->getData()));
}
@@ -159,7 +145,7 @@
result::Result
ZoneTable::removeZone(const Name&) {
// TODO Implement
- isc_throw(AssertError, "Not implemented");
+ assert(0);
}
ZoneTable::FindResult
Modified: branches/trac440/src/lib/datasrc/zonetable.h
==============================================================================
--- branches/trac440/src/lib/datasrc/zonetable.h (original)
+++ branches/trac440/src/lib/datasrc/zonetable.h Thu Dec 23 10:47:52 2010
@@ -283,8 +283,6 @@
/// an exception of class \c InvalidParameter will be thrown.
/// If internal resource allocation fails, a corresponding standard
/// exception will be thrown.
- /// An AssertError throw is in the code, but it should never be
- /// thrown (and therefore never tried to catch).
/// This method never throws an exception otherwise.
///
/// \param zone A \c Zone object to be added.
@@ -319,25 +317,12 @@
/// - \c zone: A <Boost> shared pointer to the found \c Zone object if one
/// is found; otherwise \c NULL.
///
- /// This method never throws an exception (actually, there's code to throw
- /// AssertError, but that one means programmer error, so it should not be
- /// expected).
+ /// This method never throws an exception.
///
/// \param name A domain name for which the search is performed.
/// \return A \c FindResult object enclosing the search result (see above).
FindResult findZone(const isc::dns::Name& name) const;
- /// \brief An internal (programmer) error inside ZoneTable.
- ///
- /// This is thrown when the ZoneTable finds itself in an inconsistent
- /// state. It means there's a bug in the code somewhere.
- struct AssertError : public isc::Exception {
- /// \brief Constructor.
- AssertError(const char* file, size_t line, const char* what) :
- Exception(file, line, what)
- { }
- };
-
private:
struct ZoneTableImpl;
ZoneTableImpl* impl_;
More information about the bind10-changes
mailing list