BIND 10 #1186: libdhcp implementation - DHCPv6 part

BIND 10 Development do-not-reply at isc.org
Thu Oct 13 14:34:46 UTC 2011


#1186: libdhcp implementation - DHCPv6 part
-------------------------------------+-------------------------------------
                   Reporter:  tomek  |                 Owner:  stephen
                       Type:         |                Status:  reviewing
  enhancement                        |             Milestone:  Sprint-
                   Priority:  major  |  DHCP-20111026
                  Component:  dhcp   |            Resolution:
                   Keywords:         |             Sensitive:  0
            Defect Severity:  N/A    |           Sub-Project:  DHCP
Feature Depending on Ticket:  878    |  Estimated Difficulty:  0
        Add Hours to Ticket:  0      |           Total Hours:  0
                  Internal?:  0      |
-------------------------------------+-------------------------------------

Comment (by stephen):

 Replying to [comment:11 tomek]:
 >> '''src/lib/dhcp/tests/option6_addrlst_unittest.cc'''
 >> All tests. Is there a need to declare opt1/2/3 as a pointer to
 Option6AddrLst and delete them afterwards? As they are being initialized
 at creation, why not declare them as objects of type Option6AddrLst? It
 eliminates the need to delete them at the end of the test method.
 (Alternatively, encapsulate them in a std::auto_ptr to ensure that they
 are deleted even if the method returns prematurely.)
 > In tests, I prefer to simplest approach possible. There is nothing that
 could go wrong with new and delete (except running out of memory, but that
 would indicate severe memory leak in code).
 Not sure I follow the logic here.  I would have thought that declaring
 them as a local variable (as opposed to a pointer) would be easier.
 However, your reply later on in the comment about using new/delete to test
 the full lifecycle makes sense.  I would suggest that we add
 EXPECT_NO_THROW round the construction/deletion to be complete.

 BTW, we still have declarations of the form:
 {{{
 Option6AddrLst * opt
 }}}
 The space before the "*" should be removed.

-- 
Ticket URL: <http://bind10.isc.org/ticket/1186#comment:17>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list