Skip to content

Commit

Permalink
test: not remove expired cache on read now
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Nov 27, 2024
1 parent fb3dc3b commit 5774e3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/cache_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}

0 comments on commit 5774e3b

Please sign in to comment.