From fc030619564c78165e1efa4614c14bc287c73f8f Mon Sep 17 00:00:00 2001 From: ssynn <824063458@qq.com> Date: Sat, 26 Oct 2024 13:44:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8A=8A=E9=9A=8F=E6=9C=BA=E7=A7=8D?= =?UTF-8?q?=E5=AD=90=E6=94=B9=E6=88=90=E4=B8=80=E6=A0=B7=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/db_test2.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/db_test2.cc b/test/db_test2.cc index 49e26ab..7c52b5b 100644 --- a/test/db_test2.cc +++ b/test/db_test2.cc @@ -23,7 +23,7 @@ Status OpenDB(std::string dbName, DB **db) { void InsertData(DB *db) { WriteOptions writeOptions; int key_num = data_size / value_size; - srand(static_cast(time(0))); + srand(0); for (int i = 0; i < key_num; i++) { int key_ = rand() % key_num+1; @@ -39,7 +39,7 @@ void GetData(DB *db, int size = (1 << 30)) { int key_num = data_size / value_size; // 点查 - srand(static_cast(time(0))); + srand(0); for (int i = 0; i < 100; i++) { int key_ = rand() % key_num+1; std::string key = std::to_string(key_); From 09d1debb0477592cc3b05351d9542e8c763fc6c2 Mon Sep 17 00:00:00 2001 From: ssynn <824063458@qq.com> Date: Tue, 29 Oct 2024 10:43:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9ttl=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E7=A7=8D=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/ttl_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/ttl_test.cc b/test/ttl_test.cc index 06f4cda..4bb524a 100644 --- a/test/ttl_test.cc +++ b/test/ttl_test.cc @@ -20,7 +20,7 @@ Status OpenDB(std::string dbName, DB **db) { void InsertData(DB *db, uint64_t ttl/* second */) { WriteOptions writeOptions; int key_num = data_size / value_size; - srand(static_cast(time(0))); + srand(0); for (int i = 0; i < key_num; i++) { int key_ = rand() % key_num+1; @@ -35,7 +35,7 @@ void GetData(DB *db, int size = (1 << 30)) { int key_num = data_size / value_size; // 点查 - srand(static_cast(time(0))); + srand(0); for (int i = 0; i < 100; i++) { int key_ = rand() % key_num+1; std::string key = std::to_string(key_); @@ -58,7 +58,7 @@ TEST(TestTTL, ReadTTL) { ReadOptions readOptions; Status status; int key_num = data_size / value_size; - srand(static_cast(time(0))); + srand(0); for (int i = 0; i < 100; i++) { int key_ = rand() % key_num+1; std::string key = std::to_string(key_);