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:
@@ -2,10 +2,10 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "tuple.h"
|
||||
#include "times.h"
|
||||
#include "packet_def.h"
|
||||
#include "packet_parse.h"
|
||||
#include "packet_layer.h"
|
||||
#include "id_generator.h"
|
||||
#include "session_utils.h"
|
||||
#include "session_manager.h"
|
||||
#include "test_packets.h"
|
||||
@@ -62,7 +62,6 @@ TEST(TCP_OPENING_TO_ACTIVE, BY_SYN_C2S_DATA)
|
||||
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);
|
||||
|
||||
@@ -153,7 +152,6 @@ TEST(TCP_OPENING_TO_ACTIVE, BY_SYNACK_S2C_DATA)
|
||||
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);
|
||||
|
||||
@@ -233,6 +231,11 @@ TEST(TCP_OPENING_TO_ACTIVE, BY_SYNACK_S2C_DATA)
|
||||
|
||||
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