LCOV - code coverage report
Current view: top level - libs/bsw/cpp2someip/src - ServiceQuery.cpp (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 10 10
Test Date: 2026-09-11 12:05:06 Functions: 100.0 % 2 2

            Line data    Source code
       1              : /********************************************************************************
       2              :  * Copyright (c) 2026 Accenture
       3              :  *
       4              :  * This program and the accompanying materials are made available under the
       5              :  * terms of the Apache License Version 2.0 which is available at
       6              :  * https://www.apache.org/licenses/LICENSE-2.0
       7              :  *
       8              :  * SPDX-License-Identifier: Apache-2.0
       9              :  ********************************************************************************/
      10              : 
      11              : #include "someip/ServiceQuery.h"
      12              : 
      13              : #include "someip/init.h"
      14              : 
      15              : namespace someip
      16              : {
      17              : template<>
      18           32 : ServiceQuery make<ServiceQuery>()
      19              : {
      20              :     // clang-format off
      21              :     return {
      22              :          /* multicastAddress */ ::ip::IPEndpoint(),
      23              :                 /* timestamp */ 0U,
      24              :                     /* state */ ServiceQuery::ServiceQueryState::QUERY_IDLE_PHASE,
      25              :           /* repetitionCount */ 0U,
      26              :         /* subscriptionState */ ServiceQuery::SubscriptionState::STATE_UNSUBSCRIBED,
      27           32 :               /* description */ make<ServiceDescription>(),
      28              :                  /* listener */ nullptr,
      29              :                  #ifdef PLATFORM_SUPPORT_IPV6
      30              :   /* serviceDiscoveryAddress */ ::ip::make_ip6(0U), 
      31              :                  #else
      32              :   /* serviceDiscoveryAddress */ ::ip::make_ip4(0U), 
      33              :                  #endif
      34              :                  /* sdConfig */ {}
      35           32 :     };
      36              :     // clang-format on
      37              : }
      38              : 
      39              : template<>
      40           36 : void init<ServiceQuery>(ServiceQuery& ref)
      41              : {
      42           36 :     ref.multicastAddress  = ::ip::IPEndpoint();
      43           36 :     ref.timestamp         = 0U;
      44           36 :     ref.state             = ServiceQuery::ServiceQueryState::QUERY_INITIAL_WAIT_PHASE;
      45           36 :     ref.repetitionCount   = 0U;
      46           36 :     ref.subscriptionState = ServiceQuery::SubscriptionState::STATE_UNSUBSCRIBED;
      47           36 : }
      48              : 
      49              : } // namespace someip
        

Generated by: LCOV version 2.0-1