advapi32 registry.c test failures on windows

James Hawkins truiken at gmail.com
Mon Mar 7 15:30:54 CST 2005


On Mon, 7 Mar 2005 00:28:13 -0800 (PST), Aaron Arvey <aarvey at cs.hmc.edu> wrote:
> There were 28 failures when I ran the advapi32 tests on windows. All these
> were in registry.c.  Please see
> http://www.winehq.org/hypermail/wine-devel/2005/02/0045.html and the
> following responses to find out where/when/why/how these bugs were
> introduced.
> 
> After patch is applied, the registry.c runs without errors on Windows XP
> and 98. When ran in wine, there are now 28 todos.
> 
> Aaron
> 
> Changelog:
>   * dlls/advapi32/tests/registry.c
>     altered tests so that they run under windows
> 
> Signed-off-by: Aaron Arvey <aarvey_at_cs.hmc.edu>
> 
> Index:  dlls/advapi32/tests/registry.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/advapi32/tests/registry.c,v
> retrieving revision 1.11
> diff -u -3 -p -u -r1.11 registry.c
> ---  dlls/advapi32/tests/registry.c     27 Jan 2005 11:15:00 -0000   1.11
> +++  dlls/advapi32/tests/registry.c     17 Feb 2005 04:00:13 -0000
> @@ -80,6 +80,7 @@ static void test_enum_value(void)
>     DWORD val_count, data_count, type;
>     static const WCHAR foobarW[] = {'f','o','o','b','a','r',0};
>     static const WCHAR testW[] = {'T','e','s','t',0};
> +    static const WCHAR test1W[] = {'T','e','s','t','1',0};
>     static const WCHAR xxxW[] = {'x','x','x','x','x','x','x','x',0};
> 
>     /* check NULL data with zero length */
> @@ -105,8 +106,12 @@ static void test_enum_value(void)
>     res = RegEnumValueA( hkey_main, 0, value, &val_count, NULL, &type, data, &data_count );
>     ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res );
>     ok( val_count == 2, "val_count set to %ld\n", val_count );
> -    ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count );
> -    ok( type == REG_SZ, "type %ld is not REG_SZ\n", type );
> +    todo_wine{
> +    ok( data_count == 24, "data_count set to %ld instead of 24\n", data_count );
> +    }
> +    todo_wine{
> +    ok( type == REG_EXPAND_SZ, "type %ld is not REG_EXPAND_SZ\n", type );
> +    }
>     ok( !strcmp( value, "xxxxxxxxxx" ), "value set to '%s'\n", value );
>     ok( !strcmp( data, "xxxxxxxxxx" ), "data set to '%s'\n", data );
> 
> @@ -120,8 +125,12 @@ static void test_enum_value(void)
>     ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res );
>     /* Win9x returns 2 as specified by MSDN but NT returns 3... */
>     ok( val_count == 2 || val_count == 3, "val_count set to %ld\n", val_count );
> -    ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count );
> -    ok( type == REG_SZ, "type %ld is not REG_SZ\n", type );
> +    todo_wine{
> +    ok( data_count == 24, "data_count set to %ld instead of 24\n", data_count );
> +    }
> +    todo_wine{
> +    ok( type == REG_EXPAND_SZ, "type %ld is not REG_EXPAND_SZ\n", type );
> +    }
> #if 0
>     /* v5.1.2600.0 (XP Home) does not touch value or data in this case */
>     ok( !strcmp( value, "Te" ), "value set to '%s' instead of 'Te'\n", value );
> @@ -137,8 +146,12 @@ static void test_enum_value(void)
>     res = RegEnumValueA( hkey_main, 0, value, &val_count, NULL, &type, data, &data_count );
>     ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res );
>     ok( val_count == 0, "val_count set to %ld\n", val_count );
> -    ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count );
> -    ok( type == REG_SZ, "type %ld is not REG_SZ\n", type );
> +    todo_wine{
> +    ok( data_count == 24, "data_count set to %ld instead of 24\n", data_count );
> +    }
> +    todo_wine{
> +    ok( type == REG_EXPAND_SZ, "type %ld is not REG_EXPAND_SZ\n", type );
> +    }
>     ok( !strcmp( value, "xxxxxxxxxx" ), "value set to '%s'\n", value );
> #if 0
>     /* v5.1.2600.0 (XP Home) does not touch data in this case */
> @@ -154,8 +167,12 @@ static void test_enum_value(void)
>     res = RegEnumValueA( hkey_main, 0, value, &val_count, NULL, &type, data, &data_count );
>     ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res );
>     ok( val_count == 20, "val_count set to %ld\n", val_count );
> -    ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count );
> -    ok( type == REG_SZ, "type %ld is not REG_SZ\n", type );
> +    todo_wine{
> +    ok( data_count == 24, "data_count set to %ld instead of 24\n", data_count );
> +    }
> +    todo_wine{
> +    ok( type == REG_EXPAND_SZ, "type %ld is not REG_EXPAND_SZ\n", type );
> +    }
>     ok( !strcmp( value, "xxxxxxxxxx" ), "value set to '%s'\n", value );
>     ok( !strcmp( data, "xxxxxxxxxx" ), "data set to '%s'\n", data );
> 
> @@ -166,12 +183,25 @@ static void test_enum_value(void)
>     strcpy( value, "xxxxxxxxxx" );
>     strcpy( data, "xxxxxxxxxx" );
>     res = RegEnumValueA( hkey_main, 0, value, &val_count, NULL, &type, data, &data_count );
> -    ok( res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", res );
> -    ok( val_count == 4, "val_count set to %ld instead of 4\n", val_count );
> -    ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count );
> -    ok( type == REG_SZ, "type %ld is not REG_SZ\n", type );
> -    ok( !strcmp( value, "Test" ), "value is '%s' instead of Test\n", value );
> -    ok( !strcmp( data, "foobar" ), "data is '%s' instead of foobar\n", data );
> +    todo_wine{
> +    ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res );
> +    }
> +    todo_wine{
> +    ok( val_count == 20, "val_count set to %ld instead of 20\n", val_count );
> +    }
> +    todo_wine{
> +    ok( data_count == 24, "data_count set to %ld instead of 24\n", data_count );
> +    }
> +    todo_wine{
> +    ok( type == REG_EXPAND_SZ, "type %ld is not REG_EXPAND_SZ\n", type );
> +    }
> +    todo_wine{
> +    ok( !strcmp( value, "xxxxxxxxxx" ), "value is '%s' instead of xxxxxxxxxx\n", value );
> +    }
> +    todo_wine{
> +    ok( !strcmp( data, "xxxxxxxxxx" ), "data is '%s' instead of xxxxxxxxxx\n", data );
> +    }
> +
> 
>     /* Unicode tests */
> 
> @@ -190,8 +220,12 @@ static void test_enum_value(void)
>     res = RegEnumValueW( hkey_main, 0, valueW, &val_count, NULL, &type, (BYTE*)dataW, &data_count );
>     ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res );
>     ok( val_count == 2, "val_count set to %ld\n", val_count );
> -    ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)\n", data_count );
> -    ok( type == REG_SZ, "type %ld is not REG_SZ\n", type );
> +    todo_wine{
> +    ok( data_count == 24*sizeof(WCHAR), "data_count set to %ld instead of 24*sizeof(WCHAR)\n", data_count );
> +    }
> +    todo_wine{
> +    ok( type == REG_EXPAND_SZ, "type %ld is not REG_EXPAND_SZ\n", type );
> +    }
>     ok( !memcmp( valueW, xxxW, sizeof(xxxW) ), "value modified\n" );
>     ok( !memcmp( dataW, xxxW, sizeof(xxxW) ), "data modified\n" );
> 
> @@ -204,8 +238,12 @@ static void test_enum_value(void)
>     res = RegEnumValueW( hkey_main, 0, valueW, &val_count, NULL, &type, (BYTE*)dataW, &data_count );
>     ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res );
>     ok( val_count == 3, "val_count set to %ld\n", val_count );
> -    ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)\n", data_count );
> -    ok( type == REG_SZ, "type %ld is not REG_SZ\n", type );
> +    todo_wine{
> +    ok( data_count == 24*sizeof(WCHAR), "data_count set to %ld instead of 24*sizeof(WCHAR)\n", data_count );
> +    }
> +    todo_wine{
> +    ok( type == REG_EXPAND_SZ, "type %ld is not REG_EXPAND_SZ\n", type );
> +    }
>     ok( !memcmp( valueW, xxxW, sizeof(xxxW) ), "value modified\n" );
>     ok( !memcmp( dataW, xxxW, sizeof(xxxW) ), "data modified\n" );
> 
> @@ -217,10 +255,18 @@ static void test_enum_value(void)
>     memcpy( dataW, xxxW, sizeof(xxxW) );
>     res = RegEnumValueW( hkey_main, 0, valueW, &val_count, NULL, &type, (BYTE*)dataW, &data_count );
>     ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res );
> -    ok( val_count == 4, "val_count set to %ld instead of 4\n", val_count );
> -    ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)\n", data_count );
> -    ok( type == REG_SZ, "type %ld is not REG_SZ\n", type );
> -    ok( !memcmp( valueW, testW, sizeof(testW) ), "value is not 'Test'\n" );
> +    todo_wine{
> +    ok( val_count == 5, "val_count set to %ld instead of 5\n", val_count );
> +    }
> +    todo_wine{
> +    ok( data_count == 24*sizeof(WCHAR), "data_count set to %ld instead of 24*sizeof(WCHAR)\n", data_count );
> +    }
> +    todo_wine{
> +    ok( type == REG_EXPAND_SZ, "type %ld is not REG_EXPAND_SZ\n", type );
> +    }
> +    todo_wine{
> +    ok( !memcmp( valueW, test1W, sizeof(test1W) ), "value is not 'Test1'\n" );
> +    }
>     ok( !memcmp( dataW, xxxW, sizeof(xxxW) ), "data modified\n" );
> 
>     /* no overflow */
> @@ -230,12 +276,25 @@ static void test_enum_value(void)
>     memcpy( valueW, xxxW, sizeof(xxxW) );
>     memcpy( dataW, xxxW, sizeof(xxxW) );
>     res = RegEnumValueW( hkey_main, 0, valueW, &val_count, NULL, &type, (BYTE*)dataW, &data_count );
> -    ok( res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", res );
> -    ok( val_count == 4, "val_count set to %ld instead of 4\n", val_count );
> -    ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)\n", data_count );
> -    ok( type == REG_SZ, "type %ld is not REG_SZ\n", type );
> -    ok( !memcmp( valueW, testW, sizeof(testW) ), "value is not 'Test'\n" );
> -    ok( !memcmp( dataW, foobarW, sizeof(foobarW) ), "data is not 'foobar'\n" );
> +    todo_wine{
> +    ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res );
> +    }
> +    todo_wine{
> +    ok( val_count == 5, "val_count set to %ld instead of 5\n", val_count );
> +    }
> +    todo_wine{
> +    ok( data_count == 24*sizeof(WCHAR), "data_count set to %ld instead of 24*sizeof(WCHAR)\n", data_count );
> +    }
> +    todo_wine{
> +    ok( type == REG_EXPAND_SZ, "type %ld is not REG_EXPAND_SZ\n", type );
> +    }
> +    todo_wine{
> +    ok( !memcmp( valueW, test1W, sizeof(test1W) ), "value is not 'Test1'\n" );
> +    }
> +    todo_wine{
> +    ok( !memcmp( dataW, xxxW, sizeof(xxxW) ), "data modified\n" );
> +    }
> +
> 
> CLEANUP:
>     /* cleanup */
> @@ -252,6 +311,12 @@ static void test_query_value_ex()
>     ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
>     ok(size == strlen(sTestpath1) + 1, "(%ld,%ld)\n", (DWORD)strlen(sTestpath1) + 1, size);
>     ok(type == REG_SZ, "type %ld is not REG_SZ\n", type);
> +
> +
> +
> +    ret = RegQueryValueExA(hkey_main, "TestStringNotIn", NULL, &type, NULL, &size);
> +    ok(ret == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %ld\n", ret);
> +
> }
> 
> START_TEST(registry)

It would help wine if you could make these tests pass on wine.  Also,
have a look at the test results at test.winehq.org/data.  I see that
26 of the tests fail on 95, 24 fail on 98, and 28 for >= nt4.  If you
have any questions fixing the reg tests, I'd be glad to help.  Make
sure to cc wine-devel.

-- 
James Hawkins



More information about the wine-devel mailing list