From 93c3369d398392d53802e6b2b4c3c1276c9eb377 Mon Sep 17 00:00:00 2001 From: nikoPLP Date: Wed, 9 Aug 2023 21:11:45 +0300 Subject: [PATCH] fix tests --- plugin/ippcp/test_linux/ippcp_example.cc | 9 +++------ plugin/ippcp/test_plain/ippcp_example.cc | 4 +++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/plugin/ippcp/test_linux/ippcp_example.cc b/plugin/ippcp/test_linux/ippcp_example.cc index 6ac48c134..9218ac47f 100644 --- a/plugin/ippcp/test_linux/ippcp_example.cc +++ b/plugin/ippcp/test_linux/ippcp_example.cc @@ -17,7 +17,7 @@ using namespace ROCKSDB_NAMESPACE; -std::string kDBPath = "/tmp/ipp_aes_example"; +std::string kDBPath = "/tmp/ipp_aes_example_linux"; int main() { DB* db; @@ -28,7 +28,6 @@ int main() { Status status = EncryptionProvider::CreateFromString( ConfigOptions(), IppcpProvider::kName(), &provider); - std::printf("ok\n"); assert(status.ok()); status = @@ -44,11 +43,9 @@ int main() { printf("writing 1M records..."); WriteOptions w_opts; for (int i = 0; i < 1000000; ++i) { - std::printf("ok.%d.",i); - status = db->Put(w_opts, std::to_string(i), std::to_string(i * i)); + status = db->Put(w_opts, std::to_string(i), std::to_string(i)); assert(status.ok()); } - printf("flush"); db->Flush(FlushOptions()); printf("done.\n"); @@ -58,7 +55,7 @@ int main() { for (int i = 0; i < 1000000; ++i) { status = db->Get(r_opts, std::to_string(i), &value); assert(status.ok()); - assert(value == std::to_string(i * i)); + assert(value == std::to_string(i)); } printf("done.\n"); diff --git a/plugin/ippcp/test_plain/ippcp_example.cc b/plugin/ippcp/test_plain/ippcp_example.cc index 75b2e10ce..2c0a4aeeb 100644 --- a/plugin/ippcp/test_plain/ippcp_example.cc +++ b/plugin/ippcp/test_plain/ippcp_example.cc @@ -17,7 +17,7 @@ using namespace ROCKSDB_NAMESPACE; -std::string kDBPath = "/tmp/ipp_aes_example2"; +std::string kDBPath = "/tmp/ipp_aes_example3"; int main() { DB* db; @@ -32,6 +32,8 @@ int main() { // status = // provider->AddCipher("", "a6d2ae2816157e2b3c4fcf098815f7xb", 32, false); // assert(status.ok()); + + // options.env = NewEncryptedEnv(Env::Default(), provider); Status status = DB::Open(options, kDBPath, &db); assert(status.ok());