Branch Coverage

src/b_path.c
Criterion Covered Total %
branch 17 34 50.0


line true false branch
12 0 20245 if ((ret = b_stack_new(0)) == NULL) {
18 0 20245 if ((dup = malloc(string->len + 1)) == NULL) {
22 0 20245 if (memcpy(dup, string->str, string->len) == NULL) {
30 30820 20245 while ((item = strtok_r(tmp, "/", &ctx)) != NULL) {
38 10575 20245 if (b_stack_count(ret) > 0 && strcmp(item, ".") == 0) {
0 10575 if (b_stack_count(ret) > 0 && strcmp(item, ".") == 0) {
47 20245 10575 if (b_stack_count(ret) == 0 && string->str[0] == '/') {
6985 13260 if (b_stack_count(ret) == 0 && string->str[0] == '/') {
51 0 30820 if ((item_copy = b_string_new(item)) == NULL) {
55 0 30820 if (b_stack_push(ret, item_copy) == NULL) {
65 0 20245 if (b_stack_count(ret) == 0 && string->str[0] == '/') {
0 0 if (b_stack_count(ret) == 0 && string->str[0] == '/') {
66 0 0 if (b_stack_push(ret, b_string_new("/")) == NULL) {
91 0 13176 if ((parts = b_path_new(string)) == NULL) {
95 0 13176 if ((ret = b_string_join("/", parts)) == NULL) {
114 0 0 if ((tmp = b_string_new(str)) == NULL) {
118 0 0 if ((ret = b_path_clean(tmp)) == NULL) {