diff options
author | 2016-08-25 14:28:26 -0800 | |
---|---|---|
committer | 2016-08-25 20:16:17 -0700 | |
commit | db7bdab6e586e02051556d9f36a7887500378cf9 (patch) | |
tree | 0285545a72591d7462b68d70f02ecbae69bdb1c7 /tensorflow/core/util/presized_cuckoo_map_test.cc | |
parent | 4501365d9a5bee11bbdc66154acecaf6897db946 (diff) |
Implement fast ParseExample.
Change: 131338565
Diffstat (limited to 'tensorflow/core/util/presized_cuckoo_map_test.cc')
-rw-r--r-- | tensorflow/core/util/presized_cuckoo_map_test.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tensorflow/core/util/presized_cuckoo_map_test.cc b/tensorflow/core/util/presized_cuckoo_map_test.cc index 64ad315518..fe8e5dcfbd 100644 --- a/tensorflow/core/util/presized_cuckoo_map_test.cc +++ b/tensorflow/core/util/presized_cuckoo_map_test.cc @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ +#include "tensorflow/core/util/presized_cuckoo_map.h" #include "tensorflow/core/platform/env.h" #include "tensorflow/core/platform/fingerprint.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/platform/test_benchmark.h" -#include "tensorflow/core/util/presized_cuckoo_map.h" namespace tensorflow { namespace { @@ -64,6 +64,22 @@ TEST(PresizedCuckooMapTest, ZeroSizeMap) { } } +TEST(PresizedCuckooMapTest, RepeatedClear) { + PresizedCuckooMap<int> pscm(2); + int out; + for (int i = 0; i < 100; ++i) { + pscm.InsertUnique(0, 0); + pscm.InsertUnique(1, 1); + EXPECT_TRUE(pscm.Find(0, &out)); + EXPECT_EQ(0, out); + EXPECT_TRUE(pscm.Find(1, &out)); + EXPECT_EQ(1, out); + pscm.Clear(2); + EXPECT_FALSE(pscm.Find(0, &out)); + EXPECT_FALSE(pscm.Find(1, &out)); + } +} + void RunFill(int64 table_size) { PresizedCuckooMap<int> pscm(table_size); for (int64 i = 0; i < table_size; i++) { |