aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-12-29 20:35:55 +0100
committerAndreas Schneider <asn@cynapses.org>2010-12-29 20:35:55 +0100
commit13f3679b2f81da19b3aad730eea5db864e432be5 (patch)
treeda7e2c0f1ab0f1302560de54e776598e822dc7e9 /tests
parentf3a6c3152cbe58d2867e26133841b9987aee4314 (diff)
downloadlibssh-13f3679b2f81da19b3aad730eea5db864e432be5.tar.gz
libssh-13f3679b2f81da19b3aad730eea5db864e432be5.tar.xz
libssh-13f3679b2f81da19b3aad730eea5db864e432be5.zip
tests: Fixed torture_get_user_home_dir on Windows.
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/torture_misc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/unittests/torture_misc.c b/tests/unittests/torture_misc.c
index 4e6e6608..70f4b5ac 100644
--- a/tests/unittests/torture_misc.c
+++ b/tests/unittests/torture_misc.c
@@ -1,5 +1,7 @@
#include <sys/types.h>
+#ifndef _WIN32
#include <pwd.h>
+#endif
#define LIBSSH_STATIC
#include <libssh/priv.h>
@@ -19,15 +21,18 @@ static void teardown(void **state) {
}
static void torture_get_user_home_dir(void **state) {
- struct passwd *pwd;
+#ifndef _WIN32
+ struct passwd *pwd = getpwuid(getuid());
+#endif /* _WIN32 */
char *user;
(void) state;
- pwd = getpwuid(getuid());
-
user = ssh_get_user_home_dir();
+ assert_false(user == NULL);
+#ifndef _WIN32
assert_string_equal(user, pwd->pw_dir);
+#endif /* _WIN32 */
SAFE_FREE(user);
}