[PATCH] kernel32/tests/fiber: Add tests for fiber-local storage.

Nikolay Sivov bunglehead at gmail.com
Sun Jul 10 12:38:30 CDT 2016


On 10.07.2016 20:31, André Hentschel wrote:
> Hi,
> 
> comments inline
> 
> Am 08.07.2016 um 00:16 schrieb John Sheu:
>> +static void test_FiberLocalStorageCallback(PFLS_CALLBACK_FUNCTION cbfunc) {
>> +    DWORD fls;
>> +    BOOL ret;
>> +    PVOID val, val2;
>> +
>> +    if (!pFlsAlloc || !pFlsSetValue || !pFlsGetValue || !pFlsFree)
>> +    {
>> +        win_skip( "Fiber Local Storage not supported\n" );
>> +        return;
>> +    }
>> +
>> +    /* Test that the callback is executed */
>> +    SetLastError( 0xdeadbeef );
>> +    cbCount = 0;
>> +    fls = pFlsAlloc( cbfunc );
>> +    ok( fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %u\n", GetLastError() );
>> +
>> +    SetLastError( 0xdeadbeef );
>> +    val = (PVOID) 0x1587;
>> +    fls_value_to_set = val;
>> +    ret = pFlsSetValue( fls, val );
>> +    ok(ret, "FlsSetValue failed with error %u\n", GetLastError() );
>> +
>> +    val2 = pFlsGetValue( fls );
>> +    ok(val == val2, "FlsGetValue returned %p, expected %p\n", val2, val);
>> +
>> +    SetLastError( 0xdeadbeef );
>> +    ret = pFlsFree( fls );
>> +    ok(ret, "FlsFree failed with error %u\n", GetLastError() );
>> +    todo_wine
>> +    {
>> +        ok( cbCount == 1, "Wrong callback count: %d\n", cbCount );
>> +    }
> 
> 
> Please make those one-liners, like
> todo_wine ok(...);
> and the patch should be fine then

How is this a stopper?

> 
> 
>> +
>> +    /* Test that callback is not executed if value is NULL */
>> +    SetLastError( 0xdeadbeef );
>> +    cbCount = 0;
>> +    fls = pFlsAlloc( cbfunc );
>> +    ok( fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %u\n", GetLastError() );
>> +
>> +    SetLastError( 0xdeadbeef );
>> +    ret = pFlsSetValue( fls, NULL );
>> +    ok( ret, "FlsSetValue failed with error %u\n", GetLastError() );
>> +
>> +    SetLastError( 0xdeadbeef );
>> +    pFlsFree( fls );
>> +    ok( ret, "FlsFree failed with error %u\n", GetLastError() );
>> +    ok( cbCount == 0, "Wrong callback count: %d\n", cbCount );
>> +}
> 
> 
> 




More information about the wine-devel mailing list