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

Function AddTestCaseBindingsToLegacyActivation

testing/testrunner/runner_lib.cc:243–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243absl::Status AddTestCaseBindingsToLegacyActivation(
244 const TestCase& test_case, const CelTestContext& context,
245 Activation& activation, google::protobuf::Arena* arena) {
246 auto* message_factory = GetMessageFactory(context);
247 auto* descriptor_pool = GetDescriptorPool(context);
248 for (const auto& binding : test_case.input()) {
249 CEL_ASSIGN_OR_RETURN(
250 cel::Value resolved_cel_value,
251 ResolveInputValue(/*input_value=*/binding.second, context, arena));
252 CEL_ASSIGN_OR_RETURN(ValueProto value_proto,
253 ToExprValue(resolved_cel_value, descriptor_pool,
254 message_factory, arena));
255 CEL_ASSIGN_OR_RETURN(LegacyCelValue value,
256 ValueToCelValue(value_proto, arena));
257 activation.InsertValue(/*name=*/binding.first, value);
258 }
259 return absl::OkStatus();
260}
261
262absl::StatusOr<Activation> CreateLegacyActivationFromBindings(
263 const TestCase& test_case, const CelTestContext& context,

Callers 1

Calls 3

GetMessageFactoryFunction · 0.85
GetDescriptorPoolFunction · 0.85
InsertValueMethod · 0.80

Tested by

no test coverage detected