From d14e76806921f9a4d686ea731364242ededb735d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Apr 2020 12:02:21 +1000 Subject: Cleanup: BLI_path.h function renaming Use BLI_path_ prefix, more consistent names: BLI_parent_dir -> BLI_path_parent_dir BLI_parent_dir_until_exists -> BLI_path_parent_dir_until_exists BLI_ensure_filename -> BLI_path_filename_ensure BLI_first_slash -> BLI_path_slash_find BLI_last_slash -> BLI_path_slash_rfind BLI_add_slash -> BLI_path_slash_ensure BLI_del_slash -> BLI_path_slash_rstrip BLI_path_native_slash -> BLI_path_slash_native Rename 'cleanup' to 'normalize', similar to Python's `os.path.normpath`. BLI_cleanup_path -> BLI_path_normalize BLI_cleanup_dir -> BLI_path_normalize_dir BLI_cleanup_unc -> BLI_path_normalize_unc BLI_cleanup_unc16 -> BLI_path_normalize_unc16 Clarify naming for extracting, creating numbered paths: BLI_stringenc -> BLI_path_sequence_encode BLI_stringdec -> BLI_path_sequence_decode Part of T74506 proposal. --- tests/gtests/blenlib/BLI_path_util_test.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/gtests') diff --git a/tests/gtests/blenlib/BLI_path_util_test.cc b/tests/gtests/blenlib/BLI_path_util_test.cc index 18d7a9c4fea..480d48d6080 100644 --- a/tests/gtests/blenlib/BLI_path_util_test.cc +++ b/tests/gtests/blenlib/BLI_path_util_test.cc @@ -58,59 +58,59 @@ char *zLhm65070058860608_br_find_exe(const char *default_exe) /* -------------------------------------------------------------------- */ /* tests */ -/* BLI_cleanup_path */ +/* BLI_path_normalize */ #ifndef _WIN32 TEST(path_util, Clean) { /* "/./" -> "/" */ { char path[FILE_MAX] = "/a/./b/./c/./"; - BLI_cleanup_path(NULL, path); + BLI_path_normalize(NULL, path); EXPECT_STREQ("/a/b/c/", path); } { char path[FILE_MAX] = "/./././"; - BLI_cleanup_path(NULL, path); + BLI_path_normalize(NULL, path); EXPECT_STREQ("/", path); } { char path[FILE_MAX] = "/a/./././b/"; - BLI_cleanup_path(NULL, path); + BLI_path_normalize(NULL, path); EXPECT_STREQ("/a/b/", path); } /* "//" -> "/" */ { char path[FILE_MAX] = "a////"; - BLI_cleanup_path(NULL, path); + BLI_path_normalize(NULL, path); EXPECT_STREQ("a/", path); } if (0) /* FIXME */ { char path[FILE_MAX] = "./a////"; - BLI_cleanup_path(NULL, path); + BLI_path_normalize(NULL, path); EXPECT_STREQ("./a/", path); } /* "foo/bar/../" -> "foo/" */ { char path[FILE_MAX] = "/a/b/c/../../../"; - BLI_cleanup_path(NULL, path); + BLI_path_normalize(NULL, path); EXPECT_STREQ("/", path); } { char path[FILE_MAX] = "/a/../a/b/../b/c/../c/"; - BLI_cleanup_path(NULL, path); + BLI_path_normalize(NULL, path); EXPECT_STREQ("/a/b/c/", path); } { char path[FILE_MAX] = "//../"; - BLI_cleanup_path("/a/b/c/", path); + BLI_path_normalize("/a/b/c/", path); EXPECT_STREQ("/a/b/", path); } } -- cgit v1.2.3