diff options
author | Sumit Bose <sbose@redhat.com> | 2010-09-24 10:31:22 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-09-28 13:36:12 -0400 |
commit | 5d395f5cecf4be9d9ebebb51515ad4e590dcc630 (patch) | |
tree | 4b04c99b0f8909be41a9b4119265b9d8e7d7f958 /src/tests | |
parent | f7fa22da5d865221f84371d6b522444e1591164c (diff) | |
download | sssd-5d395f5cecf4be9d9ebebb51515ad4e590dcc630.tar.gz sssd-5d395f5cecf4be9d9ebebb51515ad4e590dcc630.tar.xz sssd-5d395f5cecf4be9d9ebebb51515ad4e590dcc630.zip |
Suppress some 'unchecked return value' warnings
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/files-tests.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/tests/files-tests.c b/src/tests/files-tests.c index 2267a6034..bd2de545d 100644 --- a/src/tests/files-tests.c +++ b/src/tests/files-tests.c @@ -57,15 +57,22 @@ static void setup_files_test(void) static void teardown_files_test(void) { char *cmd = NULL; + int ret; /* OK this is crude but since the functions to remove tree are under test.. */ if (dir_path && test_ctx) { cmd = talloc_asprintf(test_ctx, "/bin/rm -rf %s\n", dir_path); - system(cmd); + ret = system(cmd); + if (ret == -1) { + DEBUG(1, ("Removing [%s] failed.\n", dir_path)); + } } if (dst_path && test_ctx) { cmd = talloc_asprintf(test_ctx, "/bin/rm -rf %s\n", dst_path); - system(cmd); + ret = system(cmd); + if (ret == -1) { + DEBUG(1, ("Removing [%s] failed.\n", dst_path)); + } } /* clean up */ @@ -99,7 +106,7 @@ START_TEST(test_remove_tree) char origpath[PATH_MAX+1]; errno = 0; - getcwd(origpath, PATH_MAX); + fail_unless(getcwd(origpath, PATH_MAX) == origpath, "Cannot getcwd\n"); fail_unless(errno == 0, "Cannot getcwd\n"); DEBUG(5, ("About to delete %s\n", dir_path)); @@ -150,7 +157,7 @@ START_TEST(test_simple_copy) int fd = -1; errno = 0; - getcwd(origpath, PATH_MAX); + fail_unless(getcwd(origpath, PATH_MAX) == origpath, "Cannot getcwd\n"); fail_unless(errno == 0, "Cannot getcwd\n"); /* create a file */ @@ -199,7 +206,7 @@ START_TEST(test_copy_symlink) struct stat statbuf; errno = 0; - getcwd(origpath, PATH_MAX); + fail_unless(getcwd(origpath, PATH_MAX) == origpath, "Cannot getcwd\n"); fail_unless(errno == 0, "Cannot getcwd\n"); /* create a subdir */ @@ -241,7 +248,7 @@ START_TEST(test_copy_node) struct stat statbuf; errno = 0; - getcwd(origpath, PATH_MAX); + fail_unless(getcwd(origpath, PATH_MAX) == origpath, "Cannot getcwd\n"); fail_unless(errno == 0, "Cannot getcwd\n"); /* create a node */ |