diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-01-08 21:51:18 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2018-01-08 21:51:18 +0100 |
commit | 77ad6aa02a73f0b5720b5c2c816cc697ba733aa0 (patch) | |
tree | 3d958c8a45840237e5a87abbee81a8aa13a58d6e /vespalib/src/tests/stllike/hash_test.cpp | |
parent | 2710414fabfa7f17d88a48fd01c775e1b2b2ddeb (diff) |
Add an explicitt test that begin() == end() on empty hashtables.
Diffstat (limited to 'vespalib/src/tests/stllike/hash_test.cpp')
-rw-r--r-- | vespalib/src/tests/stllike/hash_test.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vespalib/src/tests/stllike/hash_test.cpp b/vespalib/src/tests/stllike/hash_test.cpp index af889754530..94e214e9fb9 100644 --- a/vespalib/src/tests/stllike/hash_test.cpp +++ b/vespalib/src/tests/stllike/hash_test.cpp @@ -496,4 +496,11 @@ TEST("test hash table capacity and size") { EXPECT_EQUAL(2048u, many.capacity()); } +TEST("test that begin and end are identical with empty hashtables") { + hash_set<int> empty; + EXPECT_TRUE(empty.begin() == empty.end()); + hash_set<int> empty_but_reserved(10); + EXPECT_TRUE(empty_but_reserved.begin() == empty_but_reserved.end()); +} + TEST_MAIN() { TEST_RUN_ALL(); } |