Browse Source

[4277] Added several @todos and fixed formatting.

Tomek Mrugalski 8 years ago
parent
commit
7e2d2f21c6

+ 2 - 0
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];

+ 2 - 0
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());
 

+ 1 - 1
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:
 ///

+ 6 - 12
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