2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-01 06:25:34 +00:00

[4283] Fixed a few unused constant pending (i.e., ignored by default) warnings

This commit is contained in:
Francis Dupont
2016-07-02 14:41:56 +02:00
parent 99f610ff41
commit 14a753b76e
3 changed files with 7 additions and 22 deletions

View File

@@ -25,8 +25,7 @@ namespace {
const uint8_t HWADDR0[] = { 0, 1, 2, 3, 4, 5 }; const uint8_t HWADDR0[] = { 0, 1, 2, 3, 4, 5 };
const uint8_t HWADDR1[] = { 0xd, 0xe, 0xa, 0xd, 0xb, 0xe, 0xe, 0xf }; const uint8_t HWADDR1[] = { 0xd, 0xe, 0xa, 0xd, 0xb, 0xe, 0xe, 0xf };
const uint8_t CLIENTID0[] = { 1, 2, 3, 4 }; const uint8_t CLIENTID[] = { 1, 2, 3, 4 };
const uint8_t CLIENTID1[] = { 0xa, 0xb, 0xc, 0xd };
/// @brief Test fixture class for @c CSVLeaseFile4 validation. /// @brief Test fixture class for @c CSVLeaseFile4 validation.
class CSVLeaseFile4Test : public ::testing::Test { class CSVLeaseFile4Test : public ::testing::Test {
@@ -219,7 +218,7 @@ TEST_F(CSVLeaseFile4Test, recreate) {
// Create second lease, with non-NULL client id. // Create second lease, with non-NULL client id.
lease.reset(new Lease4(IOAddress("192.0.3.10"), lease.reset(new Lease4(IOAddress("192.0.3.10"),
hwaddr1_, hwaddr1_,
CLIENTID0, sizeof(CLIENTID0), CLIENTID, sizeof(CLIENTID),
100, 60, 90, 0, 7)); 100, 60, 90, 0, 7));
{ {
SCOPED_TRACE("Second write"); SCOPED_TRACE("Second write");

View File

@@ -32,7 +32,7 @@ namespace {
/// @brief Holds a type of the last identifier in @c IdentifierType enum. /// @brief Holds a type of the last identifier in @c IdentifierType enum.
/// ///
/// This value must be updated when new identifiers are added to the enum. /// This value must be updated when new identifiers are added to the enum.
const Host::IdentifierType LAST_IDENTIFIER_TYPE = Host::IDENT_CIRCUIT_ID; // const Host::IdentifierType LAST_IDENTIFIER_TYPE = Host::IDENT_CIRCUIT_ID;
/// @brief Test fixture class for @c HostReservationParser. /// @brief Test fixture class for @c HostReservationParser.
class HostReservationParserTest : public ::testing::Test { class HostReservationParserTest : public ::testing::Test {

View File

@@ -70,10 +70,6 @@ TEST_F(Lease4Test, constructor) {
// Get current time for the use in Lease. // Get current time for the use in Lease.
const time_t current_time = time(NULL); const time_t current_time = time(NULL);
// Other random constants.
const uint32_t SUBNET_ID = 42;
const uint32_t VALID_LIFETIME = 500;
// We want to check that various addresses work, so let's iterate over // We want to check that various addresses work, so let's iterate over
// these. // these.
const uint32_t ADDRESS[] = { const uint32_t ADDRESS[] = {
@@ -108,10 +104,6 @@ TEST_F(Lease4Test, copyConstructor) {
// Get current time for the use in Lease4. // Get current time for the use in Lease4.
const time_t current_time = time(NULL); const time_t current_time = time(NULL);
// Other random constants.
const uint32_t SUBNET_ID = 42;
const uint32_t VALID_LIFETIME = 500;
// Create the lease // Create the lease
Lease4 lease(0xffffffff, hwaddr_, clientid_, VALID_LIFETIME, 0, 0, current_time, Lease4 lease(0xffffffff, hwaddr_, clientid_, VALID_LIFETIME, 0, 0, current_time,
SUBNET_ID); SUBNET_ID);
@@ -149,10 +141,6 @@ TEST_F(Lease4Test, operatorAssign) {
// Get the current time for the use in Lease4. // Get the current time for the use in Lease4.
const time_t current_time = time(NULL); const time_t current_time = time(NULL);
// Other random constants.
const uint32_t SUBNET_ID = 42;
const uint32_t VALID_LIFETIME = 500;
// Create the lease // Create the lease
Lease4 lease(0xffffffff, hwaddr_, clientid_, VALID_LIFETIME, 0, 0, current_time, Lease4 lease(0xffffffff, hwaddr_, clientid_, VALID_LIFETIME, 0, 0, current_time,
SUBNET_ID); SUBNET_ID);
@@ -257,8 +245,6 @@ TEST_F(Lease4Test, operatorEquals) {
// Random values for the tests // Random values for the tests
const uint32_t ADDRESS = 0x01020304; const uint32_t ADDRESS = 0x01020304;
const time_t current_time = time(NULL); const time_t current_time = time(NULL);
const uint32_t SUBNET_ID = 42;
const uint32_t VALID_LIFETIME = 500;
// Check when the leases are equal. // Check when the leases are equal.
Lease4 lease1(ADDRESS, hwaddr_, clientid_, VALID_LIFETIME, current_time, 0, Lease4 lease1(ADDRESS, hwaddr_, clientid_, VALID_LIFETIME, current_time, 0,
@@ -504,7 +490,7 @@ TEST(Lease6Test, Lease6ConstructorDefault) {
// Other values // Other values
uint8_t llt[] = {0, 1, 2, 3, 4, 5, 6, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; uint8_t llt[] = {0, 1, 2, 3, 4, 5, 6, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
DuidPtr duid(new DUID(llt, sizeof(llt))); DuidPtr duid(new DUID(llt, sizeof(llt)));
uint32_t iaid = 7; // Just a number uint32_t iaid = IAID; // Just a number
SubnetID subnet_id = 8; // Just another number SubnetID subnet_id = 8; // Just another number
for (int i = 0; i < sizeof(ADDRESS) / sizeof(ADDRESS[0]); ++i) { for (int i = 0; i < sizeof(ADDRESS) / sizeof(ADDRESS[0]); ++i) {
@@ -551,7 +537,7 @@ TEST(Lease6Test, Lease6ConstructorWithFQDN) {
// Other values // Other values
uint8_t llt[] = {0, 1, 2, 3, 4, 5, 6, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; uint8_t llt[] = {0, 1, 2, 3, 4, 5, 6, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
DuidPtr duid(new DUID(llt, sizeof(llt))); DuidPtr duid(new DUID(llt, sizeof(llt)));
uint32_t iaid = 7; // Just a number uint32_t iaid = IAID; // Just a number
SubnetID subnet_id = 8; // Just another number SubnetID subnet_id = 8; // Just another number
for (int i = 0; i < sizeof(ADDRESS) / sizeof(ADDRESS[0]); ++i) { for (int i = 0; i < sizeof(ADDRESS) / sizeof(ADDRESS[0]); ++i) {
@@ -593,7 +579,7 @@ TEST(Lease6Test, operatorEquals) {
const IOAddress addr("2001:db8:1::456"); const IOAddress addr("2001:db8:1::456");
uint8_t duid_array[] = {0, 1, 2, 3, 4, 5, 6, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; uint8_t duid_array[] = {0, 1, 2, 3, 4, 5, 6, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
DuidPtr duid(new DUID(duid_array, sizeof(duid_array))); DuidPtr duid(new DUID(duid_array, sizeof(duid_array)));
uint32_t iaid = 7; // just a number uint32_t iaid = IAID; // just a number
SubnetID subnet_id = 8; // just another number SubnetID subnet_id = 8; // just another number
// Check for equality. // Check for equality.
@@ -723,7 +709,7 @@ TEST(Lease6Test, Lease6Expired) {
const IOAddress addr("2001:db8:1::456"); const IOAddress addr("2001:db8:1::456");
const uint8_t duid_array[] = {0, 1, 2, 3, 4, 5, 6, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; const uint8_t duid_array[] = {0, 1, 2, 3, 4, 5, 6, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
const DuidPtr duid(new DUID(duid_array, sizeof(duid_array))); const DuidPtr duid(new DUID(duid_array, sizeof(duid_array)));
const uint32_t iaid = 7; // Just a number const uint32_t iaid = IAID; // Just a number
const SubnetID subnet_id = 8; // Just another number const SubnetID subnet_id = 8; // Just another number
Lease6 lease(Lease::TYPE_NA, addr, duid, iaid, 100, 200, 50, 80, Lease6 lease(Lease::TYPE_NA, addr, duid, iaid, 100, 200, 50, 80,
subnet_id); subnet_id);