Browse Source

[4631b] Applied the not unique_ptr stuff

Francis Dupont 8 years ago
parent
commit
3b8787a7a8

+ 2 - 2
src/lib/dhcp/iface_mgr_linux.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -143,7 +143,7 @@ void Netlink::rtnl_open_socket() {
     local_.nl_family = AF_NETLINK;
     local_.nl_groups = 0;
 
-    if (bind(fd_, convertSockAddr(&local_), sizeof(local_)) < 0) {
+    if (::bind(fd_, convertSockAddr(&local_), sizeof(local_)) < 0) {
         isc_throw(Unexpected, "Failed to bind netlink socket.");
     }
 

+ 2 - 2
src/lib/dhcp/tests/duid_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -31,7 +31,7 @@ namespace {
 
 // This is a workaround for strange linking problems with gtest:
 // libdhcp___unittests-duid_unittest.o: In function `Compare<long unsigned int, long unsigned int>':
-// ~/gtest-1.6.0/include/gtest/gtest.h:1353: undefined reference to `isc::dhcp::ClientId::MAX_CLIENT_ID_LE'N
+// ~/gtest-1.6.0/include/gtest/gtest.h:1353: undefined reference to `isc::dhcp::ClientId::MAX_CLIENT_ID_LEN'
 // collect2: ld returned 1 exit status
 
 const size_t MAX_DUID_LEN = DUID::MAX_DUID_LEN;

+ 6 - 5
src/lib/util/tests/memory_segment_local_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -9,6 +9,7 @@
 #include <util/memory_segment_local.h>
 #include <exceptions/exceptions.h>
 #include <gtest/gtest.h>
+#include <boost/scoped_ptr.hpp>
 #include <memory>
 #include <limits.h>
 
@@ -18,7 +19,7 @@ using namespace isc::util;
 namespace {
 
 TEST(MemorySegmentLocal, TestLocal) {
-    auto_ptr<MemorySegment> segment(new MemorySegmentLocal());
+    boost::scoped_ptr<MemorySegment> segment(new MemorySegmentLocal());
 
     // By default, nothing is allocated.
     EXPECT_TRUE(segment->allMemoryDeallocated());
@@ -50,7 +51,7 @@ TEST(MemorySegmentLocal, TestLocal) {
 
 /// @todo: disabled, see ticket #3510
 TEST(MemorySegmentLocal, DISABLED_TestTooMuchMemory) {
-    auto_ptr<MemorySegment> segment(new MemorySegmentLocal());
+    boost::scoped_ptr<MemorySegment> segment(new MemorySegmentLocal());
 
     // Although it should be perfectly fine to use the ULONG_MAX
     // instead of LONG_MAX as the size_t value should be unsigned,
@@ -61,7 +62,7 @@ TEST(MemorySegmentLocal, DISABLED_TestTooMuchMemory) {
 }
 
 TEST(MemorySegmentLocal, TestBadDeallocate) {
-    auto_ptr<MemorySegment> segment(new MemorySegmentLocal());
+    boost::scoped_ptr<MemorySegment> segment(new MemorySegmentLocal());
 
     // By default, nothing is allocated.
     EXPECT_TRUE(segment->allMemoryDeallocated());
@@ -94,7 +95,7 @@ TEST(MemorySegmentLocal, TestBadDeallocate) {
 }
 
 TEST(MemorySegmentLocal, TestNullDeallocate) {
-    auto_ptr<MemorySegment> segment(new MemorySegmentLocal());
+    boost::scoped_ptr<MemorySegment> segment(new MemorySegmentLocal());
 
     // By default, nothing is allocated.
     EXPECT_TRUE(segment->allMemoryDeallocated());