aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util/presized_cuckoo_map_test.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2016-08-19 10:44:37 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-08-19 11:48:07 -0700
commit0b9f0f53ddbf693bb30afb211a6d514a1fce1c22 (patch)
treefcc68dbf0d05ba6e093b58274645aaaa9d9b7c39 /tensorflow/core/util/presized_cuckoo_map_test.cc
parent859e47fd8ebcdd7fb1411fd0090d0e95a801e7cb (diff)
Implement fast ParseExample.
Change: 130775324
Diffstat (limited to 'tensorflow/core/util/presized_cuckoo_map_test.cc')
-rw-r--r--tensorflow/core/util/presized_cuckoo_map_test.cc18
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++) {