Updated Interprocess and Intrusive:

-> Added linear slist to intrusive
-> Updated all allocators to version 2 allocators in Interprocess
-> Optimized rbtree_best_fit size overhead to 1 std:size_t.

[SVN r42878]
This commit is contained in:
Ion Gaztañaga committed 2008-01-20 11:54:47 +00:00
1 parent 816685673e
commit 9f88d4a617
15 files changed
+888 -278

No files matched your search

+42 -25
View File
@@ -63,14 +63,6 @@ void test_list<ValueTraits>::test_all(std::vector<typename ValueTraits::value_ty
test_swap(values);
test_clone(values);
test_container_from_end(values);
/*
const char *list_name = typeid(list_type).name();
std::cout << list_name << std::endl << strlen(list_name) << std::endl;
const char *value_t = typeid(typename list_type::value_traits).name();
std::cout << value_t << std::endl << strlen(value_t) << std::endl;
const char *list_it_name = typeid(typename list_type::iterator).name();
std::cout << list_it_name << std::endl << strlen(list_it_name ) << std::endl;
*/
}
//test: push_front, pop_front, push_back, pop_back, front, back, size, empty:
@@ -194,26 +186,29 @@ void test_list<ValueTraits>
const int num_values = (int)values.size();
std::vector<int> expected_values(num_values);
//Shift forward all possible positions 3 times
for(int i = 0; i < num_values*3; ++i){
testlist.assign(values.begin(), values.end());
testlist.shift_forward(i);
for(int j = 0; j < num_values; ++j){
expected_values[(j + num_values - i%num_values) % num_values] = (j + 1);
for(int s = 1; s <= num_values; ++s){
expected_values.resize(s);
//Shift forward all possible positions 3 times
for(int i = 0; i < s*3; ++i){
testlist.insert(testlist.begin(), &values[0], &values[0] + s);
testlist.shift_forward(i);
for(int j = 0; j < s; ++j){
expected_values[(j + s - i%s) % s] = (j + 1);
}
TEST_INTRUSIVE_SEQUENCE_EXPECTED(expected_values, testlist.begin());
testlist.clear();
}
TEST_INTRUSIVE_SEQUENCE_EXPECTED(expected_values, testlist.begin());
testlist.clear();
}
//Shift backwards all possible positions
for(int i = 0; i < num_values*3; ++i){
testlist.assign(values.begin(), values.end());
testlist.shift_backwards(i);
for(int j = 0; j < num_values; ++j){
expected_values[(j + i) % num_values] = (j + 1);
//Shift backwards all possible positions
for(int i = 0; i < s*3; ++i){
testlist.insert(testlist.begin(), &values[0], &values[0] + s);
testlist.shift_backwards(i);
for(int j = 0; j < s; ++j){
expected_values[(j + i) % s] = (j + 1);
}
TEST_INTRUSIVE_SEQUENCE_EXPECTED(expected_values, testlist.begin());
testlist.clear();
}
TEST_INTRUSIVE_SEQUENCE_EXPECTED(expected_values, testlist.begin());
testlist.clear();
}
}
@@ -278,6 +273,28 @@ void test_list<ValueTraits>
{ int init_values [] = { 4, 3 };
TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
}
{
list_type testlist1 (&values[0], &values[1]);
{ int init_values [] = { 1 };
TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
values[1].swap_nodes(values[2]);
{ int init_values [] = { 1 };
TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
values[0].swap_nodes(values[2]);
{ int init_values [] = { 3 };
TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
values[0].swap_nodes(values[2]);
{ int init_values [] = { 1 };
TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
}
}
template<class ValueTraits>