oxigraph-main
Niko PLP 1 year ago
parent e393b5183a
commit 93c3369d39
  1. 9
      plugin/ippcp/test_linux/ippcp_example.cc
  2. 4
      plugin/ippcp/test_plain/ippcp_example.cc

@ -17,7 +17,7 @@
using namespace ROCKSDB_NAMESPACE; using namespace ROCKSDB_NAMESPACE;
std::string kDBPath = "/tmp/ipp_aes_example"; std::string kDBPath = "/tmp/ipp_aes_example_linux";
int main() { int main() {
DB* db; DB* db;
@ -28,7 +28,6 @@ int main() {
Status status = EncryptionProvider::CreateFromString( Status status = EncryptionProvider::CreateFromString(
ConfigOptions(), IppcpProvider::kName(), &provider); ConfigOptions(), IppcpProvider::kName(), &provider);
std::printf("ok\n");
assert(status.ok()); assert(status.ok());
status = status =
@ -44,11 +43,9 @@ int main() {
printf("writing 1M records..."); printf("writing 1M records...");
WriteOptions w_opts; WriteOptions w_opts;
for (int i = 0; i < 1000000; ++i) { 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));
status = db->Put(w_opts, std::to_string(i), std::to_string(i * i));
assert(status.ok()); assert(status.ok());
} }
printf("flush");
db->Flush(FlushOptions()); db->Flush(FlushOptions());
printf("done.\n"); printf("done.\n");
@ -58,7 +55,7 @@ int main() {
for (int i = 0; i < 1000000; ++i) { for (int i = 0; i < 1000000; ++i) {
status = db->Get(r_opts, std::to_string(i), &value); status = db->Get(r_opts, std::to_string(i), &value);
assert(status.ok()); assert(status.ok());
assert(value == std::to_string(i * i)); assert(value == std::to_string(i));
} }
printf("done.\n"); printf("done.\n");

@ -17,7 +17,7 @@
using namespace ROCKSDB_NAMESPACE; using namespace ROCKSDB_NAMESPACE;
std::string kDBPath = "/tmp/ipp_aes_example2"; std::string kDBPath = "/tmp/ipp_aes_example3";
int main() { int main() {
DB* db; DB* db;
@ -33,6 +33,8 @@ int main() {
// provider->AddCipher("", "a6d2ae2816157e2b3c4fcf098815f7xb", 32, false); // provider->AddCipher("", "a6d2ae2816157e2b3c4fcf098815f7xb", 32, false);
// assert(status.ok()); // assert(status.ok());
// options.env = NewEncryptedEnv(Env::Default(), provider);
Status status = DB::Open(options, kDBPath, &db); Status status = DB::Open(options, kDBPath, &db);
assert(status.ok()); assert(status.ok());

Loading…
Cancel
Save