dte test coverage


Directory: ./
File: src/util/arith.c
Date: 2025-10-16 19:09:21
Exec Total Coverage
Lines: 10 10 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 16028 size_t xmul_(size_t a, size_t b)
5 {
6 16028 size_t result;
7 16028 bool overflow = size_multiply_overflows(a, b, &result);
8
1/2
✗ Branch 0 (3→4) not taken.
✓ Branch 1 (3→5) taken 16028 times.
16028 FATAL_ERROR_ON(overflow, EOVERFLOW);
9 16028 return result;
10 }
11
12 256704 size_t xadd(size_t a, size_t b)
13 {
14 256704 size_t result;
15 256704 bool overflow = size_add_overflows(a, b, &result);
16
1/2
✗ Branch 0 (3→4) not taken.
✓ Branch 1 (3→5) taken 256704 times.
256704 FATAL_ERROR_ON(overflow, EOVERFLOW);
17 256704 return result;
18 }
19