Browse Source

[2414] Changes after review

Stephen Morris 12 years ago
parent
commit
f9e9ca6798
2 changed files with 13 additions and 4 deletions
  1. 5 1
      src/bin/dhcp6/dhcp6_srv.h
  2. 8 3
      src/bin/dhcp6/tests/dhcp6_srv_unittest.cc

+ 5 - 1
src/bin/dhcp6/dhcp6_srv.h

@@ -32,12 +32,16 @@ namespace isc {
 namespace dhcp {
 /// @brief DHCPv6 server service.
 ///
-/// This singleton class represents DHCPv6 server. It contains all
+/// This class represents DHCPv6 server. It contains all
 /// top-level methods and routines necessary for server operation.
 /// In particular, it instantiates IfaceMgr, loads or generates DUID
 /// that is going to be used as server-identifier, receives incoming
 /// packets, processes them, manages leases assignment and generates
 /// appropriate responses.
+///
+/// @note Only one instance of this class is instantated as it encompasses
+///       the whole operation of the server.  Nothing, however, enforces the
+///       singleton status of the object.
 class Dhcpv6Srv : public boost::noncopyable {
 
 public:

+ 8 - 3
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc

@@ -139,9 +139,14 @@ public:
     }
 
     // Check that generated IAADDR option contains expected address.
-    void checkIAAddr(boost::shared_ptr<Option6IAAddr> addr, const IOAddress& expected_addr,
+    void checkIAAddr(const boost::shared_ptr<Option6IAAddr>& addr,
+                     const IOAddress& expected_addr,
                      uint32_t expected_preferred, uint32_t expected_valid) {
-        // Check that the assigned address is indeed from the configured pool
+
+        // Check that the assigned address is indeed from the configured pool.
+        // Note that when comparing addresses, we compare the textual
+        // representation. IOAddress does not support being streamed to
+        // an ostream, which means it can't be used in EXPECT_EQ.
         EXPECT_TRUE(subnet_->inPool(addr->getAddress()));
         EXPECT_EQ(expected_addr.toText(), addr->getAddress().toText());
         EXPECT_EQ(addr->getPreferred(), subnet_->getPreferred());
@@ -326,7 +331,7 @@ TEST_F(Dhcpv6SrvTest, advertiseOptions) {
 
     ASSERT_EQ(0, rcode_);
 
-     Pkt6Ptr sol = Pkt6Ptr(new Pkt6(DHCPV6_SOLICIT, 1234));
+    Pkt6Ptr sol = Pkt6Ptr(new Pkt6(DHCPV6_SOLICIT, 1234));
     sol->setRemoteAddr(IOAddress("fe80::abcd"));
     sol->addOption(generateIA(234, 1500, 3000));
     OptionPtr clientid = generateClientId();