• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

llnl / dftracer-utils / 23531027933

25 Mar 2026 08:05AM UTC coverage: 48.592% (-1.5%) from 50.098%
23531027933

Pull #57

github

web-flow
Merge d1070e289 into 38f9f3616
Pull Request #57: feat(comparator): add pairwise traces comparator

18900 of 49456 branches covered (38.22%)

Branch coverage included in aggregate %.

1604 of 1954 new or added lines in 25 files covered. (82.09%)

3407 existing lines in 135 files now uncovered.

18487 of 27485 relevant lines covered (67.26%)

240991.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

29.06
/src/dftracer/utils/core/utils/string.cpp
1
#include <dftracer/utils/core/utils/string.h>
2

3
namespace dftracer::utils {
4
bool json_trim_and_validate(const char* data, std::size_t length,
2,803✔
5
                            const char*& start, std::size_t& trimmed_length) {
6
    start = data;
2,803✔
7
    const char* end = data + length - 1;
2,803✔
8

9
    while (start <= end && (*start == ' ' || *start == '\t' || *start == '\n' ||
5,606!
10
                            *start == '\r')) {
2,803✔
11
        start++;
×
12
    }
13
    while (end >= start &&
5,606!
14
           (*end == ' ' || *end == '\t' || *end == '\n' || *end == '\r')) {
2,803!
15
        end--;
×
16
    }
17

18
    trimmed_length = (end >= start) ? (end - start + 1) : 0;
2,803!
19

20
    if (trimmed_length == 0 ||
2,803!
21
        (trimmed_length == 1 &&
2,803✔
22
         (*start == '[' || *start == '{' || *start == ']' || *start == '}')) ||
119!
23
        (trimmed_length == 2 && start[0] == ']' && start[1] == '[')) {
2,684!
24
        // Invalid/incomplete JSON or file boundary artifact
25
        return false;
119✔
26
    }
27

28
    return true;
2,684✔
29
}
2,803✔
30

31
bool json_trim_and_validate_with_comma(const char* data, std::size_t length,
×
32
                                       const char*& start,
33
                                       std::size_t& trimmed_length) {
34
    start = data;
×
35
    const char* end = data + length - 1;
×
36

37
    while (start <= end && (*start == ' ' || *start == '\t' || *start == '\n' ||
×
38
                            *start == '\r')) {
×
39
        start++;
×
40
    }
41
    while (end >= start &&
×
42
           (*end == ' ' || *end == '\t' || *end == '\n' || *end == '\r')) {
×
43
        end--;
×
44
    }
45

46
    // Also trim trailing commas (for JSON array format)
47
    if (end >= start && *end == ',') {
×
48
        end--;
×
UNCOV
49
    }
×
50

51
    trimmed_length = (end >= start) ? (end - start + 1) : 0;
×
52

53
    if (trimmed_length == 0 ||
×
54
        (trimmed_length == 1 &&
×
55
         (*start == '[' || *start == '{' || *start == ']' || *start == '}')) ||
×
56
        (trimmed_length == 2 && start[0] == ']' && start[1] == '[')) {
×
57
        // Invalid/incomplete JSON or file boundary artifact
58
        return false;
×
59
    }
60

61
    return true;
×
UNCOV
62
}
×
63
}  // namespace dftracer::utils
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc