]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2342] More changes as a result of review
authorStephen Morris <stephen@isc.org>
Thu, 8 Nov 2012 13:14:19 +0000 (13:14 +0000)
committerStephen Morris <stephen@isc.org>
Thu, 8 Nov 2012 13:14:19 +0000 (13:14 +0000)
a) Corrected some method headers
b) Added additional diagnostic output should the test fail to
   open the database.

src/lib/dhcp/mysql_lease_mgr.h
src/lib/dhcp/tests/mysql_lease_mgr_unittest.cc

index 9b699835805ce4930e3d575dd23ff51240745f92..5ebeadde36400ca04394524680d10c718e78076d 100644 (file)
@@ -213,9 +213,9 @@ public:
     /// If no such lease is present, an exception will be thrown.
     virtual void updateLease4(const Lease4Ptr& lease4);
 
-    /// @brief Updates IPv4 lease.
+    /// @brief Updates IPv6 lease.
     ///
-    /// @param lease4 The lease to be updated.
+    /// @param lease6 The lease to be updated.
     ///
     /// @throw isc::dhcp::NoSuchLease Attempt to update a lease that did not
     ///        exist.
@@ -223,16 +223,16 @@ public:
     ///        failed.
     virtual void updateLease6(const Lease6Ptr& lease6);
 
-    /// @brief Deletes a lease.
+    /// @brief Deletes an IPv4 lease.
     ///
     /// @param addr IPv4 address of the lease to be deleted.
     ///
     /// @return true if deletion was successful, false if no such lease exists
     virtual bool deleteLease4(const isc::asiolink::IOAddress& addr);
 
-    /// @brief Deletes a lease.
+    /// @brief Deletes an IPv6 lease.
     ///
-    /// @param addr IPv4 address of the lease to be deleted.
+    /// @param addr IPv6 address of the lease to be deleted.
     ///
     /// @return true if deletion was successful, false if no such lease exists
     ///
index 6c473bc90e6749b6700d8bafac2afcce58ff987b..a9b09ffbaeea57437c84ffb47b2be4733a9dcedf 100644 (file)
@@ -174,11 +174,20 @@ public:
         L4_ADDRESS(ADDRESS_4), L4_IOADDRESS(L4_ADDRESS), 
         L5_ADDRESS(ADDRESS_5), L5_IOADDRESS(L5_ADDRESS), 
         L6_ADDRESS(ADDRESS_6), L6_IOADDRESS(L6_ADDRESS), 
-        L7_ADDRESS(ADDRESS_7), L7_IOADDRESS(L7_ADDRESS)
-        {
+        L7_ADDRESS(ADDRESS_7), L7_IOADDRESS(L7_ADDRESS) {
+
         destroySchema();
         createSchema();
-        LeaseMgrFactory::create(validConnectionString());
+        try {
+            LeaseMgrFactory::create(validConnectionString());
+        } catch (...) {
+            std::cerr << "*** ERROR: unable to open database. The test\n"
+                         "*** environment is broken and must be fixed before\n"
+                         "*** the MySQL tests will run correctly.\n"
+                         "*** The reason for the problem is described in the\n"
+                         "*** accompanying exception output.\n";
+            throw;
+        }
         lmptr_ = &(LeaseMgrFactory::instance());
     }
 
@@ -419,7 +428,7 @@ TEST(MySqlOpenTest, OpenDatabase) {
         LeaseMgrFactory::destroy();
     } catch (const isc::Exception& ex) {
         FAIL() << "*** ERROR: unable to open database, reason:\n"
-               << "    " << ex.what()
+               << "    " << ex.what() << "\n"
                << "*** The test environment is broken and must be fixed\n"
                << "*** before the MySQL tests will run correctly.\n";
     }