Test that a module library gets loaded, and its contents version-verified. The provided test library matches the current Mesos version exactly.
| 182 | // version-verified. The provided test library matches the current |
| 183 | // Mesos version exactly. |
| 184 | TEST_F(ModuleTest, ExampleModuleLoadTest) |
| 185 | { |
| 186 | EXPECT_SOME(ModuleManager::load(defaultModules)); |
| 187 | |
| 188 | EXPECT_TRUE(ModuleManager::contains<TestModule>(DEFAULT_MODULE_NAME)); |
| 189 | module = ModuleManager::create<TestModule>(DEFAULT_MODULE_NAME); |
| 190 | EXPECT_SOME(module); |
| 191 | |
| 192 | // The TestModuleImpl module's implementation of foo() returns |
| 193 | // the sum of the passed arguments, whereas bar() returns the |
| 194 | // product. baz() returns '-1' if "sum" is not specified as the |
| 195 | // "operation" in the command line parameters. |
| 196 | EXPECT_EQ(1089, module.get()->foo('A', 1024)); |
| 197 | EXPECT_EQ(5, module.get()->bar(0.5, 10.8)); |
| 198 | EXPECT_EQ(-1, module.get()->baz(5, 10)); |
| 199 | } |
| 200 | |
| 201 | |
| 202 | // Test that we can load module manifests from modules-dir. |
nothing calls this directly
no test coverage detected