Refactor main loop
This commit is contained in:
16
deps/dablooms/test/gtest_dablooms.cpp
vendored
16
deps/dablooms/test/gtest_dablooms.cpp
vendored
@@ -14,20 +14,6 @@ struct packet_idetify
|
||||
unsigned int ip_dst;
|
||||
} __attribute__((packed, aligned(1)));
|
||||
|
||||
struct config
|
||||
{
|
||||
int enable;
|
||||
|
||||
unsigned int capacity;
|
||||
double error_rate;
|
||||
int expiry_time;
|
||||
} config = {
|
||||
.enable = 1,
|
||||
.capacity = 1000000,
|
||||
.error_rate = 0.00001,
|
||||
.expiry_time = 3,
|
||||
};
|
||||
|
||||
struct packet_idetify idetify = {
|
||||
.tcp_seq = 2172673142,
|
||||
.tcp_ack = 2198097831,
|
||||
@@ -41,7 +27,7 @@ struct packet_idetify idetify = {
|
||||
|
||||
TEST(DABLOOMS, TEST)
|
||||
{
|
||||
struct expiry_dablooms_handle *handle = expiry_dablooms_new(config.capacity, config.error_rate, 1, config.expiry_time);
|
||||
struct expiry_dablooms_handle *handle = expiry_dablooms_new(1000000, 0.00001, 1, 3);
|
||||
EXPECT_TRUE(handle != nullptr);
|
||||
|
||||
EXPECT_TRUE(expiry_dablooms_search(handle, (const char *)&idetify, sizeof(idetify), 1) != 1); // no exist
|
||||
|
||||
Reference in New Issue
Block a user