libi2ncommon: (gerd) fix exceptions in IP_RANGE
authorGerd v. Egidy <gerd.von.egidy@intra2net.com>
Sat, 4 Sep 2004 15:13:50 +0000 (15:13 +0000)
committerGerd v. Egidy <gerd.von.egidy@intra2net.com>
Sat, 4 Sep 2004 15:13:50 +0000 (15:13 +0000)
src/ipfunc.cpp
test/ip_range.cpp

index 9c641e2..ee44536 100644 (file)
@@ -143,7 +143,7 @@ IP_RANGE operator+(const IP_RANGE &base, const int &ips)
     }
     
     if (ret.t == RANGE && ret.turn_ip(ret.end) < ret.turn_ip(ret.ip))
-        throw out_of_range("range end lower than begin");
+        throw range_error("range end lower than begin");
     
     return ret;
 }
index 6f28dab..a75dd2a 100644 (file)
@@ -369,7 +369,7 @@ class ip_range : public TestFixture
         void OperatorPlusOverflow()
         {
             IP_RANGE a("255.255.255.0/255.255.255.0");
-            CPPUNIT_ASSERT_THROW(a=a+1, std::out_of_range);
+            CPPUNIT_ASSERT_THROW(a=a+1, std::range_error);
         }
         
         void OperatorMinus()