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 CLIENTID0[] = { 1, 2, 3, 4 };
-const uint8_t CLIENTID1[] = { 0xa, 0xb, 0xc, 0xd };
+const uint8_t CLIENTID[] = { 1, 2, 3, 4 };
/// @brief Test fixture class for @c CSVLeaseFile4 validation.
class CSVLeaseFile4Test : public ::testing::Test {
// Create second lease, with non-NULL client id.
lease.reset(new Lease4(IOAddress("192.0.3.10"),
hwaddr1_,
- CLIENTID0, sizeof(CLIENTID0),
+ CLIENTID, sizeof(CLIENTID),
100, 60, 90, 0, 7));
{
SCOPED_TRACE("Second write");
// Get current time for the use in Lease.
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
// these.
const uint32_t ADDRESS[] = {
// Get current time for the use in Lease4.
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
Lease4 lease(0xffffffff, hwaddr_, clientid_, VALID_LIFETIME, 0, 0, current_time,
SUBNET_ID);
// Get the current time for the use in Lease4.
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
Lease4 lease(0xffffffff, hwaddr_, clientid_, VALID_LIFETIME, 0, 0, current_time,
SUBNET_ID);
// Random values for the tests
const uint32_t ADDRESS = 0x01020304;
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.
Lease4 lease1(ADDRESS, hwaddr_, clientid_, VALID_LIFETIME, current_time, 0,
// Other values
uint8_t llt[] = {0, 1, 2, 3, 4, 5, 6, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
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
for (int i = 0; i < sizeof(ADDRESS) / sizeof(ADDRESS[0]); ++i) {
// Other values
uint8_t llt[] = {0, 1, 2, 3, 4, 5, 6, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
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
for (int i = 0; i < sizeof(ADDRESS) / sizeof(ADDRESS[0]); ++i) {
const IOAddress addr("2001:db8:1::456");
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)));
- uint32_t iaid = 7; // just a number
+ uint32_t iaid = IAID; // just a number
SubnetID subnet_id = 8; // just another number
// Check for equality.
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 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
Lease6 lease(Lease::TYPE_NA, addr, duid, iaid, 100, 200, 50, 80,
subnet_id);