Branch Coverage

LogSyslogFast.c
Criterion Covered Total %
branch 60 88 68.1


line true false branch
21 163 37 if (!logger->sender || !logger->name)
37 126 if (!logger->sender || !logger->name)
31 4 122 if (logger->format == LOG_RFC5424) {
38 12 114 if (logger->format == LOG_RFC3164 || logger->format == LOG_RFC5424) {
4 8 if (logger->format == LOG_RFC3164 || logger->format == LOG_RFC5424) {
43 8 0 } else if (logger->format == LOG_RFC3164_LOCAL) { /* without sender */
50 0 126 if (logger->prefix_len > logger->bufsize - 1)
68 0 37 if (!logger)
76 0 37 if (!logger->linebuf) {
97 0 28 if (ret)
130 0 46 if (!logger->sender) {
143 0 46 if (!logger->name) {
170 39 12 if (logger->format == LOG_RFC3164) {
180 4 8 else if (logger->format == LOG_RFC5424) {
205 8 0 else if (logger->format == LOG_RFC3164_LOCAL) {
238 108 37 if (logger->sock >= 0) {
240 0 108 if (ret) {
247 130 15 if (proto == LOG_UDP || proto == LOG_TCP) {
110 20 if (proto == LOG_UDP || proto == LOG_TCP) {
270 110 15 if (proto == LOG_TCP) {
282 2 123 if (r < 0) {
286 0 123 else if (!results) {
290 123 0 for (rp = results; rp != NULL; rp = rp->ai_next) {
292 0 123 if (logger->sock == -1) {
300 0 123 if (logger->sock == -1) {
302 0 0 clean_return(-1);
341 20 0 else if (proto == LOG_UNIX) {
358 0 143 if (logger->sock < 0) {
360 0 0 clean_return(-1);
367 14 129 if (connect(logger->sock, p_address, address_len) != 0) {
369 13 1 if (proto == LOG_UNIX && errno == EPROTOTYPE) {
7 6 if (proto == LOG_UNIX && errno == EPROTOTYPE) {
372 0 7 if (logger->sock < 0) {
374 0 0 clean_return(-1);
378 0 7 if (connect(logger->sock, p_address, address_len) != 0) {
380 0 0 clean_return(-1);
385 1 6 clean_return(-1);
389 122 14 clean_return(0);
396 0 35 if (t != logger->last_time)
401 1 34 if (logger->bufsize < line_len + 1) {
404 1 1 while (new_bufsize < line_len + 1)
406 0 1 if (new_bufsize < 0) {
413 0 1 if (!new_buf) {
428 5 30 if (ret < 0)