forked from OSchip/llvm-project
[libcxx] [test] D26624: Fix bucket_count() assumptions.
With a max_load_factor of 1.0, the only guarantee is that bucket_count() >= size(). (Note: setting max_load_factor without rehashing isn't supposed to affect this, because setting max_load_factor is currently specified to be constant time.) llvm-svn: 286982
This commit is contained in:
parent
895c6aa6fd
commit
49188b1d3c
|
@ -77,7 +77,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -132,7 +132,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
@ -176,7 +176,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -193,7 +193,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
@ -257,7 +257,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -312,7 +312,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
@ -356,7 +356,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -373,7 +373,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
@ -437,7 +437,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -492,7 +492,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
@ -536,7 +536,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -553,7 +553,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
|
|
@ -77,7 +77,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -132,7 +132,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
@ -176,7 +176,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -193,7 +193,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
@ -257,7 +257,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -312,7 +312,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
@ -356,7 +356,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -373,7 +373,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
@ -437,7 +437,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -492,7 +492,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
@ -536,7 +536,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.at(10) == "ten");
|
||||
assert(c1.at(20) == "twenty");
|
||||
|
@ -553,7 +553,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.at(1) == "one");
|
||||
assert(c2.at(2) == "two");
|
||||
|
|
|
@ -79,7 +79,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -134,7 +134,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
@ -180,7 +180,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -197,7 +197,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
@ -264,7 +264,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -319,7 +319,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
@ -365,7 +365,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -382,7 +382,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
@ -449,7 +449,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -504,7 +504,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
@ -550,7 +550,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -567,7 +567,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
|
|
@ -78,7 +78,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -133,7 +133,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
@ -179,7 +179,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -196,7 +196,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
@ -263,7 +263,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -318,7 +318,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
@ -364,7 +364,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -381,7 +381,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
@ -448,7 +448,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -503,7 +503,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
@ -549,7 +549,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(c1.find(10)->second == "ten");
|
||||
assert(c1.find(20)->second == "twenty");
|
||||
|
@ -566,7 +566,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.find(1)->second == "one");
|
||||
assert(next(c2.find(1))->second == "four");
|
||||
|
|
|
@ -77,7 +77,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -132,7 +132,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
@ -176,7 +176,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -193,7 +193,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
@ -258,7 +258,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -313,7 +313,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
@ -357,7 +357,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -374,7 +374,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
@ -439,7 +439,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -494,7 +494,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
@ -538,7 +538,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -555,7 +555,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
|
|
@ -77,7 +77,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -132,7 +132,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
@ -176,7 +176,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -193,7 +193,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
@ -258,7 +258,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -313,7 +313,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
@ -357,7 +357,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -374,7 +374,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
@ -439,7 +439,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -494,7 +494,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
@ -538,7 +538,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -555,7 +555,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 7);
|
||||
assert(c2.bucket_count() >= 6);
|
||||
assert(c2.size() == 6);
|
||||
assert(c2.count(1) == 2);
|
||||
assert(c2.count(2) == 2);
|
||||
|
|
|
@ -77,7 +77,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -132,7 +132,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
@ -176,7 +176,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -193,7 +193,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
@ -258,7 +258,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -313,7 +313,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
@ -357,7 +357,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -374,7 +374,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
@ -439,7 +439,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -494,7 +494,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
@ -538,7 +538,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
c1.swap(c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -555,7 +555,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
|
|
@ -77,7 +77,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -132,7 +132,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
@ -176,7 +176,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -193,7 +193,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
@ -258,7 +258,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -313,7 +313,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
@ -357,7 +357,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -374,7 +374,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
@ -439,7 +439,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -494,7 +494,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
@ -538,7 +538,7 @@ int main()
|
|||
c2.max_load_factor(2);
|
||||
swap(c1, c2);
|
||||
|
||||
assert(c1.bucket_count() >= 11);
|
||||
assert(c1.bucket_count() >= 8);
|
||||
assert(c1.size() == 8);
|
||||
assert(*c1.find(10) == 10);
|
||||
assert(*c1.find(20) == 20);
|
||||
|
@ -555,7 +555,7 @@ int main()
|
|||
assert(std::distance(c1.cbegin(), c1.cend()) == c1.size());
|
||||
assert(c1.max_load_factor() == 2);
|
||||
|
||||
assert(c2.bucket_count() >= 5);
|
||||
assert(c2.bucket_count() >= 4);
|
||||
assert(c2.size() == 4);
|
||||
assert(c2.count(1) == 1);
|
||||
assert(c2.count(2) == 1);
|
||||
|
|
Loading…
Reference in New Issue