shlwapi/tests: Loop over the STGM access modes when testing the SHCreateStreamOnFile methods.
This commit is contained in:
parent
ebec0a9697
commit
47abba0257
|
@ -529,6 +529,12 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
|
||||||
|
|
||||||
START_TEST(istream)
|
START_TEST(istream)
|
||||||
{
|
{
|
||||||
|
static const DWORD stgm_access[] = {
|
||||||
|
STGM_READ,
|
||||||
|
STGM_WRITE,
|
||||||
|
STGM_READWRITE
|
||||||
|
};
|
||||||
|
|
||||||
static const DWORD stgm_flags[] = {
|
static const DWORD stgm_flags[] = {
|
||||||
0,
|
0,
|
||||||
STGM_CONVERT,
|
STGM_CONVERT,
|
||||||
|
@ -539,6 +545,8 @@ START_TEST(istream)
|
||||||
STGM_TRANSACTED | STGM_CONVERT | STGM_DELETEONRELEASE
|
STGM_TRANSACTED | STGM_CONVERT | STGM_DELETEONRELEASE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int i, j;
|
||||||
|
|
||||||
hShlwapi = GetModuleHandleA("shlwapi.dll");
|
hShlwapi = GetModuleHandleA("shlwapi.dll");
|
||||||
|
|
||||||
pSHCreateStreamOnFileA = (void*)GetProcAddress(hShlwapi, "SHCreateStreamOnFileA");
|
pSHCreateStreamOnFileA = (void*)GetProcAddress(hShlwapi, "SHCreateStreamOnFileA");
|
||||||
|
@ -546,30 +554,24 @@ START_TEST(istream)
|
||||||
pSHCreateStreamOnFileEx = (void*)GetProcAddress(hShlwapi, "SHCreateStreamOnFileEx");
|
pSHCreateStreamOnFileEx = (void*)GetProcAddress(hShlwapi, "SHCreateStreamOnFileEx");
|
||||||
|
|
||||||
if (!pSHCreateStreamOnFileA)
|
if (!pSHCreateStreamOnFileA)
|
||||||
printf("SHCreateStreamOnFileA not found... skipping tests.\n");
|
printf("SHCreateStreamOnFileA not found... those tests will be skipped.\n");
|
||||||
else {
|
|
||||||
test_SHCreateStreamOnFileA(STGM_READ);
|
|
||||||
test_SHCreateStreamOnFileA(STGM_WRITE);
|
|
||||||
test_SHCreateStreamOnFileA(STGM_READWRITE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pSHCreateStreamOnFileW)
|
if (!pSHCreateStreamOnFileW)
|
||||||
printf("SHCreateStreamOnFileW not found... skipping tests.\n");
|
printf("SHCreateStreamOnFileW not found... those tests will be skipped.\n");
|
||||||
else {
|
|
||||||
test_SHCreateStreamOnFileW(STGM_READ);
|
|
||||||
test_SHCreateStreamOnFileW(STGM_WRITE);
|
|
||||||
test_SHCreateStreamOnFileW(STGM_READWRITE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pSHCreateStreamOnFileEx)
|
if (!pSHCreateStreamOnFileEx)
|
||||||
printf("SHCreateStreamOnFileEx not found... skipping tests.\n");
|
printf("SHCreateStreamOnFileEx not found... those tests will be skipped.\n");
|
||||||
else {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i != sizeof(stgm_flags)/sizeof(stgm_flags[0]); i++) {
|
for (i = 0; i != sizeof(stgm_access)/sizeof(stgm_access[0]); i++) {
|
||||||
test_SHCreateStreamOnFileEx(STGM_READ, stgm_flags[i]);
|
if (pSHCreateStreamOnFileA)
|
||||||
test_SHCreateStreamOnFileEx(STGM_WRITE, stgm_flags[i]);
|
test_SHCreateStreamOnFileA(stgm_access[i]);
|
||||||
test_SHCreateStreamOnFileEx(STGM_READWRITE, stgm_flags[i]);
|
|
||||||
|
if (pSHCreateStreamOnFileW)
|
||||||
|
test_SHCreateStreamOnFileW(stgm_access[i]);
|
||||||
|
|
||||||
|
if (pSHCreateStreamOnFileEx) {
|
||||||
|
for (j = 0; j != sizeof(stgm_flags)/sizeof(stgm_flags[0]); j++)
|
||||||
|
test_SHCreateStreamOnFileEx(stgm_access[i], stgm_flags[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue