Branch Coverage

src/panda/time/unix.icc
Criterion Covered Total %
branch 18 60 30.0


line true false branch
7 1 0 if (access("/etc/localtime", R_OK) != 0) return false;
13 1 0 if (access("/usr/local/etc/localtime", R_OK) != 0) return false;
19 1 0 string content = readfile(filename);
20 0 1 if (!content) return false;
23 1 0 content.reserve(content.length()+1);
24 1 0 content[content.length()] = 0;
1 0 content[content.length()] = 0;
27 1 0 if (regexec(pattern, content.data(), 10, m, 0) != 0) return false; // no match
0 1 if (regexec(pattern, content.data(), 10, m, 0) != 0) return false; // no match
30 1 0 if (len < 1 || len > TZNAME_MAX) return false;
0 1 if (len < 1 || len > TZNAME_MAX) return false;
39 1 0 int err = regcomp(&pattern, "([^[:space:]]+)", REG_EXTENDED|REG_NEWLINE);
40 0 1 assert(err == 0);
41 1 0 return _from_regex(lzname, "/etc/timezone", &pattern, 1);
46 0 0 int err = regcomp(&pattern, "^[[:space:]]*TZ[[:space:]]*=[[:space:]]*([^[:space:]]+)", REG_EXTENDED|REG_NEWLINE);
47 0 0 assert(err == 0);
48 0 0 return _from_regex(lzname, "/etc/TIMEZONE", &pattern, 1);
53 0 0 int err = regcomp(&pattern, "^[[:space:]]*(TIME)?ZONE[[:space:]]*=[[:space:]]*\"([^\"]+)\"", REG_EXTENDED|REG_NEWLINE);
54 0 0 assert(err == 0);
55 0 0 return _from_regex(lzname, "/etc/sysconfig/clock", &pattern, 2);
60 0 0 int err = regcomp(&pattern, "^[[:space:]]*TZ[[:space:]]*=[[:space:]]*([^[:space:]]+)", REG_EXTENDED|REG_NEWLINE);
61 0 0 assert(err == 0);
62 0 0 return _from_regex(lzname, "/etc/default/init", &pattern, 1);
66 1 0 if (
67 1 0 _from_etc_localtime(lzname) ||
68 0 1 _from_usr_local_etc_localtime(lzname) ||
69 0 0 _from_etc_timezone(lzname) ||
70 0 0 _from_etc_TIMEZONE(lzname) ||
71 1 0 _from_etc_sysconfig_clock(lzname) ||
0 0 _from_etc_sysconfig_clock(lzname) ||