dte test coverage


Directory: ./
File: src/util/arith.c
Date: 2025-07-19 20:13:10
Exec Total Coverage
Lines: 8 8 100.0%
Functions: 2 2 100.0%
Branches: 2 4 50.0%

Line Branch Exec Source
1 #include <errno.h>
2 #include "arith.h"
3
4 15892 size_t xmul_(size_t a, size_t b)
5 {
6 15892 size_t result;
7
1/2
✗ Branch 0 (3→4) not taken.
✓ Branch 1 (3→5) taken 15892 times.
15892 if (unlikely(size_multiply_overflows(a, b, &result))) {
8 fatal_error(__func__, EOVERFLOW);
9 }
10 15892 return result;
11 }
12
13 241138 size_t xadd(size_t a, size_t b)
14 {
15 241138 size_t result;
16
1/2
✗ Branch 0 (3→4) not taken.
✓ Branch 1 (3→5) taken 241138 times.
241138 if (unlikely(size_add_overflows(a, b, &result))) {
17 fatal_error(__func__, EOVERFLOW);
18 }
19 241138 return result;
20 }
21