1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-29 13:01:13 +03:00

tests: Fixed torture_get_user_home_dir on Windows.

This commit is contained in:
Andreas Schneider
2010-12-29 20:35:55 +01:00
parent f3a6c3152c
commit 13f3679b2f

View File

@ -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);
}