Give up with --std=c++11
There are too many distros that use old versions of g++ that don't support it adequately.
This commit is contained in:
@@ -82,13 +82,14 @@ namespace {
|
||||
<< ", path [";
|
||||
|
||||
bool first = true;
|
||||
for (auto k : ni.path) {
|
||||
btree_detail::btree_path::const_iterator it;
|
||||
for (it = ni.path.begin(); it != ni.path.end(); ++it) {
|
||||
if (first)
|
||||
first = false;
|
||||
else
|
||||
out << ", ";
|
||||
|
||||
out << k;
|
||||
out << *it;
|
||||
}
|
||||
|
||||
out << "], b " << ni.b
|
||||
@@ -121,8 +122,9 @@ namespace {
|
||||
unsigned get_nr_nodes(Predicate const &pred) const {
|
||||
unsigned nr = 0;
|
||||
|
||||
for (auto n : nodes_)
|
||||
if (pred(n))
|
||||
node_array::const_iterator it;
|
||||
for (it = nodes_.begin(); it != nodes_.end(); ++it)
|
||||
if (pred(*it))
|
||||
nr++;
|
||||
|
||||
return nr;
|
||||
@@ -132,8 +134,9 @@ namespace {
|
||||
node_info get_node(unsigned target, Predicate const &pred) const {
|
||||
unsigned i = 0;
|
||||
|
||||
for (auto n : nodes_) {
|
||||
if (pred(n)) {
|
||||
node_array::const_iterator it;
|
||||
for (it = nodes_.begin(); it != nodes_.end(); ++it) {
|
||||
if (pred(*it)) {
|
||||
if (!target)
|
||||
break;
|
||||
else
|
||||
@@ -163,13 +166,14 @@ namespace {
|
||||
|
||||
node_array v;
|
||||
|
||||
for (auto n : nodes_) {
|
||||
node_array::const_iterator it;
|
||||
for (it = nodes_.begin(); it != nodes_.end(); ++it) {
|
||||
if (!target)
|
||||
break;
|
||||
|
||||
if (pred(n)) {
|
||||
if (pred(*it)) {
|
||||
if (target <= count)
|
||||
v.push_back(n);
|
||||
v.push_back(*it);
|
||||
|
||||
target--;
|
||||
}
|
||||
@@ -525,8 +529,9 @@ TEST_F(BTreeDamageVisitorTests, populated_tree_with_a_sequence_of_damaged_leaf_n
|
||||
unsigned const COUNT = 5;
|
||||
node_array nodes = layout_->get_random_nodes(COUNT, is_leaf);
|
||||
|
||||
for (auto n : nodes)
|
||||
trash_block(n.b);
|
||||
node_array::const_iterator it;
|
||||
for (it = nodes.begin(); it != nodes.end(); ++it)
|
||||
trash_block(it->b);
|
||||
|
||||
block_address begin = *nodes[0].keys.begin_;
|
||||
block_address end = *nodes[COUNT - 1].keys.end_;
|
||||
@@ -627,15 +632,17 @@ TEST_F(BTreeDamageVisitor2Tests, populated_tree_with_no_damage)
|
||||
run();
|
||||
}
|
||||
|
||||
namespace {
|
||||
bool leaf1(node_info const &n) {
|
||||
return (n.leaf && n.path.size() == 1 && n.path[0] == 1);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(BTreeDamageVisitor2Tests, damaged_leaf)
|
||||
{
|
||||
insert_values(10, 1000);
|
||||
tree_complete();
|
||||
|
||||
auto leaf1 = [] (node_info const &n) {
|
||||
return (n.leaf && n.path.size() == 1 && n.path[0] == 1);
|
||||
};
|
||||
|
||||
node_info n = layout_->random_node(leaf1);
|
||||
trash_block(n.b);
|
||||
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include "persistent-data/cache.h"
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
using namespace boost;
|
||||
using namespace base;
|
||||
using namespace std;
|
||||
@@ -53,7 +55,7 @@ namespace {
|
||||
|
||||
struct SharedThingTraits {
|
||||
typedef unsigned key_type;
|
||||
typedef std::shared_ptr<Thing> value_type;
|
||||
typedef boost::shared_ptr<Thing> value_type;
|
||||
|
||||
static key_type get_key(value_type const &p) {
|
||||
return p->key_;
|
||||
|
@@ -119,7 +119,7 @@ TEST(RegularSpanItTests, regular_span_iterator)
|
||||
|
||||
TEST_F(SpanItTests, sub_it_with_no_removed_blocks)
|
||||
{
|
||||
auto it = run();
|
||||
subtracting_span_iterator it = run();
|
||||
ASSERT_THAT(it.first(), Eq(maybe_span(span(23, 47))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(59, 103))));
|
||||
}
|
||||
@@ -128,7 +128,7 @@ TEST_F(SpanItTests, sub_it_with_removed_first_block)
|
||||
{
|
||||
forbidden.add(23);
|
||||
|
||||
auto it = run();
|
||||
subtracting_span_iterator it = run();
|
||||
ASSERT_THAT(it.first(), Eq(maybe_span(span(24, 47))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(59, 103))));
|
||||
}
|
||||
@@ -138,7 +138,7 @@ TEST_F(SpanItTests, sub_it_with_removed_run_overlapping_front_of_first_block)
|
||||
for (block_address i = 19; i < 26; i++)
|
||||
forbidden.add(i);
|
||||
|
||||
auto it = run();
|
||||
subtracting_span_iterator it = run();
|
||||
ASSERT_THAT(it.first(), Eq(maybe_span(span(26, 47))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(59, 103))));
|
||||
}
|
||||
@@ -147,7 +147,7 @@ TEST_F(SpanItTests, sub_it_with_removed_mid_block)
|
||||
{
|
||||
forbidden.add(40);
|
||||
|
||||
auto it = run();
|
||||
subtracting_span_iterator it = run();
|
||||
ASSERT_THAT(it.first(), Eq(maybe_span(span(23, 40))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(41, 47))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(59, 103))));
|
||||
@@ -158,7 +158,7 @@ TEST_F(SpanItTests, sub_it_with_removed_run_mid_block)
|
||||
for (block_address i = 26; i < 36; i++)
|
||||
forbidden.add(i);
|
||||
|
||||
auto it = run();
|
||||
subtracting_span_iterator it = run();
|
||||
ASSERT_THAT(it.first(), Eq(maybe_span(span(23, 26))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(36, 47))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(59, 103))));
|
||||
@@ -168,7 +168,7 @@ TEST_F(SpanItTests, sub_it_with_removed_end_block)
|
||||
{
|
||||
forbidden.add(46);
|
||||
|
||||
auto it = run();
|
||||
subtracting_span_iterator it = run();
|
||||
ASSERT_THAT(it.first(), Eq(maybe_span(span(23, 46))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(59, 103))));
|
||||
}
|
||||
@@ -178,7 +178,7 @@ TEST_F(SpanItTests, sub_it_with_removed_run_end_block)
|
||||
for (block_address i = 26; i < 50; i++)
|
||||
forbidden.add(i);
|
||||
|
||||
auto it = run();
|
||||
subtracting_span_iterator it = run();
|
||||
ASSERT_THAT(it.first(), Eq(maybe_span(span(23, 26))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(59, 103))));
|
||||
}
|
||||
@@ -188,7 +188,7 @@ TEST_F(SpanItTests, sub_it_with_removed_run_overlapping_2_blocks)
|
||||
for (block_address i = 26; i < 70; i++)
|
||||
forbidden.add(i);
|
||||
|
||||
auto it = run();
|
||||
subtracting_span_iterator it = run();
|
||||
ASSERT_THAT(it.first(), Eq(maybe_span(span(23, 26))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(70, 103))));
|
||||
}
|
||||
@@ -200,7 +200,7 @@ TEST_F(SpanItTests, sub_it_with_removed_intermediate_blocks)
|
||||
forbidden.add(57);
|
||||
forbidden.add(58);
|
||||
|
||||
auto it = run();
|
||||
subtracting_span_iterator it = run();
|
||||
ASSERT_THAT(it.first(), Eq(maybe_span(span(23, 47))));
|
||||
ASSERT_THAT(it.next(), Eq(maybe_span(span(59, 103))));
|
||||
}
|
||||
|
Reference in New Issue
Block a user