From 0d13bbe2721883907f2e0c6d53d25bef7786800b Mon Sep 17 00:00:00 2001 From: fyrz Date: Wed, 4 Mar 2015 22:43:39 +0100 Subject: [PATCH] RocksJava] Fix ColumnFamily tests Summary: Cleaned up some tests regarding disposal order and tests which were failing when C++ assertions were enabled. Test Plan: - Enable C++ Assertions (remove e.g. -DNDebug in rocksdbjava target) - make rocksdbjava jtest Reviewers: adamretter, ankgup87, yhchiang Subscribers: dhruba Differential Revision: https://reviews.facebook.net/D34569 --- .../src/main/java/org/rocksdb/benchmark/DbBenchmark.java | 2 ++ java/src/test/java/org/rocksdb/ColumnFamilyTest.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/java/benchmark/src/main/java/org/rocksdb/benchmark/DbBenchmark.java b/java/benchmark/src/main/java/org/rocksdb/benchmark/DbBenchmark.java index 64fc5f0a7..4a8887377 100644 --- a/java/benchmark/src/main/java/org/rocksdb/benchmark/DbBenchmark.java +++ b/java/benchmark/src/main/java/org/rocksdb/benchmark/DbBenchmark.java @@ -418,9 +418,11 @@ public class DbBenchmark { stats_.found_++; stats_.finishedSingleOp(iter.key().length + iter.value().length); if (isFinished()) { + iter.dispose(); return; } } + iter.dispose(); } } diff --git a/java/src/test/java/org/rocksdb/ColumnFamilyTest.java b/java/src/test/java/org/rocksdb/ColumnFamilyTest.java index d6169fd4c..decdbbcb2 100644 --- a/java/src/test/java/org/rocksdb/ColumnFamilyTest.java +++ b/java/src/test/java/org/rocksdb/ColumnFamilyTest.java @@ -723,7 +723,7 @@ public class ColumnFamilyTest { try { options = new Options().setCreateIfMissing(true); db = RocksDB.open(options, dbFolder.getRoot().getAbsolutePath()); - final String simplifiedChinese = "简体字"; + final String simplifiedChinese = "\u7b80\u4f53\u5b57"; columnFamilyHandle = db.createColumnFamily( new ColumnFamilyDescriptor(simplifiedChinese.getBytes()));