aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hs.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2016-11-02 11:37:05 +1100
committerteor <teor2345@gmail.com>2016-11-02 11:37:11 +1100
commitfedafe7c0eb9eda0d11dd1b5ba37b7faff625c88 (patch)
tree96cf9f546bacde5f62599a550457658fbf1339b0 /src/test/test_hs.c
parent6c541815592b76ecb7dc639123bce894bf47b67f (diff)
downloadtor-fedafe7c0eb9eda0d11dd1b5ba37b7faff625c88.tar.gz
tor-fedafe7c0eb9eda0d11dd1b5ba37b7faff625c88.zip
Use check_private_dir in test_single_onion_poisoning
This avoids Win32 conditionals for mkdir.
Diffstat (limited to 'src/test/test_hs.c')
-rw-r--r--src/test/test_hs.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/test/test_hs.c b/src/test/test_hs.c
index fd5ab15643..39a2c914ab 100644
--- a/src/test/test_hs.c
+++ b/src/test/test_hs.c
@@ -550,20 +550,11 @@ test_single_onion_poisoning(void *arg)
tt_assert(ret == 0);
/* Create directories for both services */
-
-#ifdef _WIN32
- ret = mkdir(mock_options->DataDirectory);
- tt_assert(ret == 0);
- ret = mkdir(dir1);
- tt_assert(ret == 0);
- ret = mkdir(dir2);
-#else
- ret = mkdir(mock_options->DataDirectory, 0700);
+ ret = check_private_dir(mock_options->DataDirectory, CPD_CREATE, NULL);
tt_assert(ret == 0);
- ret = mkdir(dir1, 0700);
+ ret = check_private_dir(dir1, CPD_CREATE, NULL);
tt_assert(ret == 0);
- ret = mkdir(dir2, 0700);
-#endif
+ ret = check_private_dir(dir2, CPD_CREATE, NULL);
tt_assert(ret == 0);
service_1->directory = dir1;
@@ -694,7 +685,7 @@ test_single_onion_poisoning(void *arg)
tt_assert(ret < 0);
done:
- /* TODO: should we delete the directories here? */
+ /* The test harness deletes the directories at exit */
rend_service_free(service_1);
rend_service_free(service_2);
smartlist_free(services);