Commit a783d2a3 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dmime/tests: Add an invalid stream test.

parent 83c078b0
...@@ -723,6 +723,7 @@ static void test_parsedescriptor(void) ...@@ -723,6 +723,7 @@ static void test_parsedescriptor(void)
}; };
FOURCC empty[] = {FOURCC_RIFF, ~0, 0}; FOURCC empty[] = {FOURCC_RIFF, ~0, 0};
FOURCC inam[] = {FOURCC_RIFF, ~0, FOURCC_LIST, ~0, mmioFOURCC('I','N','A','M'), 0, 0}; FOURCC inam[] = {FOURCC_RIFF, ~0, FOURCC_LIST, ~0, mmioFOURCC('I','N','A','M'), 0, 0};
FOURCC noriff[] = {mmioFOURCC('J','U','N','K'), 0};
#define X(class) &CLSID_ ## class, #class #define X(class) &CLSID_ ## class, #class
#define Y(form) form, #form #define Y(form) form, #form
const struct { const struct {
...@@ -808,6 +809,19 @@ static void test_parsedescriptor(void) ...@@ -808,6 +809,19 @@ static void test_parsedescriptor(void)
ok(!desc.dwValidData, "Got valid data %#x, expected 0\n", desc.dwValidData); ok(!desc.dwValidData, "Got valid data %#x, expected 0\n", desc.dwValidData);
IStream_Release(stream); IStream_Release(stream);
/* Not a RIFF stream */
stream = gen_riff_stream(noriff);
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
hr = IDirectMusicObject_ParseDescriptor(dmo, stream, &desc);
if (forms[i].needs_size)
ok(hr == DMUS_E_CHUNKNOTFOUND,
"ParseDescriptor failed: %08x, expected DMUS_E_CHUNKNOTFOUND\n", hr);
else
ok(hr == E_FAIL, "ParseDescriptor failed: %08x, expected E_FAIL\n", hr);
ok(!desc.dwValidData, "Got valid data %#x, expected 0\n", desc.dwValidData);
IStream_Release(stream);
/* All desc chunks */ /* All desc chunks */
alldesc[1] = forms[i].form; alldesc[1] = forms[i].form;
stream = gen_riff_stream(alldesc); stream = gen_riff_stream(alldesc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment