root.path[0] == L'%') /* i.e. no expansion happened */
{
giterr_set(GITERR_OS, "Cannot locate the user's profile directory");
- return -1;
+ return GIT_ENOTFOUND;
}
} else {
if (win32_expand_path(&root, L"%USERPROFILE%\\") < 0 ||
root.path[0] == L'%') /* i.e. no expansion happened */
{
giterr_set(GITERR_OS, "Cannot locate the user's profile directory");
- return -1;
+ return GIT_ENOTFOUND;
}
}
if (home == NULL) {
giterr_set(GITERR_OS, "Global file lookup failed. "
"Cannot locate the user's home directory");
- return -1;
+ return GIT_ENOTFOUND;
}
if (git_buf_joinpath(path, home, filename) < 0)
{
git_buf path = GIT_BUF_INIT;
- cl_assert(git_futils_find_global_file(&path, "nonexistentfile") == GIT_ENOTFOUND);
+ cl_must_fail(git_futils_find_global_file(&path, "nonexistentfile"));
#ifdef GIT_WIN32
cl_git_pass(cl_setenv("USERPROFILE", "doesnotexist"));
cl_git_pass(cl_setenv("HOME", "doesnotexist"));
#endif
- cl_assert(git_futils_find_global_file(&path, "nonexistentfile") == GIT_ENOTFOUND);
+ cl_must_fail(git_futils_find_global_file(&path, "nonexistentfile"));
#ifdef GIT_WIN32
cl_git_pass(cl_setenv("USERPROFILE", NULL));
cl_git_pass(cl_setenv("HOME", NULL));
#endif
- cl_assert(git_futils_find_global_file(&path, "nonexistentfile") == -1);
-
- cl_assert(git_futils_find_system_file(&path, "nonexistentfile") == GIT_ENOTFOUND);
+ cl_must_fail(git_futils_find_global_file(&path, "nonexistentfile"));
+ cl_must_fail(git_futils_find_system_file(&path, "nonexistentfile"));
#ifdef GIT_WIN32
cl_git_pass(cl_setenv("PROGRAMFILES", NULL));
-
- cl_assert(git_futils_find_system_file(&path, "nonexistentfile") == -1);
+ cl_must_fail(git_futils_find_system_file(&path, "nonexistentfile"));
#endif
git_buf_free(&path);