From: Stephen Morris Date: Thu, 8 Nov 2012 13:14:19 +0000 (+0000) Subject: [2342] More changes as a result of review X-Git-Tag: trac2487_base~1^2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0ad16d99eb0bc2148976a31c4dbf7ff0ed5516a;p=thirdparty%2Fkea.git [2342] More changes as a result of review a) Corrected some method headers b) Added additional diagnostic output should the test fail to open the database. --- diff --git a/src/lib/dhcp/mysql_lease_mgr.h b/src/lib/dhcp/mysql_lease_mgr.h index 9b69983580..5ebeadde36 100644 --- a/src/lib/dhcp/mysql_lease_mgr.h +++ b/src/lib/dhcp/mysql_lease_mgr.h @@ -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 /// diff --git a/src/lib/dhcp/tests/mysql_lease_mgr_unittest.cc b/src/lib/dhcp/tests/mysql_lease_mgr_unittest.cc index 6c473bc90e..a9b09ffbae 100644 --- a/src/lib/dhcp/tests/mysql_lease_mgr_unittest.cc +++ b/src/lib/dhcp/tests/mysql_lease_mgr_unittest.cc @@ -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"; }