mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
msi/tests: Avoid ARRAY_SIZE-like macros.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cf349cea69
commit
74b0dec3c1
3 changed files with 5 additions and 15 deletions
|
@ -3033,8 +3033,6 @@ static const struct {
|
|||
{ name9, data9, sizeof data9 },
|
||||
};
|
||||
|
||||
#define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
|
||||
|
||||
static void generate_transform_manual(void)
|
||||
{
|
||||
IStorage *stg = NULL;
|
||||
|
@ -3056,7 +3054,7 @@ static void generate_transform_manual(void)
|
|||
r = IStorage_SetClass( stg, &CLSID_MsiTransform );
|
||||
ok(r == S_OK, "failed to set storage type\n");
|
||||
|
||||
for (i=0; i<NUM_TRANSFORM_TABLES; i++)
|
||||
for (i=0; i<ARRAY_SIZE(table_transform_data); i++)
|
||||
{
|
||||
r = IStorage_CreateStream( stg, table_transform_data[i].name,
|
||||
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm );
|
||||
|
|
|
@ -3671,8 +3671,6 @@ static const struct {
|
|||
{ name3, data3, sizeof data3 },
|
||||
};
|
||||
|
||||
#define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0])
|
||||
|
||||
static void generate_transform_manual(void)
|
||||
{
|
||||
IStorage *stg = NULL;
|
||||
|
@ -3694,7 +3692,7 @@ static void generate_transform_manual(void)
|
|||
r = IStorage_SetClass(stg, &CLSID_MsiTransform);
|
||||
ok(r == S_OK, "failed to set storage type\n");
|
||||
|
||||
for (i=0; i<NUM_TRANSFORM_TABLES; i++)
|
||||
for (i=0; i<ARRAY_SIZE(table_transform_data); i++)
|
||||
{
|
||||
r = IStorage_CreateStream(stg, table_transform_data[i].name,
|
||||
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
|
||||
|
|
|
@ -446,8 +446,6 @@ static const struct table_data table_patch_data[] = {
|
|||
{ p_name6, p_data6, sizeof p_data6 }
|
||||
};
|
||||
|
||||
#define NUM_PATCH_TABLES (sizeof table_patch_data/sizeof table_patch_data[0])
|
||||
|
||||
static const WCHAR t1_name0[] = { 0x4840, 0x430f, 0x422f, 0 }; /* File */
|
||||
static const WCHAR t1_name1[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */
|
||||
static const WCHAR t1_name2[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */
|
||||
|
@ -519,8 +517,6 @@ static const struct table_data table_transform1_data[] = {
|
|||
{ t1_name3, t1_data3, sizeof t1_data3 }
|
||||
};
|
||||
|
||||
#define NUM_TRANSFORM1_TABLES (sizeof table_transform1_data/sizeof table_transform1_data[0])
|
||||
|
||||
static const WCHAR t2_name0[] = { 0x4840, 0x430f, 0x422f, 0 }; /* File */
|
||||
static const WCHAR t2_name1[] = { 0x4840, 0x4216, 0x4327, 0x4824, 0 }; /* Media */
|
||||
static const WCHAR t2_name2[] = { 0x4840, 0x3b3f, 0x43f2, 0x4438, 0x45b1, 0 }; /* _Columns */
|
||||
|
@ -644,8 +640,6 @@ static const struct table_data table_transform2_data[] = {
|
|||
{ t2_name9, t2_data9, sizeof t2_data9 }
|
||||
};
|
||||
|
||||
#define NUM_TRANSFORM2_TABLES (sizeof table_transform2_data/sizeof table_transform2_data[0])
|
||||
|
||||
static void write_tables( IStorage *stg, const struct table_data *tables, UINT num_tables )
|
||||
{
|
||||
IStream *stm;
|
||||
|
@ -692,7 +686,7 @@ static void create_patch( const char *filename )
|
|||
r = IStorage_SetClass( stg, &CLSID_MsiPatch );
|
||||
ok( r == S_OK, "failed to set storage type 0x%08x\n", r );
|
||||
|
||||
write_tables( stg, table_patch_data, NUM_PATCH_TABLES );
|
||||
write_tables( stg, table_patch_data, ARRAY_SIZE( table_patch_data ));
|
||||
|
||||
r = IStorage_CreateStorage( stg, p_name7, mode, 0, 0, &stg1 );
|
||||
ok( r == S_OK, "failed to create substorage 0x%08x\n", r );
|
||||
|
@ -700,7 +694,7 @@ static void create_patch( const char *filename )
|
|||
r = IStorage_SetClass( stg1, &CLSID_MsiTransform );
|
||||
ok( r == S_OK, "failed to set storage type 0x%08x\n", r );
|
||||
|
||||
write_tables( stg1, table_transform1_data, NUM_TRANSFORM1_TABLES );
|
||||
write_tables( stg1, table_transform1_data, ARRAY_SIZE( table_transform1_data ));
|
||||
IStorage_Release( stg1 );
|
||||
|
||||
r = IStorage_CreateStorage( stg, p_name8, mode, 0, 0, &stg2 );
|
||||
|
@ -709,7 +703,7 @@ static void create_patch( const char *filename )
|
|||
r = IStorage_SetClass( stg2, &CLSID_MsiTransform );
|
||||
ok( r == S_OK, "failed to set storage type 0x%08x\n", r );
|
||||
|
||||
write_tables( stg2, table_transform2_data, NUM_TRANSFORM2_TABLES );
|
||||
write_tables( stg2, table_transform2_data, ARRAY_SIZE( table_transform2_data ));
|
||||
IStorage_Release( stg2 );
|
||||
IStorage_Release( stg );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue