MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/lite/core/api/op_resolver_test.cc:82–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80} // namespace
81
82TEST(OpResolver, TestResolver) {
83 MockOpResolver mock_resolver;
84 OpResolver* resolver = &mock_resolver;
85
86 const TfLiteRegistration* registration =
87 resolver->FindOp(BuiltinOperator_CONV_2D, 0);
88 EXPECT_NE(nullptr, registration);
89 EXPECT_EQ(nullptr, registration->init(nullptr, nullptr, 0));
90 EXPECT_EQ(kTfLiteOk, registration->prepare(nullptr, nullptr));
91 EXPECT_EQ(kTfLiteOk, registration->invoke(nullptr, nullptr));
92
93 registration = resolver->FindOp(BuiltinOperator_CAST, 0);
94 EXPECT_EQ(nullptr, registration);
95
96 registration = resolver->FindOp("mock_custom", 0);
97 EXPECT_NE(nullptr, registration);
98 EXPECT_EQ(nullptr, registration->init(nullptr, nullptr, 0));
99 EXPECT_EQ(kTfLiteOk, registration->prepare(nullptr, nullptr));
100 EXPECT_EQ(kTfLiteOk, registration->invoke(nullptr, nullptr));
101
102 registration = resolver->FindOp("nonexistent_custom", 0);
103 EXPECT_EQ(nullptr, registration);
104}
105
106TEST(OpResolver, TestGetRegistrationFromOpCodeConv) {
107 MockOpResolver mock_resolver;

Callers

nothing calls this directly

Calls 8

CreateOperatorCodeDirectFunction · 0.85
FindOpMethod · 0.45
initMethod · 0.45
prepareMethod · 0.45
invokeMethod · 0.45
FinishMethod · 0.45
GetBufferSizeMethod · 0.45

Tested by

no test coverage detected