diff options
author | Marcin Siodelski <marcin@isc.org> | 2012-06-11 13:30:36 +0200 |
---|---|---|
committer | Marcin Siodelski <marcin@isc.org> | 2012-06-11 13:30:36 +0200 |
commit | 0235da81624be30ea2aeadaf1c93fde1ba1bd057 (patch) | |
tree | 9ffcf91b2f28e41f8e68ab0de368998c7f2e95e8 /src/lib/dhcp/tests/pkt4_unittest.cc | |
parent | [1955] Added setData() unit test for dhcp::Option. (diff) | |
download | kea-0235da81624be30ea2aeadaf1c93fde1ba1bd057.tar.xz kea-0235da81624be30ea2aeadaf1c93fde1ba1bd057.zip |
[1955] Corrections to timestamp unit tests in dhcp::PktN.
Diffstat (limited to 'src/lib/dhcp/tests/pkt4_unittest.cc')
-rw-r--r-- | src/lib/dhcp/tests/pkt4_unittest.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/dhcp/tests/pkt4_unittest.cc b/src/lib/dhcp/tests/pkt4_unittest.cc index 1ac8477337..e443b65815 100644 --- a/src/lib/dhcp/tests/pkt4_unittest.cc +++ b/src/lib/dhcp/tests/pkt4_unittest.cc @@ -599,7 +599,10 @@ TEST(Pkt4Test, metaFields) { } TEST(Pkt4Test, Timestamp) { - Pkt4* pkt = new Pkt4(DHCPOFFER, 1234); + scoped_ptr<Pkt4> pkt(new Pkt4(DHCPOFFER, 1234)); + + // Just after construction timestamp is invalid + ASSERT_TRUE(pkt->getTimestamp().is_not_a_date_time()); // Update packet time. pkt->updateTimestamp(); @@ -619,8 +622,6 @@ TEST(Pkt4Test, Timestamp) { // Duration should be positive or zero. EXPECT_TRUE(ts_period.length().total_microseconds() >= 0); - - delete pkt; } |