Coverage Report

Created: 2026-09-04 06:54

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gpowerd/bmc/status_macros.h
Line
Count
Source
1
#ifndef PRODUCTION_BORG_MGMT_NODE_PROXY_SAFEPOWER_SAFEPOWER_AGENT_BMC_STATUS_MACROS_H_
2
#define PRODUCTION_BORG_MGMT_NODE_PROXY_SAFEPOWER_SAFEPOWER_AGENT_BMC_STATUS_MACROS_H_
3
4
#define RETURN_IF_ERROR(expr) \
5
8.56k
  do { \
6
8.56k
    if (auto status = (expr); !status.ok()) { \
7
5.89k
      return status; \
8
5.89k
    } \
9
8.56k
  } while (0)
10
11
#define ASSIGN_OR_RETURN_CT(lhs, expr, ct) \
12
8.56k
  decltype(expr) status_or_##ct; \
13
8.56k
  do { \
14
17.1k
    status_or_##ct = (expr); \
15
8.56k
    if (!status_or_##ct.ok()) { \
16
0
      return status_or_##ct.status(); \
17
0
    } \
18
8.56k
  } while (0); \
19
8.56k
  lhs = *std::move(status_or_##ct)
20
21
#define ASSIGN_OR_RETURN_CT_pre(lhs, exp, ct) \
22
8.56k
  ASSIGN_OR_RETURN_CT(lhs, exp, ct)
23
24
#define ASSIGN_OR_RETURN(lhs, expr ) \
25
8.56k
  ASSIGN_OR_RETURN_CT_pre(lhs, expr, __COUNTER__ )
26
27
28
#endif  // PRODUCTION_BORG_MGMT_NODE_PROXY_SAFEPOWER_SAFEPOWER_AGENT_BMC_STATUS_MACROS_H_