Commit e348313f authored by Francis Dupont's avatar Francis Dupont
Browse files

[master] Merged trac4631b (C++11 2nd phase)

parents 9be11b73 3b8787a7
// 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 // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -143,7 +143,7 @@ void Netlink::rtnl_open_socket() { ...@@ -143,7 +143,7 @@ void Netlink::rtnl_open_socket() {
local_.nl_family = AF_NETLINK; local_.nl_family = AF_NETLINK;
local_.nl_groups = 0; 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."); isc_throw(Unexpected, "Failed to bind netlink socket.");
} }
......
// 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 // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -31,7 +31,7 @@ namespace { ...@@ -31,7 +31,7 @@ namespace {
// This is a workaround for strange linking problems with gtest: // This is a workaround for strange linking problems with gtest:
// libdhcp___unittests-duid_unittest.o: In function `Compare<long unsigned int, long unsigned int>': // 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 // collect2: ld returned 1 exit status
const size_t MAX_DUID_LEN = DUID::MAX_DUID_LEN; const size_t MAX_DUID_LEN = DUID::MAX_DUID_LEN;
......
// 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 // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <util/memory_segment_local.h> #include <util/memory_segment_local.h>
#include <exceptions/exceptions.h> #include <exceptions/exceptions.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <boost/scoped_ptr.hpp>
#include <memory> #include <memory>
#include <limits.h> #include <limits.h>
...@@ -18,7 +19,7 @@ using namespace isc::util; ...@@ -18,7 +19,7 @@ using namespace isc::util;
namespace { namespace {
TEST(MemorySegmentLocal, TestLocal) { TEST(MemorySegmentLocal, TestLocal) {
auto_ptr<MemorySegment> segment(new MemorySegmentLocal()); boost::scoped_ptr<MemorySegment> segment(new MemorySegmentLocal());
// By default, nothing is allocated. // By default, nothing is allocated.
EXPECT_TRUE(segment->allMemoryDeallocated()); EXPECT_TRUE(segment->allMemoryDeallocated());
...@@ -50,7 +51,7 @@ TEST(MemorySegmentLocal, TestLocal) { ...@@ -50,7 +51,7 @@ TEST(MemorySegmentLocal, TestLocal) {
/// @todo: disabled, see ticket #3510 /// @todo: disabled, see ticket #3510
TEST(MemorySegmentLocal, DISABLED_TestTooMuchMemory) { 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 // Although it should be perfectly fine to use the ULONG_MAX
// instead of LONG_MAX as the size_t value should be unsigned, // instead of LONG_MAX as the size_t value should be unsigned,
...@@ -61,7 +62,7 @@ TEST(MemorySegmentLocal, DISABLED_TestTooMuchMemory) { ...@@ -61,7 +62,7 @@ TEST(MemorySegmentLocal, DISABLED_TestTooMuchMemory) {
} }
TEST(MemorySegmentLocal, TestBadDeallocate) { TEST(MemorySegmentLocal, TestBadDeallocate) {
auto_ptr<MemorySegment> segment(new MemorySegmentLocal()); boost::scoped_ptr<MemorySegment> segment(new MemorySegmentLocal());
// By default, nothing is allocated. // By default, nothing is allocated.
EXPECT_TRUE(segment->allMemoryDeallocated()); EXPECT_TRUE(segment->allMemoryDeallocated());
...@@ -94,7 +95,7 @@ TEST(MemorySegmentLocal, TestBadDeallocate) { ...@@ -94,7 +95,7 @@ TEST(MemorySegmentLocal, TestBadDeallocate) {
} }
TEST(MemorySegmentLocal, TestNullDeallocate) { TEST(MemorySegmentLocal, TestNullDeallocate) {
auto_ptr<MemorySegment> segment(new MemorySegmentLocal()); boost::scoped_ptr<MemorySegment> segment(new MemorySegmentLocal());
// By default, nothing is allocated. // By default, nothing is allocated.
EXPECT_TRUE(segment->allMemoryDeallocated()); EXPECT_TRUE(segment->allMemoryDeallocated());
......
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