summaryrefslogtreecommitdiff
path: root/infra/module_manager/test
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-11-25 19:23:01 +0800
committeryangwei <[email protected]>2024-11-25 19:23:01 +0800
commitef5a65155b11fec8c6234f0a18678e11d7f79cf1 (patch)
treee1f76e17711b5498e85cb3564e7e4251c81fbb1b /infra/module_manager/test
parente2776414401af0bc02beb305b0d366fe3828cffd (diff)
🦄 refactor(module_manager ): new with hooks
Diffstat (limited to 'infra/module_manager/test')
-rw-r--r--infra/module_manager/test/gtest_module_manager_main.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/infra/module_manager/test/gtest_module_manager_main.cpp b/infra/module_manager/test/gtest_module_manager_main.cpp
index 0493cc4..4087611 100644
--- a/infra/module_manager/test/gtest_module_manager_main.cpp
+++ b/infra/module_manager/test/gtest_module_manager_main.cpp
@@ -31,7 +31,7 @@ TEST(module_manager_internal, stellar_module_manager_new_with_toml) {
write(fd, gtest_mock_spec_toml, strlen(gtest_mock_spec_toml));
close(fd);
- struct module_manager *mod_mgr=module_manager_new(toml_template, 10, mq_schema, NULL);
+ struct module_manager *mod_mgr=module_manager_new_with_toml(toml_template, 10, mq_schema, NULL);
EXPECT_TRUE(mod_mgr!=NULL);
EXPECT_TRUE(module_manager_get_module(mod_mgr, "test")==NULL);
@@ -72,7 +72,7 @@ TEST(stellar_module, basic_new_and_free) {
TEST(stellar_module_manager, new_with_null_toml) {
struct mq_schema *mq_schema=NULL;
- struct module_manager *mod_mgr = module_manager_new(NULL, 10, mq_schema, NULL);
+ struct module_manager *mod_mgr = module_manager_new_with_toml(NULL, 10, mq_schema, NULL);
EXPECT_TRUE(mod_mgr!=NULL);
EXPECT_TRUE(module_manager_get_module(mod_mgr, "test")==NULL);
EXPECT_EQ(module_manager_get_max_thread_num(mod_mgr), 10);
@@ -87,7 +87,7 @@ TEST(stellar_module_manager, new_with_null_toml) {
TEST(stellar_module_manager, new_with_empty_toml) {
struct mq_schema *mq_schema=NULL;
- struct module_manager *mod_mgr = module_manager_new("/dev/null", 10, mq_schema, NULL);
+ struct module_manager *mod_mgr = module_manager_new_with_toml("/dev/null", 10, mq_schema, NULL);
EXPECT_TRUE(mod_mgr!=NULL);
EXPECT_TRUE(module_manager_get_module(mod_mgr, "test")==NULL);
EXPECT_EQ(module_manager_get_max_thread_num(mod_mgr), 10);
@@ -102,7 +102,7 @@ TEST(stellar_module_manager, new_with_empty_toml) {
TEST(stellar_module_manager, register_thread) {
struct mq_schema *mq_schema=(struct mq_schema*)1;
- struct module_manager *mod_mgr=module_manager_new(NULL, 10, mq_schema, NULL);
+ struct module_manager *mod_mgr=module_manager_new_with_toml(NULL, 10, mq_schema, NULL);
EXPECT_TRUE(mod_mgr!=NULL);
@@ -182,7 +182,7 @@ TEST(module_manager, basic_module) {
write(fd, gtest_module_spec_toml, strlen(gtest_module_spec_toml));
close(fd);
- struct module_manager *mod_mgr=module_manager_new(toml_template, 10, mq_schema, NULL);
+ struct module_manager *mod_mgr=module_manager_new_with_toml(toml_template, 10, mq_schema, NULL);
EXPECT_TRUE(mod_mgr!=NULL);
EXPECT_TRUE(module_manager_get_module(mod_mgr, "gtest")!=NULL);
@@ -232,7 +232,7 @@ TEST(module_manager, basic_polling_module) {
struct mq_schema *mq_schema=mq_schema_new();
- struct module_manager *mod_mgr=module_manager_new(NULL, 10, mq_schema, NULL);
+ struct module_manager *mod_mgr=module_manager_new_with_toml(NULL, 10, mq_schema, NULL);
EXPECT_TRUE(mod_mgr!=NULL);
@@ -252,7 +252,7 @@ TEST(module_manager, basic_polling_module) {
for(int i=0; i<env.N_round; i++)
{
- stellar_polling_dispatch(mod_mgr);
+ module_manager_polling_dispatch(mod_mgr);
}
module_manager_unregister_thread(mod_mgr, 1);