[svn] commit: r3982 - in /branches/trac447/src/lib/datasrc: memory_datasrc.cc memory_datasrc.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Dec 23 10:51:48 UTC 2010
Author: vorner
Date: Thu Dec 23 10:51:44 2010
New Revision: 3982
Log:
Change AssertError to assert
Modified:
branches/trac447/src/lib/datasrc/memory_datasrc.cc
branches/trac447/src/lib/datasrc/memory_datasrc.h
Modified: branches/trac447/src/lib/datasrc/memory_datasrc.cc
==============================================================================
--- branches/trac447/src/lib/datasrc/memory_datasrc.cc (original)
+++ branches/trac447/src/lib/datasrc/memory_datasrc.cc Thu Dec 23 10:51:44 2010
@@ -13,7 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
#include <map>
-#include <iostream>
+#include <cassert>
#include <boost/shared_ptr.hpp>
#include <dns/name.h>
@@ -104,12 +104,9 @@
break;
// Something odd got out
default:
- isc_throw(AssertError,
- "RBTree<Domain>::insert returned unexpected result");
- }
- if (!node) {
- isc_throw(AssertError, "RBTree<Domain>::insert gave NULL node");
- }
+ assert(0);
+ }
+ assert(node);
// Now get the domain
DomainPtr domain;
@@ -151,18 +148,10 @@
case DomainTree::EXACTMATCH: // This one is OK, handle it
break;
default:
- isc_throw(AssertError,
- "RBTree<Domain>::find returned unexpected result");
+ assert(0);
}
- if (!node) {
- isc_throw(AssertError,
- "RBTree<Domain>::find gave NULL node when not returning"
- "NOTFOUND");
- }
- if (node->isEmpty()) {
- isc_throw(AssertError,
- "RBTree<Domain>::find gave empty node");
- }
+ assert(node);
+ assert(!node->isEmpty());
Domain::const_iterator found(node->getData()->find(type));
if (found != node->getData()->end()) {
Modified: branches/trac447/src/lib/datasrc/memory_datasrc.h
==============================================================================
--- branches/trac447/src/lib/datasrc/memory_datasrc.h (original)
+++ branches/trac447/src/lib/datasrc/memory_datasrc.h Thu Dec 23 10:51:44 2010
@@ -62,9 +62,6 @@
///
/// It returns NULL pointer in case of NXDOMAIN and NXRRSET
/// (the base class documentation does not seem to require that).
- ///
- /// It might throw AssertError as well, but it should not be
- /// expected (and caught), as it marks programmer error.
virtual FindResult find(const isc::dns::Name& name,
const isc::dns::RRType& type) const;
@@ -73,7 +70,6 @@
/// It puts another RRset into the zone.
///
/// It throws NullRRset or OutOfZone if the provided rrset is invalid.
- /// It might throw AssertError, but that one marks programmer errors.
///
/// \param rrset The set to add.
/// \return SUCCESS or EXIST (if an rrset for given name and type already
@@ -96,16 +92,6 @@
struct NullRRset : public InvalidParameter {
NullRRset(const char* file, size_t line, const char* what) :
InvalidParameter(file, line, what)
- { }
- };
-
- /// \brief Internal programmer error.
- ///
- /// This should not be expected. It means internal inconsistency is
- /// detected, eg. it marks the "Can Not Happen" conditions.
- struct AssertError : public Unexpected {
- AssertError(const char* file, size_t line, const char* what) :
- Unexpected(file, line, what)
{ }
};
More information about the bind10-changes
mailing list