🦄 refactor(module manager): remove internal api load_spec

This commit is contained in:
yangwei
2024-09-27 19:36:14 +08:00
parent 849df6b9cc
commit dc4805fbb8
3 changed files with 43 additions and 70 deletions

View File

@@ -17,27 +17,6 @@ const char *gtest_mock_spec_toml =
"init = \"gtest_mock_init\"\n"
"exit = \"gtest_mock_exit\"\n";
TEST(module_manager_internal, module_specs_load) {
FILE *fp = fmemopen((void *)gtest_mock_spec_toml, strlen(gtest_mock_spec_toml), "r");
EXPECT_TRUE(fp!=NULL);
struct module_spec_load *specs=NULL;
int mod_num=module_specs_load(fp, &specs);
fclose(fp);
EXPECT_EQ(mod_num, 1);
EXPECT_EQ(specs[0].on_init_cb, gtest_mock_init);
EXPECT_EQ(specs[0].on_exit_cb, gtest_mock_exit);
if(specs->path)free(specs->path);
if(specs->init_cb_name)free(specs->init_cb_name);
if(specs->exit_cb_name)free(specs->exit_cb_name);
free(specs);
}
TEST(module_manager_internal, stellar_module_manager_new_with_toml) {
struct mq_schema *mq_schema=NULL;