switch to -std=c++11
This commit is contained in:
parent
730a82f974
commit
224ef1f429
@ -74,7 +74,7 @@ CXX:=@CXX@
|
|||||||
OBJECTS:=$(subst .cc,.o,$(SOURCE))
|
OBJECTS:=$(subst .cc,.o,$(SOURCE))
|
||||||
TOP_DIR:=@top_srcdir@
|
TOP_DIR:=@top_srcdir@
|
||||||
TOP_BUILDDIR:=@top_builddir@
|
TOP_BUILDDIR:=@top_builddir@
|
||||||
CXXFLAGS+=-g -Wall -fno-strict-aliasing
|
CXXFLAGS+=-std=c++11 -g -Wall -fno-strict-aliasing
|
||||||
CXXFLAGS+=@CXXOPTIMISE_FLAG@
|
CXXFLAGS+=@CXXOPTIMISE_FLAG@
|
||||||
CXXFLAGS+=@CXXDEBUG_FLAG@
|
CXXFLAGS+=@CXXDEBUG_FLAG@
|
||||||
INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning
|
INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
namespace {
|
namespace {
|
||||||
class sm_careful_alloc : public checked_space_map {
|
class sm_careful_alloc : public checked_space_map {
|
||||||
public:
|
public:
|
||||||
typedef shared_ptr<sm_careful_alloc> ptr;
|
typedef std::shared_ptr<sm_careful_alloc> ptr;
|
||||||
|
|
||||||
sm_careful_alloc(checked_space_map::ptr sm)
|
sm_careful_alloc(checked_space_map::ptr sm)
|
||||||
: sm_(sm) {
|
: sm_(sm) {
|
||||||
|
@ -32,7 +32,7 @@ using namespace testing;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
block_address const NR_BLOCKS = 102400;
|
block_address const NR_BLOCKS = 102400;
|
||||||
typedef array<uint64_traits> array64;
|
typedef persistent_data::array<uint64_traits> array64;
|
||||||
|
|
||||||
transaction_manager::ptr
|
transaction_manager::ptr
|
||||||
create_tm() {
|
create_tm() {
|
||||||
@ -67,14 +67,14 @@ namespace {
|
|||||||
|
|
||||||
TEST(ArrayTests, can_create_an_empty_array)
|
TEST(ArrayTests, can_create_an_empty_array)
|
||||||
{
|
{
|
||||||
array<uint64_traits>::ptr tree = create_array(0, 0);
|
persistent_data::array<uint64_traits>::ptr tree = create_array(0, 0);
|
||||||
ASSERT_THROW(tree->get(0), runtime_error);
|
ASSERT_THROW(tree->get(0), runtime_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(ArrayTests, get_elements)
|
TEST(ArrayTests, get_elements)
|
||||||
{
|
{
|
||||||
unsigned const COUNT = 10000;
|
unsigned const COUNT = 10000;
|
||||||
array<uint64_traits>::ptr tree = create_array(COUNT, 123);
|
persistent_data::array<uint64_traits>::ptr tree = create_array(COUNT, 123);
|
||||||
|
|
||||||
for (unsigned i = 0; i < COUNT; i++)
|
for (unsigned i = 0; i < COUNT; i++)
|
||||||
ASSERT_THAT(tree->get(i), Eq(123u));
|
ASSERT_THAT(tree->get(i), Eq(123u));
|
||||||
@ -85,7 +85,7 @@ TEST(ArrayTests, get_elements)
|
|||||||
TEST(ArrayTests, set_elements)
|
TEST(ArrayTests, set_elements)
|
||||||
{
|
{
|
||||||
unsigned const COUNT = 10000;
|
unsigned const COUNT = 10000;
|
||||||
array<uint64_traits>::ptr tree = create_array(COUNT, 123);
|
persistent_data::array<uint64_traits>::ptr tree = create_array(COUNT, 123);
|
||||||
|
|
||||||
for (unsigned i = 0; i < COUNT; i++)
|
for (unsigned i = 0; i < COUNT; i++)
|
||||||
tree->set(i, 124);
|
tree->set(i, 124);
|
||||||
@ -117,7 +117,7 @@ TEST(ArrayTests, grow)
|
|||||||
chunks.push_back(c);
|
chunks.push_back(c);
|
||||||
chunks.push_back(COUNT);
|
chunks.push_back(COUNT);
|
||||||
|
|
||||||
array<uint64_traits>::ptr a = create_array(0, 123);
|
persistent_data::array<uint64_traits>::ptr a = create_array(0, 123);
|
||||||
|
|
||||||
for (unsigned i = 1; i < chunks.size(); i++) {
|
for (unsigned i = 1; i < chunks.size(); i++) {
|
||||||
if (i > 1)
|
if (i > 1)
|
||||||
|
@ -19,8 +19,6 @@
|
|||||||
#include "gmock/gmock.h"
|
#include "gmock/gmock.h"
|
||||||
#include "persistent-data/cache.h"
|
#include "persistent-data/cache.h"
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
|
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
using namespace base;
|
using namespace base;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -55,7 +53,7 @@ namespace {
|
|||||||
|
|
||||||
struct SharedThingTraits {
|
struct SharedThingTraits {
|
||||||
typedef unsigned key_type;
|
typedef unsigned key_type;
|
||||||
typedef shared_ptr<Thing> value_type;
|
typedef std::shared_ptr<Thing> value_type;
|
||||||
|
|
||||||
static key_type get_key(value_type const &p) {
|
static key_type get_key(value_type const &p) {
|
||||||
return p->key_;
|
return p->key_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user