[NTDSAPI_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536

svn path=/trunk/; revision=69973
This commit is contained in:
Amine Khaldi 2015-11-21 09:22:06 +00:00
parent cc6dbe9490
commit a7803a245b

View file

@ -84,7 +84,38 @@ static void test_DsMakeSpn(void)
ok(spn_length == lstrlenW(wszSpn5) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn5) + 1, spn_length);
}
static void test_DsClientMakeSpnForTargetServer(void)
{
static const WCHAR classW[] = {'c','l','a','s','s',0};
static const WCHAR hostW[] = {'h','o','s','t','.','d','o','m','a','i','n',0};
static const WCHAR resultW[] = {'c','l','a','s','s','/','h','o','s','t','.','d','o','m','a','i','n',0};
DWORD ret, len;
WCHAR buf[256];
ret = DsClientMakeSpnForTargetServerW( NULL, NULL, NULL, NULL );
ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret );
ret = DsClientMakeSpnForTargetServerW( classW, NULL, NULL, NULL );
ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret );
ret = DsClientMakeSpnForTargetServerW( classW, hostW, NULL, NULL );
ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret );
len = 0;
ret = DsClientMakeSpnForTargetServerW( classW, hostW, &len, NULL );
ok( ret == ERROR_BUFFER_OVERFLOW, "got %u\n", ret );
ok( len == lstrlenW(resultW) + 1, "got %u\n", len );
len = sizeof(buf)/sizeof(buf[0]);
buf[0] = 0;
ret = DsClientMakeSpnForTargetServerW( classW, hostW, &len, buf );
ok( ret == ERROR_SUCCESS, "got %u\n", ret );
ok( len == lstrlenW(resultW) + 1, "got %u\n", len );
ok( !lstrcmpW( buf, resultW ), "wrong data\n" );
}
START_TEST( ntdsapi )
{
test_DsMakeSpn();
test_DsClientMakeSpnForTargetServer();
}