Branch Coverage

DDCCI.xs
Criterion Covered Total %
branch 9 80 11.2


line true false branch
129 5 0 if (!name || (*name == '\0'))
2 3 if (!name || (*name == '\0'))
132 258 1 for (i = 0; i <= 0xff; i++) {
133 180 78 if (strcmp((n = _vcp_name(i)), "???") == 0)
135 2 76 if (strcasecmp(name, n) == 0)
196 0 0 while (len--)
218 0 0 if (
219 0 0 (_i2c_read(fd, addr, tmp, len + 3) <= 0) ||
220 0 0 (tmp[0] == 0x51) ||
226 0 0 if (tmp[0] != addr << 1)
228 0 0 if ((tmp[1] & MAGIC_2) == 0)
231 0 0 for (i = 0; i <= r + 2; i++)
233 0 0 if (xor != 0)
235 0 0 if (r > len)
271 0 0 if (_ddcci_write(fd, DDCCI_ADDR, buf, 2) < 0)
276 0 0 if ((r = _ddcci_read(fd, DDCCI_ADDR, buf, sizeof(buf))) < 0)
282 0 0 if (
283 0 0 (r != sizeof(buf)) ||
284 0 0 (buf[0] != DDCCI_REPLY_READ) ||
285 0 0 buf[1] ||
293 0 0 if (value) *value = vc;
294 0 0 if (max) *max = vm;
295 0 0 if (type) *type = buf[3];
316 0 0 if (_ddcci_write(fd, DDCCI_ADDR, tmp, sizeof(tmp)) < 0)
321 0 0 if ((r = _ddcci_read(fd, DDCCI_ADDR, tmp, sizeof(tmp))) < 0)
324 0 0 if (
325 0 0 (r < 3) ||
326 0 0 (tmp[0] != DDCCI_REPLY_CAPS) ||
331 0 0 if (!(p = realloc(*buf, len + (r - 3) * 6 + 1)))
335 0 0 for (i = 3; i < r; i++)
336 0 0 len += sprintf(*buf+len, ((tmp[i] >= 0x20) && (tmp[i] < 127)) ? "%c" : " 0x%02x ", tmp[i]);
0 0 len += sprintf(*buf+len, ((tmp[i] >= 0x20) && (tmp[i] < 127)) ? "%c" : " 0x%02x ", tmp[i]);
340 0 0 } while (r > 3);
358 0 0 if (!(*buf = malloc(128)))
363 0 0 if ((r = _i2c_write(fd, EDID_ADDR, &tmp, 1)) < 0)
366 0 0 if ((r = _i2c_read(fd, EDID_ADDR, *buf, 128)) < 0)
419 0 0 if (_ddcci_read_vcp(fd, vcp, &value, NULL, NULL) < 0)
432 0 0 if (_ddcci_write_vcp(fd, vcp, value) < 0)
445 0 0 if ((len = _ddcci_caps(fd, &caps)) < 0)
459 0 0 if ((len = _ddcci_edid(fd, &edid)) < 0)