LCOV - code coverage report
Current view: top level - source/common/rds - util.cc (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 13 15 86.7 %
Date: 2024-01-05 06:35:25 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #include "source/common/rds/util.h"
       2             : 
       3             : namespace Envoy {
       4             : namespace Rds {
       5             : 
       6          74 : ProtobufTypes::MessagePtr cloneProto(ProtoTraits& proto_traits, const Protobuf::Message& rc) {
       7          74 :   auto clone = proto_traits.createEmptyProto();
       8          74 :   clone->CheckTypeAndMergeFrom(rc);
       9          74 :   return clone;
      10          74 : }
      11             : 
      12         206 : std::string resourceName(ProtoTraits& proto_traits, const Protobuf::Message& rc) {
      13         206 :   Protobuf::ReflectableMessage reflectable_message = createReflectableMessage(rc);
      14         206 :   const Protobuf::FieldDescriptor* field = reflectable_message->GetDescriptor()->FindFieldByNumber(
      15         206 :       proto_traits.resourceNameFieldNumber());
      16         206 :   if (!field) {
      17           0 :     return {};
      18           0 :   }
      19         206 :   const Protobuf::Reflection* reflection = reflectable_message->GetReflection();
      20         206 :   return reflection->GetString(*reflectable_message, field);
      21         206 : }
      22             : 
      23             : } // namespace Rds
      24             : } // namespace Envoy

Generated by: LCOV version 1.15