aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/fish_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fish_tests.cpp')
-rw-r--r--src/fish_tests.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp
index d2b1e23e..8d44cce1 100644
--- a/src/fish_tests.cpp
+++ b/src/fish_tests.cpp
@@ -2037,7 +2037,11 @@ static void test_complete(void)
/* File completions */
char saved_wd[PATH_MAX + 1] = {};
- (void)getcwd(saved_wd, sizeof saved_wd);
+ if (!getcwd(saved_wd, sizeof saved_wd))
+ {
+ perror("getcwd");
+ exit(-1);
+ }
if (system("mkdir -p '/tmp/complete_test/'")) err(L"mkdir failed");
if (system("touch '/tmp/complete_test/testfile'")) err(L"touch failed");
if (chdir("/tmp/complete_test/")) err(L"chdir failed");
@@ -3891,7 +3895,11 @@ int main(int argc, char **argv)
while (access("./tests/test.fish", F_OK) != 0)
{
char wd[PATH_MAX + 1] = {};
- (void)getcwd(wd, sizeof wd);
+ if (!getcwd(wd, sizeof wd))
+ {
+ perror("getcwd");
+ exit(-1);
+ }
if (! strcmp(wd, "/"))
{
fprintf(stderr, "Unable to find 'tests' directory, which should contain file test.fish\n");