| 196 str = util_path_normalize(".."); |
196 str = util_path_normalize(".."); |
| 197 CX_TEST_ASSERT(!strcmp(str, "")); |
197 CX_TEST_ASSERT(!strcmp(str, "")); |
| 198 free(str); |
198 free(str); |
| 199 } |
199 } |
| 200 } |
200 } |
| |
201 |
| |
202 CX_TEST(test_util_parent_path) { |
| |
203 CX_TEST_DO { |
| |
204 char *parent = util_parent_path("/hello"); |
| |
205 CX_TEST_ASSERT(!cx_strcmp(parent, "/")); |
| |
206 free(parent); |
| |
207 |
| |
208 parent = util_parent_path("/"); |
| |
209 CX_TEST_ASSERT(!cx_strcmp(parent, "")); |
| |
210 free(parent); |
| |
211 |
| |
212 parent = util_parent_path("/long/path/123/4567890/test/"); |
| |
213 CX_TEST_ASSERT(!cx_strcmp(parent, "/long/path/123/4567890/")); |
| |
214 free(parent); |
| |
215 |
| |
216 parent = util_parent_path("/long/path/123/4567890/test"); |
| |
217 CX_TEST_ASSERT(!cx_strcmp(parent, "/long/path/123/4567890/")); |
| |
218 free(parent); |
| |
219 } |
| |
220 } |