optimizate: pass the current timeout to the ID generator as a parameter, instead of getting the time from the ID generator itself
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "tuple.h"
|
||||
#include "times.h"
|
||||
#include "packet_def.h"
|
||||
#include "packet_parse.h"
|
||||
#include "id_generator.h"
|
||||
#include "session_utils.h"
|
||||
#include "session_manager.h"
|
||||
#include "tcp_reassembly.h"
|
||||
@@ -307,7 +307,6 @@ TEST(CASE, TCP_FAST_OPEN)
|
||||
struct session_manager *mgr = NULL;
|
||||
struct session_manager_stat *stat = NULL;
|
||||
|
||||
stellar_update_time_cache();
|
||||
mgr = session_manager_new(&opts, 1);
|
||||
EXPECT_TRUE(mgr != NULL);
|
||||
|
||||
@@ -421,6 +420,11 @@ TEST(CASE, TCP_FAST_OPEN)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct id_generator_options opt = {
|
||||
.snowflake_worker_id_base = 1,
|
||||
.snowflake_worker_id_offset = 2,
|
||||
};
|
||||
id_generator_init(&opt);
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user