Skip to content

Commit

Permalink
test: update test to match cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Jun 18, 2024
1 parent fa252bb commit 00d5420
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/cache_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ extern "C" {

class CacheTest : public ::testing::Test {
protected:
ip_address_t test_addr{};
struct addr_port test_addr{};

void SetUp() override {
test_addr.ip4 = 12345;
test_addr.addr.ip4 = 12345;
test_addr.port = 80;
init_not_http_cache(2);
}

Expand Down Expand Up @@ -42,7 +43,7 @@ TEST_F(CacheTest, AddAndRemoveFromCache) {
}

TEST_F(CacheTest, CacheDoesNotContainNonexistentEntry) {
ip_address_t nonexistent_addr;
nonexistent_addr.ip4 = 54321; // Assign a value different from test_addr
struct addr_port nonexistent_addr{};
nonexistent_addr.addr.ip4 = 54321;
EXPECT_FALSE(cache_contains(nonexistent_addr));
}

0 comments on commit 00d5420

Please sign in to comment.