Browse Source

revise test

pull/1/head
xxy 10 months ago
parent
commit
c260065234
2 changed files with 21 additions and 2 deletions
  1. +1
    -0
      .gitignore
  2. +20
    -2
      test/test.cpp

+ 1
- 0
.gitignore View File

@ -9,3 +9,4 @@ out/
# 忽略 third_party 目录及其内容
third_party/
testdb_for_XOY/

+ 20
- 2
test/test.cpp View File

@ -83,7 +83,7 @@ Status Get_keys_by_field(DB *db,const ReadOptions& options, const Field field,st
return Status::OK();
}
TEST(TestTTL, OurTTL) {
TEST(Test, CheckGetFields) {
DB *db;
WriteOptions writeOptions;
ReadOptions readOptions;
@ -123,8 +123,26 @@ TEST(TestTTL, OurTTL) {
}
ASSERT_TRUE(CompareFieldArray(fields1, res1));
std::cout<<"get serialized value done"<<std::endl;
delete db;
}
TEST(Test, CheckSearchKey) {
DB *db;
ReadOptions readOptions;
if(OpenDB("testdb_for_XOY", &db).ok() == false) {
std::cerr << "open db failed" << std::endl;
abort();
}
std::string key1 = "k_1";
std::string key2 = "k_2";
FieldArray fields1 = {
{"name", "Customer#000000001"},
{"address", "IVhzIApeRb"},
{"phone", "25-989-741-2988"}
};
std::vector<std::string> keys = {key1, key2};
std::vector<std::string> key_res;

Loading…
Cancel
Save