ole32/tests: Add some tests to exercise the enumerator.

This commit is contained in:
Huw Davies 2009-04-22 11:45:36 +01:00 committed by Alexandre Julliard
parent 1556d831c8
commit 6928615d5c
1 changed files with 28 additions and 0 deletions

View File

@ -593,6 +593,34 @@ static void test_enum_fmtetc(IDataObject *src)
hr = IEnumFORMATETC_Reset(enum_fmt); hr = IEnumFORMATETC_Reset(enum_fmt);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
if(src) /* Exercise the enumerator a bit */
{
IEnumFORMATETC *clone;
FORMATETC third_fmt;
hr = IEnumFORMATETC_Next(enum_fmt, 1, &third_fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &third_fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &third_fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
hr = IEnumFORMATETC_Reset(enum_fmt);
ok(hr == S_OK, "got %08x\n", hr);
hr = IEnumFORMATETC_Skip(enum_fmt, 2);
ok(hr == S_OK, "got %08x\n", hr);
hr = IEnumFORMATETC_Clone(enum_fmt, &clone);
ok(hr == S_OK, "got %08x\n", hr);
hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(fmt.cfFormat == third_fmt.cfFormat, "formats don't match\n");
hr = IEnumFORMATETC_Next(clone, 1, &fmt, NULL);
ok(hr == S_OK, "got %08x\n", hr);
ok(fmt.cfFormat == third_fmt.cfFormat, "formats don't match\n");
IEnumFORMATETC_Release(clone);
}
IEnumFORMATETC_Release(enum_fmt); IEnumFORMATETC_Release(enum_fmt);
IDataObject_Release(data); IDataObject_Release(data);
} }