{ "..", "..", "" },
{ "./", ".", "/" },
{ ".", ".", "" },
+ { "/../a/b/c/d/e", "", "/a/b/c/d/e" },
+ { "/a/b/c/d/../../../../../e", "", "/e" },
};
char **valid_tests_expected_results;
static const int num_valid_tests =
/* Invalid test cases */
static char *invalid_tests_inputs[] = {
NULL,
- "/../a/b/c/d/e",
- "/a/b/c/d/../../../../../e",
};
static const int num_invalid_tests =
sizeof(invalid_tests_inputs) / sizeof(invalid_tests_inputs[0]);
sprintf(name, "valid test case: %s", valid_tests_inputs[i].input);
result = utils_expand_path(valid_tests_inputs[i].input);
- ok(strcmp(result, valid_tests_expected_results[i]) == 0, name);
+ ok(result != NULL &&
+ strcmp(result, valid_tests_expected_results[i]) == 0, name);
free(result);
}