From: Tomek Mrugalski Date: Mon, 25 Jul 2016 18:04:20 +0000 (+0200) Subject: [4277] Added several @todos and fixed formatting. X-Git-Tag: trac4551_base~12^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e2d2f21c645066287d6f9388f1cfded3f714a3e;p=thirdparty%2Fkea.git [4277] Added several @todos and fixed formatting. --- diff --git a/src/lib/dhcpsrv/mysql_host_data_source.cc b/src/lib/dhcpsrv/mysql_host_data_source.cc index 13748dcf2c..150a10391e 100644 --- a/src/lib/dhcpsrv/mysql_host_data_source.cc +++ b/src/lib/dhcpsrv/mysql_host_data_source.cc @@ -2321,6 +2321,7 @@ MySqlHostDataSource::get4(const SubnetID& subnet_id, ConstHostPtr MySqlHostDataSource::get4(const SubnetID& subnet_id, const asiolink::IOAddress& address) const { + /// @todo: check that address is really v4, not v6. // Set up the WHERE clause value MYSQL_BIND inbind[2]; @@ -2387,6 +2388,7 @@ MySqlHostDataSource::get6(const SubnetID& subnet_id, ConstHostPtr MySqlHostDataSource::get6(const asiolink::IOAddress& prefix, const uint8_t prefix_len) const { + /// @todo: Check that prefix is v6 address, not v4. // Set up the WHERE clause value MYSQL_BIND inbind[2]; diff --git a/src/lib/dhcpsrv/pgsql_host_data_source.cc b/src/lib/dhcpsrv/pgsql_host_data_source.cc index 080de03bf3..33a75ed262 100644 --- a/src/lib/dhcpsrv/pgsql_host_data_source.cc +++ b/src/lib/dhcpsrv/pgsql_host_data_source.cc @@ -1848,6 +1848,8 @@ PgSqlHostDataSource::get6(const SubnetID& subnet_id, ConstHostPtr PgSqlHostDataSource::get6(const asiolink::IOAddress& prefix, const uint8_t prefix_len) const { + /// @todo: Check that prefix is v6 address, not v4. + // Set up the WHERE clause value PsqlBindArrayPtr bind_array(new PsqlBindArray()); diff --git a/src/lib/dhcpsrv/pgsql_host_data_source.h b/src/lib/dhcpsrv/pgsql_host_data_source.h index e4703e2580..084a88f074 100644 --- a/src/lib/dhcpsrv/pgsql_host_data_source.h +++ b/src/lib/dhcpsrv/pgsql_host_data_source.h @@ -23,7 +23,7 @@ class PgSqlHostDataSourceImpl; /// the PostgreSQL database. Use of this backend presupposes that a PostgreSQL /// database is available and that the Kea schema has been created within it. /// -/// Reservations are uniquely identified by identifier type and value. Currently +/// Reservations are uniquely identified by identifier type and value. /// The currently supported values are defined in @ref Host::IdentifierType /// as well as in host_identifier_table: /// diff --git a/src/lib/dhcpsrv/tests/pgsql_exchange_unittest.cc b/src/lib/dhcpsrv/tests/pgsql_exchange_unittest.cc index c708cb86e0..75547a9fac 100755 --- a/src/lib/dhcpsrv/tests/pgsql_exchange_unittest.cc +++ b/src/lib/dhcpsrv/tests/pgsql_exchange_unittest.cc @@ -489,15 +489,13 @@ TEST_F(PgSqlBasicsTest, byteaTest) { ASSERT_THROW(PgSqlExchange::convertFromBytea(*r, row, BYTEA_COL, fetched_bytes, sizeof(fetched_bytes), - byte_count), - DbOperationError); + byte_count), DbOperationError); // Verify that too small of a buffer throws ASSERT_THROW(PgSqlExchange::convertFromBytea(*r, 0, BYTEA_COL, fetched_bytes, sizeof(fetched_bytes) - 1, - byte_count), - DbOperationError); + byte_count), DbOperationError); // Clean out the table WIPE_ROWS(r); @@ -567,8 +565,7 @@ TEST_F(PgSqlBasicsTest, bigIntTest) { // While we here, verify that bad row throws ASSERT_THROW(PgSqlExchange::getColumnValue(*r, row, BIGINT_COL, - fetched_int), - DbOperationError); + fetched_int), DbOperationError); // Clean out the table WIPE_ROWS(r); @@ -817,8 +814,7 @@ TEST_F(PgSqlBasicsTest, varcharTest) { // While we here, verify that bad row throws ASSERT_THROW(PgSqlExchange::getColumnValue(*r, row, VARCHAR_COL, - fetched_str), - DbOperationError); + fetched_str), DbOperationError); // Clean out the table WIPE_ROWS(r); @@ -902,8 +898,7 @@ TEST_F(PgSqlBasicsTest, timeStampTest) { // While we here, verify that bad row throws ASSERT_THROW(PgSqlExchange::getColumnValue(*r, row, TIMESTAMP_COL, - fetched_str), - DbOperationError); + fetched_str), DbOperationError); // Clean out the table WIPE_ROWS(r); @@ -922,8 +917,7 @@ TEST_F(PgSqlBasicsTest, timeStampTest) { // Verify exceeding max time throws ASSERT_THROW(PgSqlExchange::convertToDatabaseTime(times[0], DatabaseConnection:: - MAX_DB_TIME), - BadValue); + MAX_DB_TIME), BadValue); } }; // namespace