Commit bb73dd2f authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[1967] DHCPv6 tests now use boost::scoped_ptr<>

parent edad8ee1
......@@ -25,6 +25,7 @@
#include <dhcp6/dhcp6_srv.h>
#include <util/buffer.h>
#include <util/range_utilities.h>
#include <boost/scoped_ptr.hpp>
using namespace std;
using namespace isc;
......@@ -85,9 +86,9 @@ TEST_F(Dhcpv6SrvTest, basic) {
TEST_F(Dhcpv6SrvTest, DUID) {
// tests that DUID is generated properly
Dhcpv6Srv* srv = NULL;
boost::scoped_ptr<Dhcpv6Srv> srv;
ASSERT_NO_THROW( {
srv = new Dhcpv6Srv(DHCP6_SERVER_PORT + 10000);
srv.reset(new Dhcpv6Srv(DHCP6_SERVER_PORT + 10000));
});
OptionPtr srvid = srv->getServerID();
......@@ -156,12 +157,11 @@ TEST_F(Dhcpv6SrvTest, DUID) {
ADD_FAILURE() << "Not supported duid type=" << duid_type << endl;
break;
}
delete srv; // destructor will close sockets, causing next test to succeed
}
TEST_F(Dhcpv6SrvTest, Solicit_basic) {
NakedDhcpv6Srv* srv = NULL;
ASSERT_NO_THROW( srv = new NakedDhcpv6Srv(); );
boost::scoped_ptr<NakedDhcpv6Srv> srv;
ASSERT_NO_THROW( srv.reset(new NakedDhcpv6Srv()) );
// a dummy content for client-id
OptionBuffer clntDuid(32);
......@@ -230,8 +230,6 @@ TEST_F(Dhcpv6SrvTest, Solicit_basic) {
EXPECT_TRUE(tmp->getData() == srv->getServerID()->getData());
// more checks to be implemented
delete srv;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment