From 5774e3be0a6e67aa2b939d759c95ac605ccd5f06 Mon Sep 17 00:00:00 2001 From: Zxilly Date: Wed, 27 Nov 2024 10:22:26 +0800 Subject: [PATCH] test: not remove expired cache on read now --- test/cache_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cache_test.cc b/test/cache_test.cc index bfca95a3..bd1f7dc5 100644 --- a/test/cache_test.cc +++ b/test/cache_test.cc @@ -6,7 +6,7 @@ extern "C" { class CacheTest : public ::testing::Test { protected: - struct addr_port test_addr{}; + addr_port test_addr{}; void SetUp() override { test_addr.addr.ip4 = 12345; @@ -39,11 +39,11 @@ TEST_F(CacheTest, AddAndRemoveFromCache) { cache_add(test_addr); EXPECT_TRUE(cache_contains(test_addr)); sleep(5); - EXPECT_FALSE(cache_contains(test_addr)); + EXPECT_TRUE(cache_contains(test_addr)); } TEST_F(CacheTest, CacheDoesNotContainNonexistentEntry) { - struct addr_port nonexistent_addr{}; + addr_port nonexistent_addr{}; nonexistent_addr.addr.ip4 = 54321; EXPECT_FALSE(cache_contains(nonexistent_addr)); } \ No newline at end of file