From 571ff2335637038685e81b5aa6d307642c58b688 Mon Sep 17 00:00:00 2001 From: Bob Chen Date: Sat, 4 Jan 2025 22:03:36 +0800 Subject: [PATCH] a --- common/test/test_throttle.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/test/test_throttle.cpp b/common/test/test_throttle.cpp index 3c4fd708..18ebe18d 100644 --- a/common/test/test_throttle.cpp +++ b/common/test/test_throttle.cpp @@ -10,7 +10,6 @@ #include "../../test/gtest.h" #include "../../test/ci-tools.h" -/* TEST(Throttle, basic) { // baseline uint64_t total = 10UL * 1024 * 1024; @@ -110,7 +109,6 @@ TEST(Throttle, pulse) { EXPECT_GT((uint64_t) duration.count(), 9UL * 1000 * 1000); EXPECT_LT((uint64_t) duration.count(), 20UL * 1000 * 1000); } -*/ template void test_with_idle(IDLE&& idle) { @@ -134,7 +132,7 @@ void test_with_idle(IDLE&& idle) { EXPECT_LT((uint64_t) duration.count(), 2UL * 1000 * 1000); } -/*TEST(Throttle, no_sleep) { +TEST(Throttle, no_sleep) { test_with_idle([] {}); } @@ -165,7 +163,7 @@ TEST(Throttle, try_consume) { LOG_INFO("Act ` times in 10 sec, prevent ` acts", DEC(count).comma(true), DEC(failure).comma(true)); EXPECT_LT(count, 11000UL); -}*/ +} //////////////////////////////////////// // The sleep and semaphore in macOS is less efficient and always cause variance, so skip macOS @@ -220,7 +218,7 @@ TEST_P(FindAppropriateSliceNumTest, run) { #define INSTANTIATE_TEST_P INSTANTIATE_TEST_CASE_P #endif -/*INSTANTIATE_TEST_P(Throttle, +INSTANTIATE_TEST_P(Throttle, FindAppropriateSliceNumTest, testing::Values( FindAppropriateSliceNumSuite{10, 0.01}, FindAppropriateSliceNumSuite{50, 0.02}, @@ -228,7 +226,7 @@ TEST_P(FindAppropriateSliceNumTest, run) { FindAppropriateSliceNumSuite{500, 0.08}, FindAppropriateSliceNumSuite{1000, 0.08}, FindAppropriateSliceNumSuite{5000, 0.85} // Unacceptable -));*/ +)); ////////////////////////////////////////