Branch Coverage

src/panda/protocol/websocket/Utf8Checker.cc
Criterion Covered Total %
branch 32 94 34.0


line true false branch
7 4 18 if (p[0] < 128) {
11 18 0 if ((p[0] & 0xe0) == 0xc0) {
12 18 0 if ((p[1] & 0xc0) != 0x80
13 2 16 || (p[0] & 0xfe) == 0xc0 // overlong
18 0 0 if ((p[0] & 0xf0) == 0xe0) {
19 0 0 if ((p[1] & 0xc0) != 0x80
20 0 0 || (p[2] & 0xc0) != 0x80
21 0 0 || (p[0] == 0xe0 && (p[1] & 0xe0) == 0x80) // overlong
0 0 || (p[0] == 0xe0 && (p[1] & 0xe0) == 0x80) // overlong
22 0 0 || (p[0] == 0xed && (p[1] & 0xe0) == 0xa0) // surrogate
0 0 || (p[0] == 0xed && (p[1] & 0xe0) == 0xa0) // surrogate
29 0 0 if ((p[0] & 0xf8) == 0xf0) {
30 0 0 if( (p[1] & 0xc0) != 0x80
31 0 0 || (p[2] & 0xc0) != 0x80
32 0 0 || (p[3] & 0xc0) != 0x80
33 0 0 || (p[0] == 0xf0 && (p[1] & 0xf0) == 0x80) // overlong
0 0 || (p[0] == 0xf0 && (p[1] & 0xf0) == 0x80) // overlong
34 0 0 || (p[0] == 0xf4 && p[1] > 0x8f) || p[0] > 0xf4 // > U+10FFFF
0 0 || (p[0] == 0xf4 && p[1] > 0x8f) || p[0] > 0xf4 // > U+10FFFF
0 0 || (p[0] == 0xf4 && p[1] > 0x8f) || p[0] > 0xf4 // > U+10FFFF
44 4 6 if (v < 128) return 1;
45 0 6 if (v < 192) return 0;
46 6 0 if (v < 224) return 2;
47 0 0 if (v < 240) return 3;
48 0 0 if (v < 248) return 4;
71 4 10 if (need_ > 0) {
78 4 4 while (n--) *p_++ = *in++;
79 0 4 assert(p_ <= cp_ + 4);
82 0 4 if (need_ > 0) {
84 0 0 assert(in == end);
94 0 4 if (!valid(p)) return false;
98 14 0 if (size <= sizeof(std::size_t)) goto slow;
106 0 0 while (in < last) {
107 0 0 if (*in & 0x80) {
122 0 0 while (in < last) {
124 0 0 if ((*reinterpret_cast(in) & mask) != 0) {
132 0 0 while (in < last) if (!valid(in)) return false;
0 0 while (in < last) if (!valid(in)) return false;
140 8 12 while (in < last) if(!valid(in)) return false;
2 6 while (in < last) if(!valid(in)) return false;
154 8 10 if (!n) break;
158 0 10 if (need == 0) return false;
159 6 4 if (need <= n) {
161 0 6 if (!valid(in)) return false;
169 4 4 while(n--) *p_++ = *in++;
170 0 4 assert(in == end);
171 0 4 assert(p_ <= cp_ + 4);