diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-06-18 12:31:03 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-06-18 12:31:03 -0400 |
commit | 8a96a85d66328ba0088b9d9999771ff863cc0e60 (patch) | |
tree | 2250001ff217ad0ca200bccf306ade9483fb8f52 /src/test/test_config.c | |
parent | 459c7c0e41f8c35c95e6012febb7e0456cce674a (diff) | |
download | tor-8a96a85d66328ba0088b9d9999771ff863cc0e60.tar.gz tor-8a96a85d66328ba0088b9d9999771ff863cc0e60.zip |
Check more return values in the unit tests
Diffstat (limited to 'src/test/test_config.c')
-rw-r--r-- | src/test/test_config.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/test_config.c b/src/test/test_config.c index ad30cdf78f..4e9e13e474 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -202,9 +202,9 @@ test_config_check_or_create_data_subdir(void *arg) (void)arg; #if defined (_WIN32) && !defined (WINCE) - mkdir(options->DataDirectory); + tt_int_op(mkdir(options->DataDirectory), ==, 0); #else - mkdir(options->DataDirectory, 0700); + tt_int_op(mkdir(options->DataDirectory, 0700), ==, 0); #endif r = stat(subpath, &st); @@ -266,14 +266,14 @@ test_config_write_to_data_subdir(void *arg) (void)arg; #if defined (_WIN32) && !defined (WINCE) - mkdir(options->DataDirectory); + tt_int_op(mkdir(options->DataDirectory), ==, 0); #else - mkdir(options->DataDirectory, 0700); + tt_int_op(mkdir(options->DataDirectory, 0700), ==, 0); #endif // Write attempt shoudl fail, if subdirectory doesn't exist. test_assert(write_to_data_subdir(subdir, fname, str, NULL)); - check_or_create_data_subdir(subdir); + test_assert(! check_or_create_data_subdir(subdir)); // Content of file after write attempt should be // equal to the original string. @@ -285,7 +285,7 @@ test_config_write_to_data_subdir(void *arg) test_streq(read_file_to_str(filepath, 0, NULL), str); done: - remove(filepath); + (void) unlink(filepath); rmdir(options->DataDirectory); tor_free(datadir); tor_free(filepath); |