summaryrefslogtreecommitdiff
path: root/issues/issue200_test.cc
diff options
context:
space:
mode:
authorVictor Costan <costan@google.com>2019-11-21 13:09:53 -0800
committerVictor Costan <pwnall@chromium.org>2019-11-21 13:11:40 -0800
commit1c58902bdcc8d129f3883606bbd8e59085b48878 (patch)
tree8ca631cdc3575fa2f33be0dc28b9d94d610202a1 /issues/issue200_test.cc
parent2c9c80bd539ca5aad5ea864ee6dd81c1ee3eb91e (diff)
downloadleveldb-1c58902bdcc8d129f3883606bbd8e59085b48878.tar.gz
Switch testing harness to googletest.
PiperOrigin-RevId: 281815695
Diffstat (limited to 'issues/issue200_test.cc')
-rw-r--r--issues/issue200_test.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/issues/issue200_test.cc b/issues/issue200_test.cc
index 877b2af..ee08bc6 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 "third_party/googletest/googletest/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");
@@ -54,4 +53,7 @@ TEST(Issue200, Test) {
} // namespace leveldb
-int main(int argc, char** argv) { return leveldb::test::RunAllTests(); }
+int main(int argc, char** argv) {
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}