MCPcopy Create free account
hub / github.com/OAID/Tengine / test_constructor

Function test_constructor

internal/tests/core/test/test_factory.cpp:212–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210};
211
212void test_constructor(void)
213{
214 SpecificFactory<G> fc;
215
216 fc.RegisterConstructor<int>("D");
217 fc.RegisterConstructor<int, int, int>("D");
218 fc.RegisterConstructor<const char*>("D");
219 fc.RegisterConstructor<const std::string&>("D");
220 fc.RegisterConstructor<std::string&&>("D");
221 fc.RegisterConstructor("D");
222
223 std::cout << "all register constructors for D \n";
224
225 std::vector<std::string> info = fc.CreatorInfo("D");
226
227 for(auto str : info)
228 {
229 std::cout << str << std::endl;
230 }
231
232 fc.Create("D");
233
234 fc.Create("D", 1000);
235
236 std::string str = "I'm string";
237
238 fc.Create<const char*>("D", "i'm here");
239 fc.Create<std::string&&>("D", std::move(str));
240 fc.Create<std::string&&>("D", "who are you");
241 fc.Create<const std::string&>("D", "hello, world");
242
243 fc.Create("D", 1, 0, 1);
244}
245
246void test_interface()
247{

Callers 1

mainFunction · 0.85

Calls 3

CreatorInfoMethod · 0.80
RegisterConstructorMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected