BIND 10 #1967: dhcp6 Solicit_basic test fails
BIND 10 Development
do-not-reply at isc.org
Mon May 14 17:56:57 UTC 2012
#1967: dhcp6 Solicit_basic test fails
-------------------------------------+-------------------------------------
Reporter: | Owner: tomek
jinmei | Status: reviewing
Type: | Milestone: Sprint-
defect | DHCP-20120514
Priority: very | Resolution:
high | Sensitive: 0
Component: dhcp6 | Sub-Project: DHCP
Keywords: | Estimated Difficulty: 0
Defect Severity: N/A | Total Hours: 0
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by stephen):
* owner: stephen => tomek
Comment:
Looks OK, but your point:
> default case does not call FAIL() (fail + assert), but rather
ADD_FAILURE() (fail + test continues), because we want to delete srv
object, even if test fails.
caused me to check the test in detail. The DUID test function contains an
ASSERT_TRUE() call after "srv" has been allocated: if that fails, the test
will exit immediately and not clean up "srv". For that reason, it might
be better to allocate the Dhcp6Srv object with:
{{{
boost::scoped_ptr<Dhcp6Srv> srv;
ASSERT_NO_THROW({
srv.reset(new Dhcp6Srv(DHCP6_SERVER_PORT + 10000);
});
}}}
That way, if any test does cause the function to exit, the Dhcp6Srv object
will be deleted.
I also note that the Solicit_basic test includes some ASSERT_XXX() tests;
again, if these fail, the "srv" object will not be deleted. The use of
scoped_ptr may be appropriate here as well.
--
Ticket URL: <http://bind10.isc.org/ticket/1967#comment:6>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list