Skip to content
Snippets Groups Projects
Commit c522fedf authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard
Browse files

sapi: Add a partial implementation of SpObjectTokenEnum::Next().

parent 211f2c7b
No related branches found
No related tags found
No related merge requests found
......@@ -49,9 +49,43 @@ static void test_data_key(void)
ISpRegDataKey_Release( data_key );
}
static void test_token_enum(void)
{
ISpObjectTokenEnumBuilder *token_enum;
HRESULT hr;
ISpObjectToken *token;
ULONG count;
hr = CoCreateInstance( &CLSID_SpObjectTokenEnum, NULL, CLSCTX_INPROC_SERVER,
&IID_ISpObjectTokenEnumBuilder, (void **)&token_enum );
ok( hr == S_OK, "got %08x\n", hr );
hr = ISpObjectTokenEnumBuilder_GetCount( token_enum, &count );
ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr );
hr = ISpObjectTokenEnumBuilder_Next( token_enum, 1, &token, &count );
ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr );
hr = ISpObjectTokenEnumBuilder_SetAttribs( token_enum, NULL, NULL );
ok( hr == S_OK, "got %08x\n", hr );
count = 0xdeadbeef;
hr = ISpObjectTokenEnumBuilder_GetCount( token_enum, &count );
ok( hr == S_OK, "got %08x\n", hr );
ok( count == 0, "got %u\n", count );
count = 0xdeadbeef;
hr = ISpObjectTokenEnumBuilder_Next( token_enum, 1, &token, &count );
ok( hr == S_FALSE, "got %08x\n", hr );
ok( count == 0, "got %u\n", count );
ISpObjectTokenEnumBuilder_Release( token_enum );
}
START_TEST(token)
{
CoInitialize( NULL );
test_data_key();
test_token_enum();
CoUninitialize();
}
......@@ -293,8 +293,16 @@ static HRESULT WINAPI token_enum_Next( ISpObjectTokenEnumBuilder *iface,
ULONG num, ISpObjectToken **tokens,
ULONG *fetched )
{
FIXME( "stub\n" );
return E_NOTIMPL;
struct token_enum *This = impl_from_ISpObjectTokenEnumBuilder( iface );
TRACE( "(%p)->(%u %p %p)\n", This, num, tokens, fetched );
if (!This->init) return SPERR_UNINITIALIZED;
FIXME( "semi-stub: Returning an empty enumerator\n" );
if (fetched) *fetched = 0;
return S_FALSE;
}
static HRESULT WINAPI token_enum_Skip( ISpObjectTokenEnumBuilder *iface,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment