summaryrefslogtreecommitdiff
path: root/issues/issue200_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'issues/issue200_test.cc')
-rw-r--r--issues/issue200_test.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/issues/issue200_test.cc b/issues/issue200_test.cc
index 877b2af..959b371 100644
--- a/issues/issue200_test.cc
+++ b/issues/issue200_test.cc
@@ -6,35 +6,34 @@
// to forward, the current key can be yielded unexpectedly if a new
// mutation has been added just before the current key.
+#include "gtest/gtest.h"
#include "leveldb/db.h"
-#include "util/testharness.h"
+#include "util/testutil.h"
namespace leveldb {
-class Issue200 {};
-
TEST(Issue200, Test) {
// Get rid of any state from an old run.
- std::string dbpath = test::TmpDir() + "/leveldb_issue200_test";
+ std::string dbpath = testing::TempDir() + "leveldb_issue200_test";
DestroyDB(dbpath, Options());
DB* db;
Options options;
options.create_if_missing = true;
- ASSERT_OK(DB::Open(options, dbpath, &db));
+ ASSERT_LEVELDB_OK(DB::Open(options, dbpath, &db));
WriteOptions write_options;
- ASSERT_OK(db->Put(write_options, "1", "b"));
- ASSERT_OK(db->Put(write_options, "2", "c"));
- ASSERT_OK(db->Put(write_options, "3", "d"));
- ASSERT_OK(db->Put(write_options, "4", "e"));
- ASSERT_OK(db->Put(write_options, "5", "f"));
+ ASSERT_LEVELDB_OK(db->Put(write_options, "1", "b"));
+ ASSERT_LEVELDB_OK(db->Put(write_options, "2", "c"));
+ ASSERT_LEVELDB_OK(db->Put(write_options, "3", "d"));
+ ASSERT_LEVELDB_OK(db->Put(write_options, "4", "e"));
+ ASSERT_LEVELDB_OK(db->Put(write_options, "5", "f"));
ReadOptions read_options;
Iterator* iter = db->NewIterator(read_options);
// Add an element that should not be reflected in the iterator.
- ASSERT_OK(db->Put(write_options, "25", "cd"));
+ ASSERT_LEVELDB_OK(db->Put(write_options, "25", "cd"));
iter->Seek("5");
ASSERT_EQ(iter->key().ToString(), "5");
@@ -53,5 +52,3 @@ TEST(Issue200, Test) {
}
} // namespace leveldb
-
-int main(int argc, char** argv) { return leveldb::test::RunAllTests(); }