MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / TEST_P

Function TEST_P

codelab/network_functions_test.cc:63–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61class NetworkFunctionsCheckerTest : public testing::TestWithParam<TestCase> {};
62
63TEST_P(NetworkFunctionsCheckerTest, DeclarationsTest) {
64 const TestCase& test_case = GetParam();
65
66 ASSERT_OK_AND_ASSIGN(
67 auto compiler_builder,
68 cel::NewCompilerBuilder(cel::GetMinimalDescriptorPool()));
69 ASSERT_THAT(compiler_builder->AddLibrary(cel::StandardCompilerLibrary()),
70 IsOk());
71 ASSERT_THAT(compiler_builder->AddLibrary(NetworkFunctionsCompilerLibrary()),
72 IsOk());
73 ASSERT_OK_AND_ASSIGN(auto compiler, compiler_builder->Build());
74
75 ASSERT_OK_AND_ASSIGN(auto result, compiler->Compile(test_case.expr));
76
77 if (!test_case.type_check_err_substr.empty()) {
78 EXPECT_THAT(result.FormatError(),
79 HasSubstr(test_case.type_check_err_substr));
80 return;
81 }
82
83 EXPECT_TRUE(result.IsValid()) << result.FormatError();
84}
85
86INSTANTIATE_TEST_SUITE_P(
87 NetworkFunctionsCheckerTests, NetworkFunctionsCheckerTest,

Callers

nothing calls this directly

Calls 15

StandardCompilerLibraryFunction · 0.85
RegisterNetworkTypesFunction · 0.85
RegisterNetworkFunctionsFunction · 0.85
FormatErrorMethod · 0.80
IsValidMethod · 0.80
messageMethod · 0.80
AddLibraryMethod · 0.45
emptyMethod · 0.45
IsErrorMethod · 0.45
DebugStringMethod · 0.45
ToStatusMethod · 0.45

Tested by

no test coverage detected