diff options
Diffstat (limited to 'vespalib/src/tests/stllike')
-rw-r--r-- | vespalib/src/tests/stllike/hash_test.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vespalib/src/tests/stllike/hash_test.cpp b/vespalib/src/tests/stllike/hash_test.cpp index d23c2c6b68c..e86a9ad020a 100644 --- a/vespalib/src/tests/stllike/hash_test.cpp +++ b/vespalib/src/tests/stllike/hash_test.cpp @@ -4,6 +4,7 @@ #include <vespa/vespalib/stllike/hash_set.hpp> #include <vespa/vespalib/stllike/hash_map.hpp> #include <vespa/vespalib/stllike/hash_map_equal.hpp> +#include <vespa/vespalib/stllike/allocator.h> #include <cstddef> #include <algorithm> @@ -553,4 +554,17 @@ TEST("test that begin and end are identical with empty hashtables") { EXPECT_TRUE(empty_but_reserved.begin() == empty_but_reserved.end()); } +TEST ("test that large_allocator works fine with std::vector") { + using V = std::vector<uint64_t, allocator_large<uint64_t>>; + V a; + a.push_back(1); + a.reserve(14); + for (size_t i(0); i < 400000; i++) { + a.push_back(i); + } + V b = std::move(a); + V c = b; + ASSERT_EQUAL(b.size(), c.size()); +} + TEST_MAIN() { TEST_RUN_ALL(); } |