From 3e3f0d0fb149bfab0361e27ce7c71a87bc756d7b Mon Sep 17 00:00:00 2001 From: dl239 Date: Tue, 31 Oct 2023 16:34:00 +0800 Subject: [PATCH] fix: fix test case --- src/tablet/tablet_impl_test.cc | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/tablet/tablet_impl_test.cc b/src/tablet/tablet_impl_test.cc index da5cc626bf0..ca6baa32178 100644 --- a/src/tablet/tablet_impl_test.cc +++ b/src/tablet/tablet_impl_test.cc @@ -128,17 +128,12 @@ bool RollWLogFile(::openmldb::storage::WriteHandle** wh, ::openmldb::storage::Lo return true; } -void PrepareLatestTableData(TabletImpl& tablet, int32_t tid, int32_t pid, bool compress = false) { // NOLINT +void PrepareLatestTableData(TabletImpl& tablet, int32_t tid, int32_t pid) { // NOLINT for (int32_t i = 0; i < 100; i++) { ::openmldb::api::PutRequest prequest; ::openmldb::test::SetDimension(0, std::to_string(i % 10), prequest.add_dimensions()); prequest.set_time(i + 1); std::string value = ::openmldb::test::EncodeKV(std::to_string(i % 10), std::to_string(i)); - if (compress) { - std::string compressed; - ::snappy::Compress(value.c_str(), value.length(), &compressed); - value.swap(compressed); - } prequest.set_value(value); prequest.set_tid(tid); prequest.set_pid(pid); @@ -153,11 +148,6 @@ void PrepareLatestTableData(TabletImpl& tablet, int32_t tid, int32_t pid, bool c ::openmldb::test::SetDimension(0, "10", prequest.add_dimensions()); prequest.set_time(i % 10 + 1); std::string value = ::openmldb::test::EncodeKV("10", std::to_string(i)); - if (compress) { - std::string compressed; - ::snappy::Compress(value.c_str(), value.length(), &compressed); - value.swap(compressed); - } prequest.set_value(value); prequest.set_tid(tid); prequest.set_pid(pid); @@ -5314,7 +5304,7 @@ TEST_P(TabletImplTest, PutCompress) { MockClosure closure; tablet.CreateTable(NULL, &request, &response, &closure); ASSERT_EQ(0, response.code()); - PrepareLatestTableData(tablet, id, 0, true); + PrepareLatestTableData(tablet, id, 0); } {