Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
February 2022
- 87 participants
- 926 discussions
07 Feb '22
From: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
v4: Modify "use_mt" instead of run_queued_tests().
This supersedes patch 225754.
dlls/d3d10core/tests/d3d10core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c
index a5f7f4202d52..49622bd0e264 100644
--- a/dlls/d3d10core/tests/d3d10core.c
+++ b/dlls/d3d10core/tests/d3d10core.c
@@ -19223,6 +19223,11 @@ START_TEST(d3d10core)
char **argv;
use_mt = !getenv("WINETEST_NO_MT_D3D");
+ /* Some host drivers (MacOS, Mesa radeonsi) never unmap memory even when
+ * requested. When using the chunk allocator, running the tests with more
+ * than one thread can exceed the 32-bit virtual address space. */
+ if (sizeof(void *) == 4 && !strcmp(winetest_platform, "wine"))
+ use_mt = FALSE;
argc = winetest_get_mainargs(&argv);
for (i = 2; i < argc; ++i)
--
2.30.2
1
0
07 Feb '22
From: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
v4: Modify "use_mt" instead of run_queued_tests().
This supersedes patch 225755.
dlls/d2d1/tests/d2d1.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 2ac48e026c32..ba67dd53111c 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -10551,6 +10551,11 @@ START_TEST(d2d1)
pD2D1ConvertColorSpace = (void *)GetProcAddress(d2d1_dll, "D2D1ConvertColorSpace");
use_mt = !getenv("WINETEST_NO_MT_D3D");
+ /* Some host drivers (MacOS, Mesa radeonsi) never unmap memory even when
+ * requested. When using the chunk allocator, running the tests with more
+ * than one thread can exceed the 32-bit virtual address space. */
+ if (sizeof(void *) == 4 && !strcmp(winetest_platform, "wine"))
+ use_mt = FALSE;
argc = winetest_get_mainargs(&argv);
for (i = 2; i < argc; ++i)
--
2.30.2
1
0
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
v2: fixed test breakage
dlls/xmllite/tests/Makefile.in | 1 -
dlls/xmllite/tests/reader.c | 488 +++++++++++------------
dlls/xmllite/tests/writer.c | 694 ++++++++++++++++-----------------
3 files changed, 591 insertions(+), 592 deletions(-)
diff --git a/dlls/xmllite/tests/Makefile.in b/dlls/xmllite/tests/Makefile.in
index 1548dc50193..6a87e6663aa 100644
--- a/dlls/xmllite/tests/Makefile.in
+++ b/dlls/xmllite/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = xmllite.dll
IMPORTS = xmllite ole32
diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c
index c4e53a5c40c..d0d2373aaf1 100644
--- a/dlls/xmllite/tests/reader.c
+++ b/dlls/xmllite/tests/reader.c
@@ -50,7 +50,7 @@ static IStream *create_stream_on_data(const void *data, unsigned int size)
memcpy(ptr, data, size);
hr = CreateStreamOnHGlobal(hglobal, TRUE, &stream);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(stream != NULL, "Expected non-NULL stream\n");
GlobalUnlock(hglobal);
@@ -209,7 +209,7 @@ static void _set_input_string(unsigned line, IXmlReader *reader, const char *xml
stream = create_stream_on_data(xml, strlen(xml));
hr = IXmlReader_SetInput(reader, (IUnknown *)stream);
- ok_(__FILE__,line)(hr == S_OK, "got %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
}
@@ -222,9 +222,9 @@ static void _read_node(unsigned line, IXmlReader *reader, XmlNodeType expected_t
hr = IXmlReader_Read(reader, &type);
if (expected_type == XmlNodeType_None)
- ok_(__FILE__,line)(hr == S_FALSE, "Read returned %08x, expected S_FALSE\n", hr);
+ ok_(__FILE__,line)(hr == S_FALSE, "Read returned %#lx, expected S_FALSE.\n", hr);
else
- ok_(__FILE__,line)(hr == S_OK, "Read returned %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Read returned %#lx.\n", hr);
ok_(__FILE__,line)(type == expected_type, "read type %d, expected %d\n", type, expected_type);
}
@@ -233,7 +233,7 @@ static void _next_attribute(unsigned line, IXmlReader *reader)
{
HRESULT hr;
hr = IXmlReader_MoveToNextAttribute(reader);
- ok_(__FILE__,line)(hr == S_OK, "MoveToNextAttribute returned %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
#define move_to_element(a) _move_to_element(__LINE__,a)
@@ -241,7 +241,7 @@ static void _move_to_element(unsigned line, IXmlReader *reader)
{
HRESULT hr;
hr = IXmlReader_MoveToElement(reader);
- ok_(__FILE__,line)(hr == S_OK, "MoveToElement failed: %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
static void test_read_state(IXmlReader *reader, XmlReadState expected,
@@ -269,11 +269,11 @@ static void test_read_state(IXmlReader *reader, XmlReadState expected,
static const WCHAR *_reader_value(unsigned line, IXmlReader *reader, const WCHAR *expect)
{
const WCHAR *str = (void*)0xdeadbeef;
- ULONG len = 0xdeadbeef;
+ UINT len = 0xdeadbeef;
HRESULT hr;
hr = IXmlReader_GetValue(reader, &str, &len);
- ok_(__FILE__,line)(hr == S_OK, "GetValue returned %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_(__FILE__,line)(len == lstrlenW(str), "len = %u\n", len);
ok_(__FILE__,line)(!lstrcmpW(str, expect), "value = %s\n", wine_dbgstr_w(str));
return str;
@@ -283,12 +283,12 @@ static const WCHAR *_reader_value(unsigned line, IXmlReader *reader, const WCHAR
static const WCHAR *_reader_name(unsigned line, IXmlReader *reader, const WCHAR *expect)
{
const WCHAR *str = (void*)0xdeadbeef;
- ULONG len = 0xdeadbeef;
+ UINT len = 0xdeadbeef;
HRESULT hr;
hr = IXmlReader_GetLocalName(reader, &str, &len);
- ok_(__FILE__,line)(hr == S_OK, "GetLocalName returned %08x\n", hr);
- ok_(__FILE__,line)(len == lstrlenW(str), "len = %u\n", len);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok_(__FILE__,line)(len == lstrlenW(str), "len = %u.\n", len);
ok_(__FILE__,line)(!lstrcmpW(str, expect), "name = %s\n", wine_dbgstr_w(str));
return str;
}
@@ -297,12 +297,12 @@ static const WCHAR *_reader_name(unsigned line, IXmlReader *reader, const WCHAR
static const WCHAR *_reader_prefix(unsigned line, IXmlReader *reader, const WCHAR *expect)
{
const WCHAR *str = (void*)0xdeadbeef;
- ULONG len = 0xdeadbeef;
+ UINT len = 0xdeadbeef;
HRESULT hr;
hr = IXmlReader_GetPrefix(reader, &str, &len);
- ok_(__FILE__,line)(hr == S_OK, "GetPrefix returned %08x\n", hr);
- ok_(__FILE__,line)(len == lstrlenW(str), "len = %u\n", len);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok_(__FILE__,line)(len == lstrlenW(str), "len = %u.\n", len);
ok_(__FILE__,line)(!lstrcmpW(str, expect), "prefix = %s\n", wine_dbgstr_w(str));
return str;
}
@@ -311,12 +311,12 @@ static const WCHAR *_reader_prefix(unsigned line, IXmlReader *reader, const WCHA
static const WCHAR *_reader_namespace(unsigned line, IXmlReader *reader, const WCHAR *expect)
{
const WCHAR *str = (void*)0xdeadbeef;
- ULONG len = 0xdeadbeef;
+ UINT len = 0xdeadbeef;
HRESULT hr;
hr = IXmlReader_GetNamespaceUri(reader, &str, &len);
- ok_(__FILE__,line)(hr == S_OK, "GetNamespaceUri returned %08x\n", hr);
- ok_(__FILE__,line)(len == lstrlenW(str), "len = %u\n", len);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok_(__FILE__,line)(len == lstrlenW(str), "len = %u.\n", len);
ok_(__FILE__,line)(!lstrcmpW(str, expect), "namespace = %s\n", wine_dbgstr_w(str));
return str;
}
@@ -325,12 +325,12 @@ static const WCHAR *_reader_namespace(unsigned line, IXmlReader *reader, const W
static const WCHAR *_reader_qname(IXmlReader *reader, const WCHAR *expect, unsigned line)
{
const WCHAR *str = (void*)0xdeadbeef;
- ULONG len = 0xdeadbeef;
+ UINT len = 0xdeadbeef;
HRESULT hr;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok_(__FILE__,line)(hr == S_OK, "GetQualifiedName returned %08x\n", hr);
- ok_(__FILE__,line)(len == lstrlenW(str), "len = %u\n", len);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok_(__FILE__,line)(len == lstrlenW(str), "len = %u.\n", len);
ok_(__FILE__,line)(!lstrcmpW(str, expect), "name = %s\n", wine_dbgstr_w(str));
return str;
}
@@ -343,7 +343,7 @@ static void _read_value_char(IXmlReader *reader, WCHAR expected_char, unsigned l
HRESULT hr;
hr = IXmlReader_ReadValueChunk(reader, &c, 1, &count);
- ok_(__FILE__,line)(hr == S_OK, "got %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_(__FILE__,line)(count == 1, "got %u\n", c);
ok_(__FILE__,line)(c == expected_char, "got %x\n", c);
}
@@ -528,84 +528,84 @@ static void test_reader_create(void)
}
hr = CreateXmlReader(&IID_IStream, (void **)&unk, NULL);
- ok(hr == E_NOINTERFACE, "got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlReader(&IID_IUnknown, (void **)&unk, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(unk, &IID_IXmlReader, (void **)&reader);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(unk == (IUnknown *)reader, "unexpected interface\n");
IXmlReader_Release(reader);
IUnknown_Release(unk);
hr = CreateXmlReader(&IID_IUnknown, (void **)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IXmlReader_Release(reader);
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE(reader, XmlReadState_Closed);
nodetype = XmlNodeType_Element;
hr = IXmlReader_GetNodeType(reader, &nodetype);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "got %d\n", nodetype);
/* crashes on XP, 2k3, works on newer versions */
if (0)
{
hr = IXmlReader_GetNodeType(reader, NULL);
- ok(hr == E_INVALIDARG, "got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
}
resolver = (void*)0xdeadbeef;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_XmlResolver, (LONG_PTR*)&resolver);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(resolver == NULL, "got %p\n", resolver);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_XmlResolver, 0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_XmlResolver, (LONG_PTR)&testresolver);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
resolver = NULL;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_XmlResolver, (LONG_PTR*)&resolver);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(resolver == &testresolver, "got %p\n", resolver);
IXmlResolver_Release(resolver);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_XmlResolver, 0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
dtd = 2;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_DtdProcessing, (LONG_PTR*)&dtd);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(dtd == DtdProcessing_Prohibit, "got %d\n", dtd);
dtd = 2;
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, dtd);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, -1);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Null input pointer, releases previous input */
hr = IXmlReader_SetInput(reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE2(reader, XmlReadState_Initial, XmlReadState_Closed);
/* test input interface selection sequence */
hr = testinput_createinstance((void**)&input);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
{
input_iids.count = 0;
hr = IXmlReader_SetInput(reader, input);
- ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok_iids(&input_iids, setinput_full, setinput_full_old, FALSE);
IUnknown_Release(input);
}
@@ -623,71 +623,71 @@ static void test_readerinput(void)
LONG ref;
hr = CreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, NULL);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, &reader_input);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ref = IStream_AddRef(stream);
- ok(ref == 2, "Expected 2, got %d\n", ref);
+ ok(ref == 2, "Expected 2, got %ld.\n", ref);
IStream_Release(stream);
hr = CreateXmlReaderInputWithEncodingName((IUnknown*)stream, NULL, NULL, FALSE, NULL, &reader_input);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(reader_input, &IID_IStream, (void**)&stream2);
- ok(hr == E_NOINTERFACE, "Expected S_OK, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(reader_input, &IID_ISequentialStream, (void**)&stream2);
- ok(hr == E_NOINTERFACE, "Expected S_OK, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
/* IXmlReaderInput grabs a stream reference */
ref = IStream_AddRef(stream);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IStream_Release(stream);
/* try ::SetInput() with valid IXmlReaderInput */
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ref = IUnknown_AddRef(reader_input);
- ok(ref == 2, "Expected 2, got %d\n", ref);
+ ok(ref == 2, "Expected 2, got %ld.\n", ref);
IUnknown_Release(reader_input);
hr = IXmlReader_SetInput(reader, reader_input);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE(reader, XmlReadState_Initial);
nodetype = XmlNodeType_Element;
hr = IXmlReader_GetNodeType(reader, &nodetype);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "got %d\n", nodetype);
/* IXmlReader grabs a IXmlReaderInput reference */
ref = IUnknown_AddRef(reader_input);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IUnknown_Release(reader_input);
ref = IStream_AddRef(stream);
- ok(ref == 4, "Expected 4, got %d\n", ref);
+ ok(ref == 4, "Expected 4, got %ld.\n", ref);
IStream_Release(stream);
/* reset input and check state */
hr = IXmlReader_SetInput(reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE2(reader, XmlReadState_Initial, XmlReadState_Closed);
IXmlReader_Release(reader);
ref = IStream_AddRef(stream);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IStream_Release(stream);
ref = IUnknown_AddRef(reader_input);
- ok(ref == 2, "Expected 2, got %d\n", ref);
+ ok(ref == 2, "Expected 2, got %ld.\n", ref);
IUnknown_Release(reader_input);
/* IID_IXmlReaderInput */
@@ -696,9 +696,9 @@ static void test_readerinput(void)
Such query will be used only to check if input is really IXmlReaderInput */
obj = (IUnknown*)0xdeadbeef;
hr = IUnknown_QueryInterface(reader_input, &IID_IXmlReaderInput, (void**)&obj);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ref = IUnknown_AddRef(reader_input);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IUnknown_Release(reader_input);
IUnknown_Release(reader_input);
@@ -708,59 +708,59 @@ static void test_readerinput(void)
/* test input interface selection sequence */
input = NULL;
hr = testinput_createinstance((void**)&input);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
input_iids.count = 0;
ref = IUnknown_AddRef(input);
- ok(ref == 2, "Expected 2, got %d\n", ref);
+ ok(ref == 2, "Expected 2, got %ld.\n", ref);
IUnknown_Release(input);
hr = CreateXmlReaderInputWithEncodingName(input, NULL, NULL, FALSE, NULL, &reader_input);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_iids(&input_iids, empty_seq, NULL, FALSE);
/* IXmlReaderInput stores stream interface as IUnknown */
ref = IUnknown_AddRef(input);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IUnknown_Release(input);
hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
input_iids.count = 0;
ref = IUnknown_AddRef(reader_input);
- ok(ref == 2, "Expected 2, got %d\n", ref);
+ ok(ref == 2, "Expected 2, got %ld.\n", ref);
IUnknown_Release(reader_input);
ref = IUnknown_AddRef(input);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IUnknown_Release(input);
hr = IXmlReader_SetInput(reader, reader_input);
- ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok_iids(&input_iids, setinput_readerinput, NULL, FALSE);
TEST_READER_STATE(reader, XmlReadState_Closed);
ref = IUnknown_AddRef(input);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IUnknown_Release(input);
ref = IUnknown_AddRef(reader_input);
ok(ref == 3 || broken(ref == 2) /* versions 1.0.x and 1.1.x - XP, Vista */,
- "Expected 3, got %d\n", ref);
+ "Expected 3, got %ld.\n", ref);
IUnknown_Release(reader_input);
/* repeat another time, no check or caching here */
input_iids.count = 0;
hr = IXmlReader_SetInput(reader, reader_input);
- ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok_iids(&input_iids, setinput_readerinput, NULL, FALSE);
/* another reader */
hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader2, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* resolving from IXmlReaderInput to IStream/ISequentialStream is done at
::SetInput() level, each time it's called */
input_iids.count = 0;
hr = IXmlReader_SetInput(reader2, reader_input);
- ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok_iids(&input_iids, setinput_readerinput, NULL, FALSE);
IXmlReader_Release(reader2);
@@ -777,11 +777,11 @@ static void test_reader_state(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* invalid arguments */
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_ReadState, NULL);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* attempt to read on closed reader */
TEST_READER_STATE(reader, XmlReadState_Closed);
@@ -790,7 +790,7 @@ if (0)
{
/* newer versions crash here, probably because no input was set */
hr = IXmlReader_Read(reader, &nodetype);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
}
set_input_string(reader, "xml");
TEST_READER_STATE(reader, XmlReadState_Initial);
@@ -798,7 +798,7 @@ if (0)
nodetype = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &nodetype);
todo_wine
- ok(FAILED(hr), "got %08x\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "Unexpected node type %d\n", nodetype);
todo_wine
@@ -807,7 +807,7 @@ if (0)
nodetype = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &nodetype);
todo_wine
- ok(FAILED(hr), "got %08x\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "Unexpected node type %d\n", nodetype);
IXmlReader_Release(reader);
@@ -850,26 +850,26 @@ static void test_read_xmldeclaration(void)
const WCHAR *val;
hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stream = create_stream_on_data(xmldecl_full, sizeof(xmldecl_full));
hr = IXmlReader_SetInput(reader, (IUnknown*)stream);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 0, "got %d\n", count);
/* try to move without attributes */
hr = IXmlReader_MoveToElement(reader);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToNextAttribute(reader);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
TEST_READER_POSITION(reader, 0, 0);
@@ -890,7 +890,7 @@ static void test_read_xmldeclaration(void)
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
TEST_READER_POSITION2(reader, 1, 7, ~0u, 55);
@@ -899,40 +899,40 @@ static void test_read_xmldeclaration(void)
next_attribute(reader);
next_attribute(reader);
hr = IXmlReader_MoveToNextAttribute(reader);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_POSITION2(reader, 1, 7, ~0u, 55);
hr = IXmlReader_GetAttributeCount(reader, NULL);
- ok(hr == E_INVALIDARG, "got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 3, "Expected 3, got %d\n", count);
for (i = 0; i < count; i++)
{
len = 0;
hr = IXmlReader_GetLocalName(reader, &val, &len);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == lstrlenW(name_val[i].name), "expected %u, got %u\n", lstrlenW(name_val[i].name), len);
ok(!lstrcmpW(name_val[i].name, val), "expected %s, got %s\n", wine_dbgstr_w(name_val[i].name), wine_dbgstr_w(val));
len = 0;
hr = IXmlReader_GetValue(reader, &val, &len);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == lstrlenW(name_val[i].val), "expected %u, got %u\n", lstrlenW(name_val[i].val), len);
ok(!lstrcmpW(name_val[i].val, val), "expected %s, got %s\n", wine_dbgstr_w(name_val[i].val), wine_dbgstr_w(val));
hr = IXmlReader_MoveToNextAttribute(reader);
- ok(hr == ((i < count - 1) ? S_OK : S_FALSE), "got %08x\n", hr);
+ ok(hr == ((i < count - 1) ? S_OK : S_FALSE), "Unexpected hr %#lx.\n", hr);
}
TEST_DEPTH(reader, 1);
@@ -942,7 +942,7 @@ static void test_read_xmldeclaration(void)
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_XmlDeclaration, "got %d\n", type);
type = XmlNodeType_XmlDeclaration;
@@ -950,7 +950,7 @@ static void test_read_xmldeclaration(void)
/* newer versions return syntax error here cause document is incomplete,
it makes more sense than invalid char error */
todo_wine {
- ok(hr == WC_E_SYNTAX || broken(hr == WC_E_XMLCHARACTER), "got 0x%08x\n", hr);
+ ok(hr == WC_E_SYNTAX || broken(hr == WC_E_XMLCHARACTER), "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "got %d\n", type);
}
IStream_Release(stream);
@@ -959,14 +959,14 @@ todo_wine {
stream = create_stream_on_data(xmldecl_short, sizeof(xmldecl_short));
hr = IXmlReader_SetInput(reader, (IUnknown *)stream);
- ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
read_node(reader, XmlNodeType_XmlDeclaration);
TEST_READER_POSITION2(reader, 1, 3, ~0u, 21);
TEST_READER_STATE(reader, XmlReadState_Interactive);
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "expected 1, got %d\n", count);
ret = IXmlReader_IsEmptyElement(reader);
@@ -982,20 +982,20 @@ todo_wine {
type = -1;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
TEST_READER_POSITION2(reader, 1, 7, ~0u, 21);
/* try to move from last attribute */
hr = IXmlReader_MoveToNextAttribute(reader);
- ok(hr == S_FALSE, "expected S_FALSE, got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
read_node(reader, XmlNodeType_Element);
TEST_READER_POSITION2(reader, 1, 23, ~0u, 40);
TEST_READER_STATE(reader, XmlReadState_Interactive);
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 0, "expected 0, got %d\n", count);
ret = IXmlReader_IsEmptyElement(reader);
@@ -1007,7 +1007,7 @@ todo_wine {
type = -1;
hr = IXmlReader_Read(reader, &type);
todo_wine
- ok(hr == WC_E_SYNTAX || hr == WC_E_XMLCHARACTER /* XP */, "expected WC_E_SYNTAX, got %08x\n", hr);
+ ok(hr == WC_E_SYNTAX || hr == WC_E_XMLCHARACTER /* XP */, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "expected XmlNodeType_None, got %s\n", type_to_str(type));
TEST_READER_POSITION(reader, 1, 41);
todo_wine
@@ -1053,7 +1053,7 @@ static void test_read_comment(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, teststr);
@@ -1066,7 +1066,7 @@ static void test_read_comment(void)
if (type == XmlNodeType_Text || type == XmlNodeType_Comment)
{
hr = IXmlReader_GetValue(reader, &value, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*value != 0, "Expected node value\n");
}
i++;
@@ -1079,9 +1079,9 @@ static void test_read_comment(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
if (test->hr_broken)
- ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr || broken(hr == test->hr_broken), "Unexpected hr %#lx, for %s.\n", hr, test->xml);
else
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1092,14 +1092,14 @@ static void test_read_comment(void)
str = NULL;
hr = IXmlReader_GetLocalName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
reader_qname(reader, L"");
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
/* value */
@@ -1134,7 +1134,7 @@ static void test_read_pi(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1145,9 +1145,9 @@ static void test_read_pi(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
if (test->hr_broken)
- ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr || broken(hr == test->hr_broken), "Unexpected hr %#lx, for %s.\n", hr, test->xml);
else
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1160,7 +1160,7 @@ static void test_read_pi(void)
len = 0;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == lstrlenW(test->name), "got %u\n", len);
ok(!lstrcmpW(str, test->name), "got %s\n", wine_dbgstr_w(str));
@@ -1230,7 +1230,7 @@ static void test_read_full(void)
int i;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, test->xml);
@@ -1257,10 +1257,10 @@ static void test_read_public_dtd(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, DtdProcessing_Parse);
- ok(hr == S_OK, "got 0x%8x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, test_public_dtd);
@@ -1268,15 +1268,15 @@ static void test_read_public_dtd(void)
count = 0;
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %d\n", count);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
reader_name(reader, L"PUBLIC");
@@ -1286,7 +1286,7 @@ static void test_read_public_dtd(void)
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
reader_name(reader, L"SYSTEM");
@@ -1298,7 +1298,7 @@ static void test_read_public_dtd(void)
len = 0;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine {
ok(len == lstrlenW(dtdnameW), "got %u\n", len);
ok(!lstrcmpW(str, dtdnameW), "got %s\n", wine_dbgstr_w(str));
@@ -1320,10 +1320,10 @@ static void test_read_system_dtd(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, DtdProcessing_Parse);
- ok(hr == S_OK, "got 0x%8x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, test_system_dtd);
@@ -1331,15 +1331,15 @@ static void test_read_system_dtd(void)
count = 0;
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %d\n", count);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
reader_name(reader, L"SYSTEM");
@@ -1351,7 +1351,7 @@ static void test_read_system_dtd(void)
len = 0;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine {
ok(len == lstrlenW(dtdnameW), "got %u\n", len);
ok(!lstrcmpW(str, dtdnameW), "got %s\n", wine_dbgstr_w(str));
@@ -1397,7 +1397,7 @@ static void test_read_element(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1406,10 +1406,10 @@ static void test_read_element(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
if (test->hr_broken)
- ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr || broken(hr == test->hr_broken), "Unexpected hr %#lx, for %s.\n", hr, test->xml);
else
todo_wine_if(test->hr == NC_E_UNDECLAREDPREFIX)
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1420,7 +1420,7 @@ static void test_read_element(void)
len = 0;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == lstrlenW(test->name), "got %u\n", len);
ok(!lstrcmpW(str, test->name), "got %s\n", wine_dbgstr_w(str));
@@ -1444,7 +1444,7 @@ static void test_read_element(void)
depth = 123;
hr = IXmlReader_GetDepth(reader, &depth);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(depth == depths[i], "%u: got depth %u, expected %u\n", i, depth, depths[i]);
if (type == XmlNodeType_Element || type == XmlNodeType_EndElement)
@@ -1453,7 +1453,7 @@ static void test_read_element(void)
prefix = NULL;
hr = IXmlReader_GetPrefix(reader, &prefix, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(prefix != NULL, "got %p\n", prefix);
if (!*prefix)
@@ -1462,12 +1462,12 @@ static void test_read_element(void)
local = NULL;
hr = IXmlReader_GetLocalName(reader, &local, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(local != NULL, "got %p\n", local);
qname = NULL;
hr = IXmlReader_GetQualifiedName(reader, &qname, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(qname != NULL, "got %p\n", qname);
ok(local == qname, "expected same pointer\n");
@@ -1478,7 +1478,7 @@ static void test_read_element(void)
{
count = 1;
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 0, "got %u\n", count);
}
@@ -1486,7 +1486,7 @@ static void test_read_element(void)
{
count = 0;
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* moving to attributes increases depth */
if (count)
@@ -1496,14 +1496,14 @@ static void test_read_element(void)
reader_value(reader, L"");
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetValue(reader, &value, NULL);
ok(*value != 0, "Unexpected value %s\n", wine_dbgstr_w(value));
depth = 123;
hr = IXmlReader_GetDepth(reader, &depth);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(depth == depths[i] + 1, "%u: got depth %u, expected %u\n", i, depth, depths[i] + 1);
move_to_element(reader);
@@ -1511,7 +1511,7 @@ static void test_read_element(void)
depth = 123;
hr = IXmlReader_GetDepth(reader, &depth);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(depth == depths[i], "%u: got depth %u, expected %u\n", i, depth, depths[i]);
}
}
@@ -1526,7 +1526,7 @@ static void test_read_element(void)
type = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &type);
- ok(hr == WC_E_ELEMENTMATCH, "got %08x\n", hr);
+ ok(hr == WC_E_ELEMENTMATCH, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "got %d\n", type);
TEST_READER_STATE(reader, XmlReadState_Error);
@@ -1544,16 +1544,16 @@ static void test_read_pending(void)
int c;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetInput(reader, (IUnknown*)&teststream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* first read call returns incomplete node, second attempt fails with E_PENDING */
stream_readcall = 0;
type = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK || broken(hr == E_PENDING), "got 0x%08x\n", hr);
+ ok(hr == S_OK || broken(hr == E_PENDING), "Unexpected hr %#lx.\n", hr);
/* newer versions are happy when it's enough data to detect node type,
older versions keep reading until it fails to read more */
todo_wine
@@ -1564,7 +1564,7 @@ static void test_read_pending(void)
c = stream_readcall;
value = (void*)0xdeadbeef;
hr = IXmlReader_GetValue(reader, &value, NULL);
- ok(hr == E_PENDING, "got 0x%08x\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
ok(value == NULL || broken(value == (void*)0xdeadbeef) /* Win8 sets it to NULL */, "got %p\n", value);
ok(c < stream_readcall || broken(c == stream_readcall), "got %d, expected %d\n", stream_readcall, c+1);
@@ -1581,12 +1581,12 @@ static void test_readvaluechunk(void)
UINT c;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, "<!-- comment1 --><!-- comment2 -->");
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Comment, "type = %u\n", type);
read_value_char(reader, ' ');
@@ -1599,13 +1599,13 @@ static void test_readvaluechunk(void)
c = 0;
b = 0;
hr = IXmlReader_ReadValueChunk(reader, &b, 1, &c);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(c == 0, "got %u\n", c);
ok(b == 0, "got %x\n", b);
c = 0xdeadbeef;
hr = IXmlReader_ReadValueChunk(reader, buf, 0, &c);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!c, "c = %u\n", c);
reader_value(reader, L"omment1 ");
@@ -1615,13 +1615,13 @@ static void test_readvaluechunk(void)
c = 0xdeadbeef;
hr = IXmlReader_ReadValueChunk(reader, buf, 0, &c);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!c, "c = %u\n", c);
c = 0xdeadbeef;
memset(buf, 0xcc, sizeof(buf));
hr = IXmlReader_ReadValueChunk(reader, buf, ARRAY_SIZE(buf), &c);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(c == 10, "got %u\n", c);
ok(buf[c] == 0xcccc, "buffer overflow\n");
buf[c] = 0;
@@ -1630,7 +1630,7 @@ static void test_readvaluechunk(void)
c = 0xdeadbeef;
memset(buf, 0xcc, sizeof(buf));
hr = IXmlReader_ReadValueChunk(reader, buf, ARRAY_SIZE(buf), &c);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(!c, "got %u\n", c);
/* portion read as chunk is skipped from resulting node value */
@@ -1640,7 +1640,7 @@ static void test_readvaluechunk(void)
c = 0xdeadbeef;
b = 0xffff;
hr = IXmlReader_ReadValueChunk(reader, &b, 1, &c);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(c == 0, "got %u\n", c);
ok(b == 0xffff, "got %x\n", b);
@@ -1666,7 +1666,7 @@ static void test_read_cdata(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1685,9 +1685,9 @@ static void test_read_cdata(void)
}
if (test->hr_broken)
- ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr || broken(hr == test->hr_broken), "Unexpected hr %#lx, for %s.\n", hr, test->xml);
else
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1699,19 +1699,19 @@ static void test_read_cdata(void)
str = NULL;
hr = IXmlReader_GetLocalName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
len = 1;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == 0, "got %u\n", len);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
/* value */
@@ -1740,7 +1740,7 @@ static void test_read_text(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1757,7 +1757,7 @@ static void test_read_text(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
}
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1769,19 +1769,19 @@ static void test_read_text(void)
str = NULL;
hr = IXmlReader_GetLocalName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
len = 1;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == 0, "got %u\n", len);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
/* value */
@@ -1812,7 +1812,7 @@ static void test_isemptyelement(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1823,7 +1823,7 @@ static void test_isemptyelement(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "got %d\n", type);
ret = IXmlReader_IsEmptyElement(reader);
@@ -1867,7 +1867,7 @@ static void test_read_attribute(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1878,9 +1878,9 @@ static void test_read_attribute(void)
hr = IXmlReader_Read(reader, NULL);
if (test->hr_broken)
- ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr || broken(hr == test->hr_broken), "Unexpected hr %#lx, for %s.\n", hr, test->xml);
else
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1888,19 +1888,19 @@ static void test_read_attribute(void)
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "Failed to get node type, %#x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "got %d for %s\n", type, test->xml);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_name(reader, test->name);
len = 1;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == lstrlenW(test->name), "got %u\n", len);
ok(!lstrcmpW(str, test->name), "got %s\n", wine_dbgstr_w(str));
@@ -1921,23 +1921,23 @@ static void test_reader_properties(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 0;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_MaxElementDepth, &value);
- ok(hr == S_OK, "GetProperty failed: %08x\n", hr);
- ok(value == 256, "Unexpected default max depth value %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == 256, "Unexpected default max depth value %Id.\n", value);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MultiLanguage, 0);
- ok(hr == S_OK, "SetProperty failed: %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MaxElementDepth, 0);
- ok(hr == S_OK, "SetProperty failed: %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 256;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_MaxElementDepth, &value);
- ok(hr == S_OK, "GetProperty failed: %08x\n", hr);
- ok(value == 0, "Unexpected max depth value %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == 0, "Unexpected max depth value %Id.\n", value);
IXmlReader_Release(reader);
}
@@ -1960,7 +1960,7 @@ static void test_prefix(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(prefix_tests); i++) {
XmlNodeType type;
@@ -1968,16 +1968,16 @@ static void test_prefix(void)
set_input_string(reader, prefix_tests[i].xml);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "Read() failed, %#x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "Unexpected node type %d.\n", type);
reader_prefix(reader, prefix_tests[i].prefix1);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "MoveToFirstAttribute() failed, %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "GetNodeType() failed, %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "Unexpected node type %d.\n", type);
reader_prefix(reader, prefix_tests[i].prefix2);
@@ -1985,7 +1985,7 @@ static void test_prefix(void)
next_attribute(reader);
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "GetNodeType() failed, %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "Unexpected node type %d.\n", type);
reader_prefix(reader, prefix_tests[i].prefix3);
@@ -2035,7 +2035,7 @@ static void test_namespaceuri(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(uri_tests); i++) {
unsigned int j = 0;
@@ -2059,13 +2059,13 @@ static void test_namespaceuri(void)
local = NULL;
length = 0;
hr = IXmlReader_GetLocalName(reader, &local, &length);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(local != NULL, "Unexpected NULL local name pointer\n");
qname = NULL;
length2 = 0;
hr = IXmlReader_GetQualifiedName(reader, &qname, &length2);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(qname != NULL, "Unexpected NULL qualified name pointer\n");
if (type == XmlNodeType_Element ||
@@ -2100,28 +2100,28 @@ static void test_read_charref(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, testA);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "Unexpected node type %d\n", type);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Text, "Unexpected node type %d\n", type);
hr = IXmlReader_GetValue(reader, &value, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(value, chardataW), "Text value : %s\n", wine_dbgstr_w(value));
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_EndElement, "Unexpected node type %d\n", type);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "Unexpected node type %d\n", type);
IXmlReader_Release(reader);
@@ -2154,7 +2154,7 @@ static void test_encoding_detection(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* there's no way to query detected encoding back, so just verify that document is browsable */
@@ -2164,7 +2164,7 @@ static void test_encoding_detection(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type != XmlNodeType_None, "Unexpected node type %d\n", type);
}
@@ -2173,11 +2173,11 @@ static void test_encoding_detection(void)
stream = create_stream_on_data(encoding_testsW[i].text, lstrlenW(encoding_testsW[i].text) * sizeof(WCHAR));
hr = IXmlReader_SetInput(reader, (IUnknown *)stream);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "%u: got %08x\n", i, hr);
+ ok(hr == S_OK, "%u: unexpected hr %#lx.\n", i, hr);
ok(type != XmlNodeType_None, "%u: unexpected node type %d\n", i, type);
IStream_Release(stream);
@@ -2193,8 +2193,8 @@ static void test_eof_state(IXmlReader *reader, BOOL eof)
ok(IXmlReader_IsEOF(reader) == eof, "Unexpected IsEOF() result\n");
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_ReadState, &state);
- ok(hr == S_OK, "GetProperty() failed, %#x\n", hr);
- ok((state == XmlReadState_EndOfFile) == eof, "Unexpected EndOfFile state %ld\n", state);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok((state == XmlReadState_EndOfFile) == eof, "Unexpected EndOfFile state %Id.\n", state);
}
static void test_endoffile(void)
@@ -2204,7 +2204,7 @@ static void test_endoffile(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
test_eof_state(reader, FALSE);
@@ -2214,46 +2214,46 @@ static void test_endoffile(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "Unexpected type %d\n", type);
test_eof_state(reader, FALSE);
type = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_FALSE, "got %#x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "Unexpected type %d\n", type);
test_eof_state(reader, TRUE);
hr = IXmlReader_SetInput(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
test_eof_state(reader, FALSE);
IXmlReader_Release(reader);
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, "<a/>text");
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "Unexpected type %d\n", type);
test_eof_state(reader, FALSE);
type = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &type);
- ok(hr == WC_E_SYNTAX, "got %#x\n", hr);
+ ok(hr == WC_E_SYNTAX, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "Unexpected type %d\n", type);
test_eof_state(reader, FALSE);
hr = IXmlReader_SetInput(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IXmlReader_Release(reader);
}
@@ -2274,37 +2274,37 @@ static void test_max_element_depth(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, xml);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MaxElementDepth, 2);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 0);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 0);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 1);
TEST_READER_STATE(reader, XmlReadState_Interactive);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == SC_E_MAXELEMENTDEPTH, "got %08x\n", hr);
+ ok(hr == SC_E_MAXELEMENTDEPTH, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH2(reader, 0, 2);
TEST_READER_STATE(reader, XmlReadState_Error);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MaxElementDepth, 10);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == SC_E_MAXELEMENTDEPTH, "got %08x\n", hr);
+ ok(hr == SC_E_MAXELEMENTDEPTH, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH2(reader, 0, 2);
TEST_READER_STATE(reader, XmlReadState_Error);
@@ -2313,34 +2313,34 @@ static void test_max_element_depth(void)
set_input_string(reader, xml);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MaxElementDepth, 2);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 0);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 0);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 1);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 2);
TEST_READER_STATE(reader, XmlReadState_Interactive);
nodetype = 123;
hr = IXmlReader_Read(reader, &nodetype);
- ok(hr == SC_E_MAXELEMENTDEPTH, "got %08x\n", hr);
+ ok(hr == SC_E_MAXELEMENTDEPTH, "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "got node type %d\n", nodetype);
nodetype = 123;
hr = IXmlReader_Read(reader, &nodetype);
- ok(hr == SC_E_MAXELEMENTDEPTH, "got %08x\n", hr);
+ ok(hr == SC_E_MAXELEMENTDEPTH, "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "got node type %d\n", nodetype);
TEST_DEPTH2(reader, 0, 2);
@@ -2350,7 +2350,7 @@ static void test_max_element_depth(void)
set_input_string(reader, xml);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MaxElementDepth, 0);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
while (IXmlReader_Read(reader, NULL) == S_OK)
@@ -2370,25 +2370,25 @@ static void test_reader_position(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE(reader, XmlReadState_Closed);
/* position methods with Null args */
hr = IXmlReader_GetLineNumber(reader, NULL);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetLinePosition(reader, NULL);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
position = 123;
hr = IXmlReader_GetLinePosition(reader, &position);
- ok(hr == S_FALSE, "got %#x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(position == 0, "got %u\n", position);
position = 123;
hr = IXmlReader_GetLineNumber(reader, &position);
- ok(hr == S_FALSE, "got %#x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(position == 0, "got %u\n", position);
set_input_string(reader, xml);
@@ -2396,7 +2396,7 @@ static void test_reader_position(void)
TEST_READER_STATE(reader, XmlReadState_Initial);
TEST_READER_POSITION(reader, 0, 0);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "got type %d\n", type);
TEST_READER_POSITION2(reader, 1, 2, ~0u, 34);
@@ -2410,17 +2410,17 @@ static void test_reader_position(void)
TEST_READER_POSITION2(reader, 1, 2, ~0u, 34);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Whitespace, "got type %d\n", type);
TEST_READER_POSITION2(reader, 1, 35, 2, 6);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_EndElement, "got type %d\n", type);
TEST_READER_POSITION2(reader, 2, 3, 2, 6);
hr = IXmlReader_SetInput(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE2(reader, XmlReadState_Initial, XmlReadState_Closed);
TEST_READER_POSITION(reader, 0, 0);
@@ -2434,7 +2434,7 @@ static void test_string_pointers(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, "<elem xmlns=\"myns\">myns<elem2 /></elem>");
@@ -2565,67 +2565,67 @@ static void test_attribute_by_name(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "Failed to create reader, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, xml);
hr = IXmlReader_MoveToAttributeByName(reader, NULL, NULL);
- ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* WinXP */, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* WinXP */, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, emptyW, NULL);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
read_node(reader, XmlNodeType_Element);
hr = IXmlReader_MoveToAttributeByName(reader, emptyW, NULL);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
read_node(reader, XmlNodeType_Element);
hr = IXmlReader_MoveToAttributeByName(reader, NULL, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, NULL, xmlns_uriW);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, emptyW, xmlns_uriW);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, xmlnsW, NULL);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, xmlnsW, xmlns_uriW);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"myns");
hr = IXmlReader_MoveToAttributeByName(reader, aW, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"value a");
hr = IXmlReader_MoveToAttributeByName(reader, bW, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"value b");
hr = IXmlReader_MoveToAttributeByName(reader, aW, mynsW);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, nsW, NULL);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, nsW, xmlns_uriW);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"ns uri");
hr = IXmlReader_MoveToAttributeByName(reader, bW, emptyW);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"value b");
hr = IXmlReader_MoveToAttributeByName(reader, cW, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"value c2");
hr = IXmlReader_MoveToAttributeByName(reader, cW, nsuriW);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"value c");
IXmlReader_Release(reader);
diff --git a/dlls/xmllite/tests/writer.c b/dlls/xmllite/tests/writer.c
index c69aa42598d..8d096b0d632 100644
--- a/dlls/xmllite/tests/writer.c
+++ b/dlls/xmllite/tests/writer.c
@@ -41,7 +41,7 @@ static void _expect_ref(IUnknown *obj, ULONG ref, int line)
ULONG refcount;
IUnknown_AddRef(obj);
refcount = IUnknown_Release(obj);
- ok_(__FILE__, line)(refcount == ref, "expected refcount %d, got %d\n", ref, refcount);
+ ok_(__FILE__, line)(refcount == ref, "expected refcount %lu, got %lu.\n", ref, refcount);
}
static void check_output_raw(IStream *stream, const void *expected, SIZE_T size, int line)
@@ -52,10 +52,10 @@ static void check_output_raw(IStream *stream, const void *expected, SIZE_T size,
WCHAR *ptr;
hr = GetHGlobalFromStream(stream, &hglobal);
- ok_(__FILE__, line)(hr == S_OK, "Failed to get the stream handle, hr %#x.\n", hr);
+ ok_(__FILE__, line)(hr == S_OK, "Failed to get the stream handle, hr %#lx.\n", hr);
content_size = GlobalSize(hglobal);
- ok_(__FILE__, line)(size == content_size, "Unexpected test output size %ld.\n", content_size);
+ ok_(__FILE__, line)(size == content_size, "Unexpected test output size %Id.\n", content_size);
ptr = GlobalLock(hglobal);
if (size <= content_size)
ok_(__FILE__, line)(!memcmp(expected, ptr, size), "Unexpected output content.\n");
@@ -73,7 +73,7 @@ static void check_output(IStream *stream, const char *expected, BOOL todo, int l
char *ptr;
hr = GetHGlobalFromStream(stream, &hglobal);
- ok_(__FILE__, line)(hr == S_OK, "got 0x%08x\n", hr);
+ ok_(__FILE__, line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = GlobalSize(hglobal);
ptr = GlobalLock(hglobal);
@@ -111,7 +111,7 @@ static void writer_set_property(IXmlWriter *writer, XmlWriterProperty property)
HRESULT hr;
hr = IXmlWriter_SetProperty(writer, property, TRUE);
- ok(hr == S_OK, "Failed to set writer property, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set writer property, hr %#lx.\n", hr);
}
/* used to test all Write* methods for consistent error state */
@@ -123,67 +123,67 @@ static void check_writer_state(IXmlWriter *writer, HRESULT exp_hr)
/* FIXME: add WriteAttributes */
hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteCData(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteCharEntity(writer, aW[0]);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteChars(writer, aW, 1);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteComment(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteDocType(writer, aW, NULL, NULL, NULL);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteEntityRef(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteName(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteNmToken(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
/* FIXME: add WriteNode */
/* FIXME: add WriteNodeShallow */
hr = IXmlWriter_WriteProcessingInstruction(writer, aW, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteQualifiedName(writer, aW, NULL);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteRaw(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteRawChars(writer, aW, 1);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteString(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
/* FIXME: add WriteSurrogateCharEntity */
/* FIXME: add WriteWhitespace */
@@ -195,10 +195,10 @@ static IStream *writer_set_output(IXmlWriter *writer)
HRESULT hr;
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
return stream;
}
@@ -295,39 +295,39 @@ static void test_writer_create(void)
}
hr = CreateXmlWriter(&IID_IStream, (void **)&unk, NULL);
- ok(hr == E_NOINTERFACE, "got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriter(&IID_IUnknown, (void **)&unk, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(unk, &IID_IXmlWriter, (void **)&writer);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(unk == (IUnknown *)writer, "unexpected interface pointer\n");
IUnknown_Release(unk);
IXmlWriter_Release(writer);
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* check default properties values */
value = 0;
hr = IXmlWriter_GetProperty(writer, XmlWriterProperty_ByteOrderMark, &value);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
- ok(value == TRUE, "got %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == TRUE, "got %Id.\n", value);
value = TRUE;
hr = IXmlWriter_GetProperty(writer, XmlWriterProperty_Indent, &value);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
- ok(value == FALSE, "got %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == FALSE, "got %Id.\n", value);
value = TRUE;
hr = IXmlWriter_GetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, &value);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
- ok(value == FALSE, "got %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == FALSE, "got %Id.\n", value);
value = XmlConformanceLevel_Auto;
hr = IXmlWriter_GetProperty(writer, XmlWriterProperty_ConformanceLevel, &value);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
- ok(value == XmlConformanceLevel_Document, "got %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == XmlConformanceLevel_Document, "got %Id.\n", value);
IXmlWriter_Release(writer);
}
@@ -337,78 +337,78 @@ static void test_invalid_output_encoding(IXmlWriter *writer, IUnknown *output)
HRESULT hr;
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "Failed to set output, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set output, hr %#lx.\n", hr);
/* TODO: WriteAttributes */
hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCData(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCharEntity(writer, 0x100);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteChars(writer, aW, 1);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteDocType(writer, aW, NULL, NULL, NULL);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, NULL);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEntityRef(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteName(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteNmToken(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
/* TODO: WriteNode */
/* TODO: WriteNodeShallow */
hr = IXmlWriter_WriteProcessingInstruction(writer, aW, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteQualifiedName(writer, aW, NULL);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRawChars(writer, aW, 1);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteString(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
/* TODO: WriteSurrogateCharEntity */
- /* ًُُTODO: WriteWhitespace */
+ /* TODO: WriteWhitespace */
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
}
static void test_writeroutput(void)
@@ -425,15 +425,15 @@ static void test_writeroutput(void)
output = NULL;
hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, NULL, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(output, 1);
IUnknown_Release(output);
hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, utf16W, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
unk = NULL;
hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(unk != NULL && unk != output, "got %p, output %p\n", unk, output);
EXPECT_REF(output, 2);
@@ -444,14 +444,14 @@ static void test_writeroutput(void)
output = NULL;
hr = CreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, ~0u, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(output);
hr = CreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, CP_UTF8, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
unk = NULL;
hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(unk != NULL, "got %p\n", unk);
/* releasing 'unk' crashes on native */
IUnknown_Release(output);
@@ -460,27 +460,27 @@ static void test_writeroutput(void)
/* create with us-ascii */
output = NULL;
hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, usasciiW, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(output);
/* Output with codepage 1200. */
hr = CreateXmlWriter(&IID_IXmlWriter, (void **)&writer, NULL);
- ok(hr == S_OK, "Failed to create writer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create writer, hr %#lx.\n", hr);
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "Failed to create stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create stream, hr %#lx.\n", hr);
hr = CreateXmlWriterOutputWithEncodingCodePage((IUnknown *)stream, NULL, 1200, &output);
- ok(hr == S_OK, "Failed to create writer output, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create writer output, hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "Failed to set writer output, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set writer output, hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "Write failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "Write failed, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT_RAW(stream, utf16_outputW, sizeof(utf16_outputW));
@@ -489,11 +489,11 @@ static void test_writeroutput(void)
/* Create output with meaningless code page value. */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "Failed to create stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create stream, hr %#lx.\n", hr);
output = NULL;
hr = CreateXmlWriterOutputWithEncodingCodePage((IUnknown *)stream, NULL, ~0u, &output);
- ok(hr == S_OK, "Failed to create writer output, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create writer output, hr %#lx.\n", hr);
test_invalid_output_encoding(writer, output);
CHECK_OUTPUT(stream, "");
@@ -503,11 +503,11 @@ static void test_writeroutput(void)
/* Same, with invalid encoding name. */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
output = NULL;
hr = CreateXmlWriterOutputWithEncodingName((IUnknown *)stream, NULL, dummyW, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
test_invalid_output_encoding(writer, output);
CHECK_OUTPUT(stream, "");
@@ -532,55 +532,55 @@ static void test_writestartdocument(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* output not set */
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
/* nothing written yet */
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, fullprolog);
/* one more time */
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
/* now add PI manually, and try to start a document */
stream = writer_set_output(writer);
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
/* another attempt to add 'xml' PI */
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, prologversion);
@@ -589,23 +589,23 @@ static void test_writestartdocument(void)
/* create with us-ascii */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
output = NULL;
hr = CreateXmlWriterOutputWithEncodingName((IUnknown *)stream, NULL, usasciiW, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriter(&IID_IXmlWriter, (void **)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, prologversion2);
@@ -620,28 +620,28 @@ static void test_flush(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, (IUnknown*)&teststream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
g_write_len = 0;
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(g_write_len > 0, "got %d\n", g_write_len);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(g_write_len > 0, "Unexpected length %lu.\n", g_write_len);
g_write_len = 1;
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(g_write_len == 0, "got %d\n", g_write_len);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(g_write_len == 0, "Unexpected length %lu.\n", g_write_len);
/* Release() flushes too */
g_write_len = 1;
IXmlWriter_Release(writer);
- ok(g_write_len == 0, "got %d\n", g_write_len);
+ ok(g_write_len == 0, "Unexpected length %lu.\n", g_write_len);
}
static void test_omitxmldeclaration(void)
@@ -656,20 +656,20 @@ static void test_omitxmldeclaration(void)
char *ptr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = GetHGlobalFromStream(stream, &hglobal);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ptr = GlobalLock(hglobal);
ok(!ptr, "got %p\n", ptr);
@@ -677,7 +677,7 @@ static void test_omitxmldeclaration(void)
/* one more time */
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
@@ -685,35 +685,35 @@ static void test_omitxmldeclaration(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, prologversion);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, prologversion);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, prologversion);
/* another attempt to add 'xml' PI */
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
IXmlWriter_Release(writer);
@@ -735,25 +735,25 @@ static void test_bom(void)
HRESULT hr;
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* BOM is on by default */
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT_RAW(stream, bomW, sizeof(bomW));
@@ -762,19 +762,19 @@ static void test_bom(void)
/* start with PI */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT_RAW(stream, piW, sizeof(piW));
@@ -783,19 +783,19 @@ static void test_bom(void)
/* start with element */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT_RAW(stream, aopenW, sizeof(aopenW));
@@ -804,24 +804,24 @@ static void test_bom(void)
/* WriteElementString */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_Indent);
hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = GetHGlobalFromStream(stream, &hglobal);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT_RAW(stream, afullW, sizeof(afullW));
@@ -922,65 +922,65 @@ static void test_WriteStartElement(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<a");
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, NULL, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteProcessingInstruction(writer, aW, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
IXmlWriter_Release(writer);
/* WriteElementString */
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "b", NULL, "value");
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = write_start_element(writer, "prefix", "a", "uri");
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "b", NULL, "value");
- ok(hr == S_OK, "Failed to write element string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element string, hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "c", NULL, NULL);
- ok(hr == S_OK, "Failed to write element string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element string, hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "d", "uri");
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_start_element(writer, "", "e", "uri");
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_start_element(writer, "prefix2", "f", "uri");
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<prefix:a xmlns:prefix=\"uri\">"
@@ -1000,24 +1000,24 @@ static void test_WriteStartElement(void)
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "Failed to start document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start document, hr %#lx.\n", hr);
hr = write_start_element(writer, start_element_tests[i].prefix, start_element_tests[i].local,
start_element_tests[i].uri);
- ok(hr == start_element_tests[i].hr, "%u: unexpected hr %#x.\n", i, hr);
+ ok(hr == start_element_tests[i].hr, "%u: unexpected hr %#lx.\n", i, hr);
if (SUCCEEDED(start_element_tests[i].hr))
{
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, start_element_tests[i].output_partial, start_element_tests[i].todo_partial, __LINE__);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "Failed to end document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end document, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, start_element_tests[i].output, start_element_tests[i].todo, __LINE__);
}
@@ -1072,54 +1072,54 @@ static void test_WriteElementString(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "b", NULL, "value");
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "b", NULL, "value");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "b", NULL, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix", "b", "uri", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, "prefix", "c", "uri");
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix", "d", NULL, NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix2", "d", "uri", NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "e", "uri", NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix", "f", "uri2", NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "g", "uri3", NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix", "h", NULL, NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix_i", "i", NULL, NULL);
- ok(hr == WR_E_NSPREFIXWITHEMPTYNSURI, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == WR_E_NSPREFIXWITHEMPTYNSURI, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, "", "j", "uri", NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a><b>value</b><b />"
@@ -1142,24 +1142,24 @@ static void test_WriteElementString(void)
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "Failed to start document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start document, hr %#lx.\n", hr);
hr = write_element_string(writer, element_string_tests[i].prefix, element_string_tests[i].local,
element_string_tests[i].uri, element_string_tests[i].value);
- ok(hr == element_string_tests[i].hr, "%u: unexpected hr %#x.\n", i, hr);
+ ok(hr == element_string_tests[i].hr, "%u: unexpected hr %#lx.\n", i, hr);
if (SUCCEEDED(element_string_tests[i].hr))
{
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, element_string_tests[i].output, element_string_tests[i].todo, __LINE__);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "Failed to end document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end document, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, element_string_tests[i].output, element_string_tests[i].todo, __LINE__);
}
@@ -1177,24 +1177,24 @@ static void test_WriteEndElement(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<a><b /></a>");
@@ -1213,47 +1213,47 @@ static void test_writeenddocument(void)
char *ptr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
/* WriteEndDocument resets it to initial state */
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = GetHGlobalFromStream(stream, &hglobal);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ptr = GlobalLock(hglobal);
ok(ptr == NULL, "got %p\n", ptr);
/* we still need to flush manually, WriteEndDocument doesn't do that */
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<a><b /></a>");
@@ -1271,35 +1271,35 @@ static void test_WriteComment(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteComment(writer, aW);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, aW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, aW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, closeW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<!--a--><b><!--a--><!----><!--- ->-->");
@@ -1318,32 +1318,32 @@ static void test_WriteCData(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteCData(writer, aW);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCData(writer, aW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCData(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCData(writer, closeW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCData(writer, close2W);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<b>"
@@ -1367,48 +1367,48 @@ static void test_WriteRaw(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, rawW);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = IXmlWriter_WriteRaw(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, rawW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, rawW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, rawW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, rawW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, aW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, rawW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, rawW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>a<:a<:<!--a<:-->a<:<a>a</a>");
@@ -1424,7 +1424,7 @@ static void test_writer_state(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* initial state */
check_writer_state(writer, E_UNEXPECTED);
@@ -1433,7 +1433,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1442,7 +1442,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1451,7 +1451,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1460,7 +1460,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1469,7 +1469,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteCData(writer, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1478,7 +1478,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteName(writer, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1487,7 +1487,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteNmToken(writer, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1496,7 +1496,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteString(writer, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1514,7 +1514,7 @@ static void test_indentation(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
@@ -1522,22 +1522,22 @@ static void test_indentation(void)
writer_set_property(writer, XmlWriterProperty_Indent);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, commentW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -1551,19 +1551,19 @@ static void test_indentation(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteElementString(writer, NULL, bW, NULL, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteElementString(writer, NULL, bW, NULL, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -1678,7 +1678,7 @@ static void test_WriteAttributeString(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
@@ -1687,26 +1687,26 @@ static void test_WriteAttributeString(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "Failed to start document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start document, hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "e", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_attribute_string(writer, attribute_tests[i].prefix, attribute_tests[i].local,
attribute_tests[i].uri, attribute_tests[i].value);
todo_wine_if(attribute_tests[i].todo_hr)
- ok(hr == attribute_tests[i].hr, "%u: unexpected hr %#x, expected %#x.\n", i, hr, attribute_tests[i].hr);
+ ok(hr == attribute_tests[i].hr, "%u: unexpected hr %#lx, expected %#lx.\n", i, hr, attribute_tests[i].hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, attribute_tests[i].output_partial, attribute_tests[i].todo_partial, __LINE__);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "Failed to end document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end document, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, attribute_tests[i].output, attribute_tests[i].todo, __LINE__);
IStream_Release(stream);
@@ -1716,41 +1716,41 @@ static void test_WriteAttributeString(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, "p", "a", "outeruri");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, "prefix", "local", "uri", "b");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, NULL, "a", NULL, "b");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, "xmlns", "prefix", NULL, "uri");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, "p", "attr", NULL, "value");
- ok(hr == S_OK, "Failed to write attribute string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write attribute string, hr %#lx.\n", hr);
hr = write_attribute_string(writer, "prefix", "local", NULL, "b");
todo_wine
- ok(hr == WR_E_DUPLICATEATTRIBUTE, "got 0x%08x\n", hr);
+ ok(hr == WR_E_DUPLICATEATTRIBUTE, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, NULL, "attr2", "outeruri", "value");
- ok(hr == S_OK, "Failed to write attribute string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write attribute string, hr %#lx.\n", hr);
hr = write_attribute_string(writer, "pr", "attr3", "outeruri", "value");
- ok(hr == S_OK, "Failed to write attribute string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write attribute string, hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT_TODO(stream,
"<p:a prefix:local=\"b\" a=\"b\" xmlns:prefix=\"uri\" p:attr=\"value\" xmlns:p=\"outeruri\">"
@@ -1763,22 +1763,22 @@ static void test_WriteAttributeString(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "e", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, "xmlns", "prefix", NULL, "uri");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, "prefix", "attr", NULL, "value");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<e xmlns:prefix=\"uri\" prefix:attr=\"value\" />");
@@ -1796,7 +1796,7 @@ static void test_WriteFullEndElement(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* standalone element */
stream = writer_set_output(writer);
@@ -1805,19 +1805,19 @@ static void test_WriteFullEndElement(void)
writer_set_property(writer, XmlWriterProperty_Indent);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a></a>");
@@ -1830,22 +1830,22 @@ static void test_WriteFullEndElement(void)
writer_set_property(writer, XmlWriterProperty_Indent);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -1864,7 +1864,7 @@ static void test_WriteCharEntity(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* without indentation */
stream = writer_set_output(writer);
@@ -1872,22 +1872,22 @@ static void test_WriteCharEntity(void)
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCharEntity(writer, 0x100);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>Ā<a /></a>");
@@ -1903,39 +1903,39 @@ static void test_WriteString(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = write_string(writer, "a");
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, "");
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, "");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, "a");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* WriteString automatically escapes markup characters */
hr = write_string(writer, "<&\">=");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<b>a<&\">=");
@@ -1944,22 +1944,22 @@ static void test_WriteString(void)
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<b");
hr = write_string(writer, "");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<b>");
@@ -1969,43 +1969,43 @@ static void test_WriteString(void)
/* With indentation */
hr = CreateXmlWriter(&IID_IXmlWriter, (void **)&writer, NULL);
- ok(hr == S_OK, "Failed to create a writer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a writer, hr %#lx.\n", hr);
stream = writer_set_output(writer);
writer_set_property(writer, XmlWriterProperty_Indent);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_string(writer, "text");
- ok(hr == S_OK, "Failed to write a string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write a string, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
" <b>text");
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
" <b>text</b>");
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2017,29 +2017,29 @@ static void test_WriteString(void)
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
" <b />");
hr = write_start_element(writer, NULL, "c", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_attribute_string(writer, NULL, "attr", NULL, "value");
- ok(hr == S_OK, "Failed to write attribute string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write attribute string, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2047,10 +2047,10 @@ static void test_WriteString(void)
" <c attr=\"value\"");
hr = write_string(writer, "text");
- ok(hr == S_OK, "Failed to write a string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write a string, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2058,10 +2058,10 @@ static void test_WriteString(void)
" <c attr=\"value\">text");
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2069,16 +2069,16 @@ static void test_WriteString(void)
" <c attr=\"value\">text</c>");
hr = write_start_element(writer, NULL, "d", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_string(writer, "");
- ok(hr == S_OK, "Failed to write a string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write a string, hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2087,10 +2087,10 @@ static void test_WriteString(void)
" <d></d>");
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2163,23 +2163,23 @@ static void test_WriteDocType(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void **)&writer, NULL);
- ok(hr == S_OK, "Failed to create writer instance, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create writer instance, hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = IXmlWriter_WriteDocType(writer, NULL, NULL, NULL, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteDocType(writer, emptyW, NULL, NULL, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Name validation. */
hr = IXmlWriter_WriteDocType(writer, nameW, NULL, NULL, NULL);
- ok(hr == WC_E_NAMECHARACTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == WC_E_NAMECHARACTER, "Unexpected hr %#lx.\n", hr);
/* Pubid validation. */
hr = IXmlWriter_WriteDocType(writer, aW, pubidW, NULL, NULL);
- ok(hr == WC_E_PUBLICID, "Unexpected hr %#x.\n", hr);
+ ok(hr == WC_E_PUBLICID, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
@@ -2189,16 +2189,16 @@ static void test_WriteDocType(void)
hr = write_doctype(writer, doctype_tests[i].name, doctype_tests[i].pubid, doctype_tests[i].sysid,
doctype_tests[i].subset);
- ok(hr == S_OK, "%u: failed to write doctype, hr %#x.\n", i, hr);
+ ok(hr == S_OK, "%u: failed to write doctype, hr %#lx.\n", i, hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream, doctype_tests[i].output);
hr = write_doctype(writer, doctype_tests[i].name, doctype_tests[i].pubid, doctype_tests[i].sysid,
doctype_tests[i].subset);
- ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#x.\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
}
--
2.34.1
1
0
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/xmllite/tests/Makefile.in | 1 -
dlls/xmllite/tests/reader.c | 488 +++++++++++------------
dlls/xmllite/tests/writer.c | 694 ++++++++++++++++-----------------
3 files changed, 591 insertions(+), 592 deletions(-)
diff --git a/dlls/xmllite/tests/Makefile.in b/dlls/xmllite/tests/Makefile.in
index 1548dc50193..6a87e6663aa 100644
--- a/dlls/xmllite/tests/Makefile.in
+++ b/dlls/xmllite/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = xmllite.dll
IMPORTS = xmllite ole32
diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c
index c4e53a5c40c..d0d2373aaf1 100644
--- a/dlls/xmllite/tests/reader.c
+++ b/dlls/xmllite/tests/reader.c
@@ -50,7 +50,7 @@ static IStream *create_stream_on_data(const void *data, unsigned int size)
memcpy(ptr, data, size);
hr = CreateStreamOnHGlobal(hglobal, TRUE, &stream);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(stream != NULL, "Expected non-NULL stream\n");
GlobalUnlock(hglobal);
@@ -209,7 +209,7 @@ static void _set_input_string(unsigned line, IXmlReader *reader, const char *xml
stream = create_stream_on_data(xml, strlen(xml));
hr = IXmlReader_SetInput(reader, (IUnknown *)stream);
- ok_(__FILE__,line)(hr == S_OK, "got %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
}
@@ -222,9 +222,9 @@ static void _read_node(unsigned line, IXmlReader *reader, XmlNodeType expected_t
hr = IXmlReader_Read(reader, &type);
if (expected_type == XmlNodeType_None)
- ok_(__FILE__,line)(hr == S_FALSE, "Read returned %08x, expected S_FALSE\n", hr);
+ ok_(__FILE__,line)(hr == S_FALSE, "Read returned %#lx, expected S_FALSE.\n", hr);
else
- ok_(__FILE__,line)(hr == S_OK, "Read returned %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Read returned %#lx.\n", hr);
ok_(__FILE__,line)(type == expected_type, "read type %d, expected %d\n", type, expected_type);
}
@@ -233,7 +233,7 @@ static void _next_attribute(unsigned line, IXmlReader *reader)
{
HRESULT hr;
hr = IXmlReader_MoveToNextAttribute(reader);
- ok_(__FILE__,line)(hr == S_OK, "MoveToNextAttribute returned %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
#define move_to_element(a) _move_to_element(__LINE__,a)
@@ -241,7 +241,7 @@ static void _move_to_element(unsigned line, IXmlReader *reader)
{
HRESULT hr;
hr = IXmlReader_MoveToElement(reader);
- ok_(__FILE__,line)(hr == S_OK, "MoveToElement failed: %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
static void test_read_state(IXmlReader *reader, XmlReadState expected,
@@ -269,11 +269,11 @@ static void test_read_state(IXmlReader *reader, XmlReadState expected,
static const WCHAR *_reader_value(unsigned line, IXmlReader *reader, const WCHAR *expect)
{
const WCHAR *str = (void*)0xdeadbeef;
- ULONG len = 0xdeadbeef;
+ UINT len = 0xdeadbeef;
HRESULT hr;
hr = IXmlReader_GetValue(reader, &str, &len);
- ok_(__FILE__,line)(hr == S_OK, "GetValue returned %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_(__FILE__,line)(len == lstrlenW(str), "len = %u\n", len);
ok_(__FILE__,line)(!lstrcmpW(str, expect), "value = %s\n", wine_dbgstr_w(str));
return str;
@@ -283,12 +283,12 @@ static const WCHAR *_reader_value(unsigned line, IXmlReader *reader, const WCHAR
static const WCHAR *_reader_name(unsigned line, IXmlReader *reader, const WCHAR *expect)
{
const WCHAR *str = (void*)0xdeadbeef;
- ULONG len = 0xdeadbeef;
+ UINT len = 0xdeadbeef;
HRESULT hr;
hr = IXmlReader_GetLocalName(reader, &str, &len);
- ok_(__FILE__,line)(hr == S_OK, "GetLocalName returned %08x\n", hr);
- ok_(__FILE__,line)(len == lstrlenW(str), "len = %u\n", len);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok_(__FILE__,line)(len == lstrlenW(str), "len = %u.\n", len);
ok_(__FILE__,line)(!lstrcmpW(str, expect), "name = %s\n", wine_dbgstr_w(str));
return str;
}
@@ -297,12 +297,12 @@ static const WCHAR *_reader_name(unsigned line, IXmlReader *reader, const WCHAR
static const WCHAR *_reader_prefix(unsigned line, IXmlReader *reader, const WCHAR *expect)
{
const WCHAR *str = (void*)0xdeadbeef;
- ULONG len = 0xdeadbeef;
+ UINT len = 0xdeadbeef;
HRESULT hr;
hr = IXmlReader_GetPrefix(reader, &str, &len);
- ok_(__FILE__,line)(hr == S_OK, "GetPrefix returned %08x\n", hr);
- ok_(__FILE__,line)(len == lstrlenW(str), "len = %u\n", len);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok_(__FILE__,line)(len == lstrlenW(str), "len = %u.\n", len);
ok_(__FILE__,line)(!lstrcmpW(str, expect), "prefix = %s\n", wine_dbgstr_w(str));
return str;
}
@@ -311,12 +311,12 @@ static const WCHAR *_reader_prefix(unsigned line, IXmlReader *reader, const WCHA
static const WCHAR *_reader_namespace(unsigned line, IXmlReader *reader, const WCHAR *expect)
{
const WCHAR *str = (void*)0xdeadbeef;
- ULONG len = 0xdeadbeef;
+ UINT len = 0xdeadbeef;
HRESULT hr;
hr = IXmlReader_GetNamespaceUri(reader, &str, &len);
- ok_(__FILE__,line)(hr == S_OK, "GetNamespaceUri returned %08x\n", hr);
- ok_(__FILE__,line)(len == lstrlenW(str), "len = %u\n", len);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok_(__FILE__,line)(len == lstrlenW(str), "len = %u.\n", len);
ok_(__FILE__,line)(!lstrcmpW(str, expect), "namespace = %s\n", wine_dbgstr_w(str));
return str;
}
@@ -325,12 +325,12 @@ static const WCHAR *_reader_namespace(unsigned line, IXmlReader *reader, const W
static const WCHAR *_reader_qname(IXmlReader *reader, const WCHAR *expect, unsigned line)
{
const WCHAR *str = (void*)0xdeadbeef;
- ULONG len = 0xdeadbeef;
+ UINT len = 0xdeadbeef;
HRESULT hr;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok_(__FILE__,line)(hr == S_OK, "GetQualifiedName returned %08x\n", hr);
- ok_(__FILE__,line)(len == lstrlenW(str), "len = %u\n", len);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok_(__FILE__,line)(len == lstrlenW(str), "len = %u.\n", len);
ok_(__FILE__,line)(!lstrcmpW(str, expect), "name = %s\n", wine_dbgstr_w(str));
return str;
}
@@ -343,7 +343,7 @@ static void _read_value_char(IXmlReader *reader, WCHAR expected_char, unsigned l
HRESULT hr;
hr = IXmlReader_ReadValueChunk(reader, &c, 1, &count);
- ok_(__FILE__,line)(hr == S_OK, "got %08x\n", hr);
+ ok_(__FILE__,line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_(__FILE__,line)(count == 1, "got %u\n", c);
ok_(__FILE__,line)(c == expected_char, "got %x\n", c);
}
@@ -528,84 +528,84 @@ static void test_reader_create(void)
}
hr = CreateXmlReader(&IID_IStream, (void **)&unk, NULL);
- ok(hr == E_NOINTERFACE, "got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlReader(&IID_IUnknown, (void **)&unk, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(unk, &IID_IXmlReader, (void **)&reader);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(unk == (IUnknown *)reader, "unexpected interface\n");
IXmlReader_Release(reader);
IUnknown_Release(unk);
hr = CreateXmlReader(&IID_IUnknown, (void **)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IXmlReader_Release(reader);
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE(reader, XmlReadState_Closed);
nodetype = XmlNodeType_Element;
hr = IXmlReader_GetNodeType(reader, &nodetype);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "got %d\n", nodetype);
/* crashes on XP, 2k3, works on newer versions */
if (0)
{
hr = IXmlReader_GetNodeType(reader, NULL);
- ok(hr == E_INVALIDARG, "got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
}
resolver = (void*)0xdeadbeef;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_XmlResolver, (LONG_PTR*)&resolver);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(resolver == NULL, "got %p\n", resolver);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_XmlResolver, 0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_XmlResolver, (LONG_PTR)&testresolver);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
resolver = NULL;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_XmlResolver, (LONG_PTR*)&resolver);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(resolver == &testresolver, "got %p\n", resolver);
IXmlResolver_Release(resolver);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_XmlResolver, 0);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
dtd = 2;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_DtdProcessing, (LONG_PTR*)&dtd);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(dtd == DtdProcessing_Prohibit, "got %d\n", dtd);
dtd = 2;
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, dtd);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, -1);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Null input pointer, releases previous input */
hr = IXmlReader_SetInput(reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE2(reader, XmlReadState_Initial, XmlReadState_Closed);
/* test input interface selection sequence */
hr = testinput_createinstance((void**)&input);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
{
input_iids.count = 0;
hr = IXmlReader_SetInput(reader, input);
- ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok_iids(&input_iids, setinput_full, setinput_full_old, FALSE);
IUnknown_Release(input);
}
@@ -623,71 +623,71 @@ static void test_readerinput(void)
LONG ref;
hr = CreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, NULL);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, &reader_input);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ref = IStream_AddRef(stream);
- ok(ref == 2, "Expected 2, got %d\n", ref);
+ ok(ref == 2, "Expected 2, got %ld.\n", ref);
IStream_Release(stream);
hr = CreateXmlReaderInputWithEncodingName((IUnknown*)stream, NULL, NULL, FALSE, NULL, &reader_input);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(reader_input, &IID_IStream, (void**)&stream2);
- ok(hr == E_NOINTERFACE, "Expected S_OK, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(reader_input, &IID_ISequentialStream, (void**)&stream2);
- ok(hr == E_NOINTERFACE, "Expected S_OK, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
/* IXmlReaderInput grabs a stream reference */
ref = IStream_AddRef(stream);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IStream_Release(stream);
/* try ::SetInput() with valid IXmlReaderInput */
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ref = IUnknown_AddRef(reader_input);
- ok(ref == 2, "Expected 2, got %d\n", ref);
+ ok(ref == 2, "Expected 2, got %ld.\n", ref);
IUnknown_Release(reader_input);
hr = IXmlReader_SetInput(reader, reader_input);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE(reader, XmlReadState_Initial);
nodetype = XmlNodeType_Element;
hr = IXmlReader_GetNodeType(reader, &nodetype);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "got %d\n", nodetype);
/* IXmlReader grabs a IXmlReaderInput reference */
ref = IUnknown_AddRef(reader_input);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IUnknown_Release(reader_input);
ref = IStream_AddRef(stream);
- ok(ref == 4, "Expected 4, got %d\n", ref);
+ ok(ref == 4, "Expected 4, got %ld.\n", ref);
IStream_Release(stream);
/* reset input and check state */
hr = IXmlReader_SetInput(reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE2(reader, XmlReadState_Initial, XmlReadState_Closed);
IXmlReader_Release(reader);
ref = IStream_AddRef(stream);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IStream_Release(stream);
ref = IUnknown_AddRef(reader_input);
- ok(ref == 2, "Expected 2, got %d\n", ref);
+ ok(ref == 2, "Expected 2, got %ld.\n", ref);
IUnknown_Release(reader_input);
/* IID_IXmlReaderInput */
@@ -696,9 +696,9 @@ static void test_readerinput(void)
Such query will be used only to check if input is really IXmlReaderInput */
obj = (IUnknown*)0xdeadbeef;
hr = IUnknown_QueryInterface(reader_input, &IID_IXmlReaderInput, (void**)&obj);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ref = IUnknown_AddRef(reader_input);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IUnknown_Release(reader_input);
IUnknown_Release(reader_input);
@@ -708,59 +708,59 @@ static void test_readerinput(void)
/* test input interface selection sequence */
input = NULL;
hr = testinput_createinstance((void**)&input);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
input_iids.count = 0;
ref = IUnknown_AddRef(input);
- ok(ref == 2, "Expected 2, got %d\n", ref);
+ ok(ref == 2, "Expected 2, got %ld.\n", ref);
IUnknown_Release(input);
hr = CreateXmlReaderInputWithEncodingName(input, NULL, NULL, FALSE, NULL, &reader_input);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok_iids(&input_iids, empty_seq, NULL, FALSE);
/* IXmlReaderInput stores stream interface as IUnknown */
ref = IUnknown_AddRef(input);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IUnknown_Release(input);
hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
input_iids.count = 0;
ref = IUnknown_AddRef(reader_input);
- ok(ref == 2, "Expected 2, got %d\n", ref);
+ ok(ref == 2, "Expected 2, got %ld.\n", ref);
IUnknown_Release(reader_input);
ref = IUnknown_AddRef(input);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IUnknown_Release(input);
hr = IXmlReader_SetInput(reader, reader_input);
- ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok_iids(&input_iids, setinput_readerinput, NULL, FALSE);
TEST_READER_STATE(reader, XmlReadState_Closed);
ref = IUnknown_AddRef(input);
- ok(ref == 3, "Expected 3, got %d\n", ref);
+ ok(ref == 3, "Expected 3, got %ld.\n", ref);
IUnknown_Release(input);
ref = IUnknown_AddRef(reader_input);
ok(ref == 3 || broken(ref == 2) /* versions 1.0.x and 1.1.x - XP, Vista */,
- "Expected 3, got %d\n", ref);
+ "Expected 3, got %ld.\n", ref);
IUnknown_Release(reader_input);
/* repeat another time, no check or caching here */
input_iids.count = 0;
hr = IXmlReader_SetInput(reader, reader_input);
- ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok_iids(&input_iids, setinput_readerinput, NULL, FALSE);
/* another reader */
hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader2, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* resolving from IXmlReaderInput to IStream/ISequentialStream is done at
::SetInput() level, each time it's called */
input_iids.count = 0;
hr = IXmlReader_SetInput(reader2, reader_input);
- ok(hr == E_NOINTERFACE, "Expected E_NOINTERFACE, got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok_iids(&input_iids, setinput_readerinput, NULL, FALSE);
IXmlReader_Release(reader2);
@@ -777,11 +777,11 @@ static void test_reader_state(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* invalid arguments */
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_ReadState, NULL);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* attempt to read on closed reader */
TEST_READER_STATE(reader, XmlReadState_Closed);
@@ -790,7 +790,7 @@ if (0)
{
/* newer versions crash here, probably because no input was set */
hr = IXmlReader_Read(reader, &nodetype);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
}
set_input_string(reader, "xml");
TEST_READER_STATE(reader, XmlReadState_Initial);
@@ -798,7 +798,7 @@ if (0)
nodetype = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &nodetype);
todo_wine
- ok(FAILED(hr), "got %08x\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "Unexpected node type %d\n", nodetype);
todo_wine
@@ -807,7 +807,7 @@ if (0)
nodetype = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &nodetype);
todo_wine
- ok(FAILED(hr), "got %08x\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "Unexpected node type %d\n", nodetype);
IXmlReader_Release(reader);
@@ -850,26 +850,26 @@ static void test_read_xmldeclaration(void)
const WCHAR *val;
hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stream = create_stream_on_data(xmldecl_full, sizeof(xmldecl_full));
hr = IXmlReader_SetInput(reader, (IUnknown*)stream);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 0, "got %d\n", count);
/* try to move without attributes */
hr = IXmlReader_MoveToElement(reader);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToNextAttribute(reader);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
TEST_READER_POSITION(reader, 0, 0);
@@ -890,7 +890,7 @@ static void test_read_xmldeclaration(void)
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
TEST_READER_POSITION2(reader, 1, 7, ~0u, 55);
@@ -899,40 +899,40 @@ static void test_read_xmldeclaration(void)
next_attribute(reader);
next_attribute(reader);
hr = IXmlReader_MoveToNextAttribute(reader);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_POSITION2(reader, 1, 7, ~0u, 55);
hr = IXmlReader_GetAttributeCount(reader, NULL);
- ok(hr == E_INVALIDARG, "got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 3, "Expected 3, got %d\n", count);
for (i = 0; i < count; i++)
{
len = 0;
hr = IXmlReader_GetLocalName(reader, &val, &len);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == lstrlenW(name_val[i].name), "expected %u, got %u\n", lstrlenW(name_val[i].name), len);
ok(!lstrcmpW(name_val[i].name, val), "expected %s, got %s\n", wine_dbgstr_w(name_val[i].name), wine_dbgstr_w(val));
len = 0;
hr = IXmlReader_GetValue(reader, &val, &len);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == lstrlenW(name_val[i].val), "expected %u, got %u\n", lstrlenW(name_val[i].val), len);
ok(!lstrcmpW(name_val[i].val, val), "expected %s, got %s\n", wine_dbgstr_w(name_val[i].val), wine_dbgstr_w(val));
hr = IXmlReader_MoveToNextAttribute(reader);
- ok(hr == ((i < count - 1) ? S_OK : S_FALSE), "got %08x\n", hr);
+ ok(hr == ((i < count - 1) ? S_OK : S_FALSE), "Unexpected hr %#lx.\n", hr);
}
TEST_DEPTH(reader, 1);
@@ -942,7 +942,7 @@ static void test_read_xmldeclaration(void)
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_XmlDeclaration, "got %d\n", type);
type = XmlNodeType_XmlDeclaration;
@@ -950,7 +950,7 @@ static void test_read_xmldeclaration(void)
/* newer versions return syntax error here cause document is incomplete,
it makes more sense than invalid char error */
todo_wine {
- ok(hr == WC_E_SYNTAX || broken(hr == WC_E_XMLCHARACTER), "got 0x%08x\n", hr);
+ ok(hr == WC_E_SYNTAX || broken(hr == WC_E_XMLCHARACTER), "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "got %d\n", type);
}
IStream_Release(stream);
@@ -959,14 +959,14 @@ todo_wine {
stream = create_stream_on_data(xmldecl_short, sizeof(xmldecl_short));
hr = IXmlReader_SetInput(reader, (IUnknown *)stream);
- ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
read_node(reader, XmlNodeType_XmlDeclaration);
TEST_READER_POSITION2(reader, 1, 3, ~0u, 21);
TEST_READER_STATE(reader, XmlReadState_Interactive);
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "expected 1, got %d\n", count);
ret = IXmlReader_IsEmptyElement(reader);
@@ -982,20 +982,20 @@ todo_wine {
type = -1;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
TEST_READER_POSITION2(reader, 1, 7, ~0u, 21);
/* try to move from last attribute */
hr = IXmlReader_MoveToNextAttribute(reader);
- ok(hr == S_FALSE, "expected S_FALSE, got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
read_node(reader, XmlNodeType_Element);
TEST_READER_POSITION2(reader, 1, 23, ~0u, 40);
TEST_READER_STATE(reader, XmlReadState_Interactive);
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 0, "expected 0, got %d\n", count);
ret = IXmlReader_IsEmptyElement(reader);
@@ -1007,7 +1007,7 @@ todo_wine {
type = -1;
hr = IXmlReader_Read(reader, &type);
todo_wine
- ok(hr == WC_E_SYNTAX || hr == WC_E_XMLCHARACTER /* XP */, "expected WC_E_SYNTAX, got %08x\n", hr);
+ ok(hr == WC_E_SYNTAX || hr == WC_E_XMLCHARACTER /* XP */, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "expected XmlNodeType_None, got %s\n", type_to_str(type));
TEST_READER_POSITION(reader, 1, 41);
todo_wine
@@ -1053,7 +1053,7 @@ static void test_read_comment(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, teststr);
@@ -1066,7 +1066,7 @@ static void test_read_comment(void)
if (type == XmlNodeType_Text || type == XmlNodeType_Comment)
{
hr = IXmlReader_GetValue(reader, &value, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*value != 0, "Expected node value\n");
}
i++;
@@ -1079,9 +1079,9 @@ static void test_read_comment(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
if (test->hr_broken)
- ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr || broken(hr == test->hr_broken), "Unexpected hr %#lx, for %s.\n", hr, test->xml);
else
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1092,14 +1092,14 @@ static void test_read_comment(void)
str = NULL;
hr = IXmlReader_GetLocalName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
reader_qname(reader, L"");
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
/* value */
@@ -1134,7 +1134,7 @@ static void test_read_pi(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1145,9 +1145,9 @@ static void test_read_pi(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
if (test->hr_broken)
- ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr || broken(hr == test->hr_broken), "Unexpected hr %#lx, for %s.\n", hr, test->xml);
else
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1160,7 +1160,7 @@ static void test_read_pi(void)
len = 0;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == lstrlenW(test->name), "got %u\n", len);
ok(!lstrcmpW(str, test->name), "got %s\n", wine_dbgstr_w(str));
@@ -1230,7 +1230,7 @@ static void test_read_full(void)
int i;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, test->xml);
@@ -1257,10 +1257,10 @@ static void test_read_public_dtd(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, DtdProcessing_Parse);
- ok(hr == S_OK, "got 0x%8x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, test_public_dtd);
@@ -1268,15 +1268,15 @@ static void test_read_public_dtd(void)
count = 0;
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 2, "got %d\n", count);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
reader_name(reader, L"PUBLIC");
@@ -1286,7 +1286,7 @@ static void test_read_public_dtd(void)
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
reader_name(reader, L"SYSTEM");
@@ -1298,7 +1298,7 @@ static void test_read_public_dtd(void)
len = 0;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine {
ok(len == lstrlenW(dtdnameW), "got %u\n", len);
ok(!lstrcmpW(str, dtdnameW), "got %s\n", wine_dbgstr_w(str));
@@ -1320,10 +1320,10 @@ static void test_read_system_dtd(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, DtdProcessing_Parse);
- ok(hr == S_OK, "got 0x%8x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, test_system_dtd);
@@ -1331,15 +1331,15 @@ static void test_read_system_dtd(void)
count = 0;
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "got %d\n", count);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "got %d\n", type);
reader_name(reader, L"SYSTEM");
@@ -1351,7 +1351,7 @@ static void test_read_system_dtd(void)
len = 0;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine {
ok(len == lstrlenW(dtdnameW), "got %u\n", len);
ok(!lstrcmpW(str, dtdnameW), "got %s\n", wine_dbgstr_w(str));
@@ -1397,7 +1397,7 @@ static void test_read_element(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1406,10 +1406,10 @@ static void test_read_element(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
if (test->hr_broken)
- ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr || broken(hr == test->hr_broken), "Unexpected hr %#lx, for %s.\n", hr, test->xml);
else
todo_wine_if(test->hr == NC_E_UNDECLAREDPREFIX)
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1420,7 +1420,7 @@ static void test_read_element(void)
len = 0;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == lstrlenW(test->name), "got %u\n", len);
ok(!lstrcmpW(str, test->name), "got %s\n", wine_dbgstr_w(str));
@@ -1444,7 +1444,7 @@ static void test_read_element(void)
depth = 123;
hr = IXmlReader_GetDepth(reader, &depth);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(depth == depths[i], "%u: got depth %u, expected %u\n", i, depth, depths[i]);
if (type == XmlNodeType_Element || type == XmlNodeType_EndElement)
@@ -1453,7 +1453,7 @@ static void test_read_element(void)
prefix = NULL;
hr = IXmlReader_GetPrefix(reader, &prefix, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(prefix != NULL, "got %p\n", prefix);
if (!*prefix)
@@ -1462,12 +1462,12 @@ static void test_read_element(void)
local = NULL;
hr = IXmlReader_GetLocalName(reader, &local, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(local != NULL, "got %p\n", local);
qname = NULL;
hr = IXmlReader_GetQualifiedName(reader, &qname, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(qname != NULL, "got %p\n", qname);
ok(local == qname, "expected same pointer\n");
@@ -1478,7 +1478,7 @@ static void test_read_element(void)
{
count = 1;
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 0, "got %u\n", count);
}
@@ -1486,7 +1486,7 @@ static void test_read_element(void)
{
count = 0;
hr = IXmlReader_GetAttributeCount(reader, &count);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* moving to attributes increases depth */
if (count)
@@ -1496,14 +1496,14 @@ static void test_read_element(void)
reader_value(reader, L"");
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetValue(reader, &value, NULL);
ok(*value != 0, "Unexpected value %s\n", wine_dbgstr_w(value));
depth = 123;
hr = IXmlReader_GetDepth(reader, &depth);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(depth == depths[i] + 1, "%u: got depth %u, expected %u\n", i, depth, depths[i] + 1);
move_to_element(reader);
@@ -1511,7 +1511,7 @@ static void test_read_element(void)
depth = 123;
hr = IXmlReader_GetDepth(reader, &depth);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(depth == depths[i], "%u: got depth %u, expected %u\n", i, depth, depths[i]);
}
}
@@ -1526,7 +1526,7 @@ static void test_read_element(void)
type = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &type);
- ok(hr == WC_E_ELEMENTMATCH, "got %08x\n", hr);
+ ok(hr == WC_E_ELEMENTMATCH, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "got %d\n", type);
TEST_READER_STATE(reader, XmlReadState_Error);
@@ -1544,16 +1544,16 @@ static void test_read_pending(void)
int c;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetInput(reader, (IUnknown*)&teststream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* first read call returns incomplete node, second attempt fails with E_PENDING */
stream_readcall = 0;
type = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK || broken(hr == E_PENDING), "got 0x%08x\n", hr);
+ ok(hr == S_OK || broken(hr == E_PENDING), "Unexpected hr %#lx.\n", hr);
/* newer versions are happy when it's enough data to detect node type,
older versions keep reading until it fails to read more */
todo_wine
@@ -1564,7 +1564,7 @@ static void test_read_pending(void)
c = stream_readcall;
value = (void*)0xdeadbeef;
hr = IXmlReader_GetValue(reader, &value, NULL);
- ok(hr == E_PENDING, "got 0x%08x\n", hr);
+ ok(hr == E_PENDING, "Unexpected hr %#lx.\n", hr);
ok(value == NULL || broken(value == (void*)0xdeadbeef) /* Win8 sets it to NULL */, "got %p\n", value);
ok(c < stream_readcall || broken(c == stream_readcall), "got %d, expected %d\n", stream_readcall, c+1);
@@ -1581,12 +1581,12 @@ static void test_readvaluechunk(void)
UINT c;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, "<!-- comment1 --><!-- comment2 -->");
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Comment, "type = %u\n", type);
read_value_char(reader, ' ');
@@ -1599,13 +1599,13 @@ static void test_readvaluechunk(void)
c = 0;
b = 0;
hr = IXmlReader_ReadValueChunk(reader, &b, 1, &c);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(c == 0, "got %u\n", c);
ok(b == 0, "got %x\n", b);
c = 0xdeadbeef;
hr = IXmlReader_ReadValueChunk(reader, buf, 0, &c);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!c, "c = %u\n", c);
reader_value(reader, L"omment1 ");
@@ -1615,13 +1615,13 @@ static void test_readvaluechunk(void)
c = 0xdeadbeef;
hr = IXmlReader_ReadValueChunk(reader, buf, 0, &c);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!c, "c = %u\n", c);
c = 0xdeadbeef;
memset(buf, 0xcc, sizeof(buf));
hr = IXmlReader_ReadValueChunk(reader, buf, ARRAY_SIZE(buf), &c);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(c == 10, "got %u\n", c);
ok(buf[c] == 0xcccc, "buffer overflow\n");
buf[c] = 0;
@@ -1630,7 +1630,7 @@ static void test_readvaluechunk(void)
c = 0xdeadbeef;
memset(buf, 0xcc, sizeof(buf));
hr = IXmlReader_ReadValueChunk(reader, buf, ARRAY_SIZE(buf), &c);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(!c, "got %u\n", c);
/* portion read as chunk is skipped from resulting node value */
@@ -1640,7 +1640,7 @@ static void test_readvaluechunk(void)
c = 0xdeadbeef;
b = 0xffff;
hr = IXmlReader_ReadValueChunk(reader, &b, 1, &c);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(c == 0, "got %u\n", c);
ok(b == 0xffff, "got %x\n", b);
@@ -1666,7 +1666,7 @@ static void test_read_cdata(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1685,9 +1685,9 @@ static void test_read_cdata(void)
}
if (test->hr_broken)
- ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr || broken(hr == test->hr_broken), "Unexpected hr %#lx, for %s.\n", hr, test->xml);
else
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1699,19 +1699,19 @@ static void test_read_cdata(void)
str = NULL;
hr = IXmlReader_GetLocalName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
len = 1;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == 0, "got %u\n", len);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
/* value */
@@ -1740,7 +1740,7 @@ static void test_read_text(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1757,7 +1757,7 @@ static void test_read_text(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
}
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1769,19 +1769,19 @@ static void test_read_text(void)
str = NULL;
hr = IXmlReader_GetLocalName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
len = 1;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == 0, "got %u\n", len);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(*str == 0, "got %s\n", wine_dbgstr_w(str));
/* value */
@@ -1812,7 +1812,7 @@ static void test_isemptyelement(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1823,7 +1823,7 @@ static void test_isemptyelement(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "got %d\n", type);
ret = IXmlReader_IsEmptyElement(reader);
@@ -1867,7 +1867,7 @@ static void test_read_attribute(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
while (test->xml)
{
@@ -1878,9 +1878,9 @@ static void test_read_attribute(void)
hr = IXmlReader_Read(reader, NULL);
if (test->hr_broken)
- ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr || broken(hr == test->hr_broken), "Unexpected hr %#lx, for %s.\n", hr, test->xml);
else
- ok(hr == test->hr, "got %08x for %s\n", hr, test->xml);
+ ok(hr == test->hr, "Unexpected hr %#lx, for %s.\n", hr, test->xml);
if (hr == S_OK)
{
const WCHAR *str;
@@ -1888,19 +1888,19 @@ static void test_read_attribute(void)
type = XmlNodeType_None;
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "Failed to get node type, %#x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "got %d for %s\n", type, test->xml);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_name(reader, test->name);
len = 1;
str = NULL;
hr = IXmlReader_GetQualifiedName(reader, &str, &len);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(len == lstrlenW(test->name), "got %u\n", len);
ok(!lstrcmpW(str, test->name), "got %s\n", wine_dbgstr_w(str));
@@ -1921,23 +1921,23 @@ static void test_reader_properties(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 0;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_MaxElementDepth, &value);
- ok(hr == S_OK, "GetProperty failed: %08x\n", hr);
- ok(value == 256, "Unexpected default max depth value %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == 256, "Unexpected default max depth value %Id.\n", value);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MultiLanguage, 0);
- ok(hr == S_OK, "SetProperty failed: %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MaxElementDepth, 0);
- ok(hr == S_OK, "SetProperty failed: %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 256;
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_MaxElementDepth, &value);
- ok(hr == S_OK, "GetProperty failed: %08x\n", hr);
- ok(value == 0, "Unexpected max depth value %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == 0, "Unexpected max depth value %Id.\n", value);
IXmlReader_Release(reader);
}
@@ -1960,7 +1960,7 @@ static void test_prefix(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(prefix_tests); i++) {
XmlNodeType type;
@@ -1968,16 +1968,16 @@ static void test_prefix(void)
set_input_string(reader, prefix_tests[i].xml);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "Read() failed, %#x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "Unexpected node type %d.\n", type);
reader_prefix(reader, prefix_tests[i].prefix1);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "MoveToFirstAttribute() failed, %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "GetNodeType() failed, %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "Unexpected node type %d.\n", type);
reader_prefix(reader, prefix_tests[i].prefix2);
@@ -1985,7 +1985,7 @@ static void test_prefix(void)
next_attribute(reader);
hr = IXmlReader_GetNodeType(reader, &type);
- ok(hr == S_OK, "GetNodeType() failed, %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Attribute, "Unexpected node type %d.\n", type);
reader_prefix(reader, prefix_tests[i].prefix3);
@@ -2035,7 +2035,7 @@ static void test_namespaceuri(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(uri_tests); i++) {
unsigned int j = 0;
@@ -2059,13 +2059,13 @@ static void test_namespaceuri(void)
local = NULL;
length = 0;
hr = IXmlReader_GetLocalName(reader, &local, &length);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(local != NULL, "Unexpected NULL local name pointer\n");
qname = NULL;
length2 = 0;
hr = IXmlReader_GetQualifiedName(reader, &qname, &length2);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(qname != NULL, "Unexpected NULL qualified name pointer\n");
if (type == XmlNodeType_Element ||
@@ -2100,28 +2100,28 @@ static void test_read_charref(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, testA);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "Unexpected node type %d\n", type);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Text, "Unexpected node type %d\n", type);
hr = IXmlReader_GetValue(reader, &value, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!lstrcmpW(value, chardataW), "Text value : %s\n", wine_dbgstr_w(value));
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_EndElement, "Unexpected node type %d\n", type);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_FALSE, "got %08x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "Unexpected node type %d\n", type);
IXmlReader_Release(reader);
@@ -2154,7 +2154,7 @@ static void test_encoding_detection(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* there's no way to query detected encoding back, so just verify that document is browsable */
@@ -2164,7 +2164,7 @@ static void test_encoding_detection(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type != XmlNodeType_None, "Unexpected node type %d\n", type);
}
@@ -2173,11 +2173,11 @@ static void test_encoding_detection(void)
stream = create_stream_on_data(encoding_testsW[i].text, lstrlenW(encoding_testsW[i].text) * sizeof(WCHAR));
hr = IXmlReader_SetInput(reader, (IUnknown *)stream);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "%u: got %08x\n", i, hr);
+ ok(hr == S_OK, "%u: unexpected hr %#lx.\n", i, hr);
ok(type != XmlNodeType_None, "%u: unexpected node type %d\n", i, type);
IStream_Release(stream);
@@ -2193,8 +2193,8 @@ static void test_eof_state(IXmlReader *reader, BOOL eof)
ok(IXmlReader_IsEOF(reader) == eof, "Unexpected IsEOF() result\n");
hr = IXmlReader_GetProperty(reader, XmlReaderProperty_ReadState, &state);
- ok(hr == S_OK, "GetProperty() failed, %#x\n", hr);
- ok((state == XmlReadState_EndOfFile) == eof, "Unexpected EndOfFile state %ld\n", state);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok((state == XmlReadState_EndOfFile) == eof, "Unexpected EndOfFile state %Id.\n", state);
}
static void test_endoffile(void)
@@ -2204,7 +2204,7 @@ static void test_endoffile(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
test_eof_state(reader, FALSE);
@@ -2214,46 +2214,46 @@ static void test_endoffile(void)
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "Unexpected type %d\n", type);
test_eof_state(reader, FALSE);
type = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_FALSE, "got %#x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "Unexpected type %d\n", type);
test_eof_state(reader, TRUE);
hr = IXmlReader_SetInput(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
test_eof_state(reader, FALSE);
IXmlReader_Release(reader);
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, "<a/>text");
type = XmlNodeType_None;
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %#x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "Unexpected type %d\n", type);
test_eof_state(reader, FALSE);
type = XmlNodeType_Element;
hr = IXmlReader_Read(reader, &type);
- ok(hr == WC_E_SYNTAX, "got %#x\n", hr);
+ ok(hr == WC_E_SYNTAX, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_None, "Unexpected type %d\n", type);
test_eof_state(reader, FALSE);
hr = IXmlReader_SetInput(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IXmlReader_Release(reader);
}
@@ -2274,37 +2274,37 @@ static void test_max_element_depth(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, xml);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MaxElementDepth, 2);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 0);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 0);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 1);
TEST_READER_STATE(reader, XmlReadState_Interactive);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == SC_E_MAXELEMENTDEPTH, "got %08x\n", hr);
+ ok(hr == SC_E_MAXELEMENTDEPTH, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH2(reader, 0, 2);
TEST_READER_STATE(reader, XmlReadState_Error);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MaxElementDepth, 10);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == SC_E_MAXELEMENTDEPTH, "got %08x\n", hr);
+ ok(hr == SC_E_MAXELEMENTDEPTH, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH2(reader, 0, 2);
TEST_READER_STATE(reader, XmlReadState_Error);
@@ -2313,34 +2313,34 @@ static void test_max_element_depth(void)
set_input_string(reader, xml);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MaxElementDepth, 2);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 0);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 0);
hr = IXmlReader_Read(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 1);
hr = IXmlReader_MoveToFirstAttribute(reader);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_DEPTH(reader, 2);
TEST_READER_STATE(reader, XmlReadState_Interactive);
nodetype = 123;
hr = IXmlReader_Read(reader, &nodetype);
- ok(hr == SC_E_MAXELEMENTDEPTH, "got %08x\n", hr);
+ ok(hr == SC_E_MAXELEMENTDEPTH, "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "got node type %d\n", nodetype);
nodetype = 123;
hr = IXmlReader_Read(reader, &nodetype);
- ok(hr == SC_E_MAXELEMENTDEPTH, "got %08x\n", hr);
+ ok(hr == SC_E_MAXELEMENTDEPTH, "Unexpected hr %#lx.\n", hr);
ok(nodetype == XmlNodeType_None, "got node type %d\n", nodetype);
TEST_DEPTH2(reader, 0, 2);
@@ -2350,7 +2350,7 @@ static void test_max_element_depth(void)
set_input_string(reader, xml);
hr = IXmlReader_SetProperty(reader, XmlReaderProperty_MaxElementDepth, 0);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 0;
while (IXmlReader_Read(reader, NULL) == S_OK)
@@ -2370,25 +2370,25 @@ static void test_reader_position(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE(reader, XmlReadState_Closed);
/* position methods with Null args */
hr = IXmlReader_GetLineNumber(reader, NULL);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_GetLinePosition(reader, NULL);
- ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
position = 123;
hr = IXmlReader_GetLinePosition(reader, &position);
- ok(hr == S_FALSE, "got %#x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(position == 0, "got %u\n", position);
position = 123;
hr = IXmlReader_GetLineNumber(reader, &position);
- ok(hr == S_FALSE, "got %#x\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
ok(position == 0, "got %u\n", position);
set_input_string(reader, xml);
@@ -2396,7 +2396,7 @@ static void test_reader_position(void)
TEST_READER_STATE(reader, XmlReadState_Initial);
TEST_READER_POSITION(reader, 0, 0);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Element, "got type %d\n", type);
TEST_READER_POSITION2(reader, 1, 2, ~0u, 34);
@@ -2410,17 +2410,17 @@ static void test_reader_position(void)
TEST_READER_POSITION2(reader, 1, 2, ~0u, 34);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_Whitespace, "got type %d\n", type);
TEST_READER_POSITION2(reader, 1, 35, 2, 6);
hr = IXmlReader_Read(reader, &type);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(type == XmlNodeType_EndElement, "got type %d\n", type);
TEST_READER_POSITION2(reader, 2, 3, 2, 6);
hr = IXmlReader_SetInput(reader, NULL);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
TEST_READER_STATE2(reader, XmlReadState_Initial, XmlReadState_Closed);
TEST_READER_POSITION(reader, 0, 0);
@@ -2434,7 +2434,7 @@ static void test_string_pointers(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, "<elem xmlns=\"myns\">myns<elem2 /></elem>");
@@ -2565,67 +2565,67 @@ static void test_attribute_by_name(void)
HRESULT hr;
hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL);
- ok(hr == S_OK, "Failed to create reader, hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
set_input_string(reader, xml);
hr = IXmlReader_MoveToAttributeByName(reader, NULL, NULL);
- ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* WinXP */, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG || broken(hr == S_FALSE) /* WinXP */, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, emptyW, NULL);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
read_node(reader, XmlNodeType_Element);
hr = IXmlReader_MoveToAttributeByName(reader, emptyW, NULL);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
read_node(reader, XmlNodeType_Element);
hr = IXmlReader_MoveToAttributeByName(reader, NULL, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, NULL, xmlns_uriW);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, emptyW, xmlns_uriW);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, xmlnsW, NULL);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, xmlnsW, xmlns_uriW);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"myns");
hr = IXmlReader_MoveToAttributeByName(reader, aW, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"value a");
hr = IXmlReader_MoveToAttributeByName(reader, bW, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"value b");
hr = IXmlReader_MoveToAttributeByName(reader, aW, mynsW);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, nsW, NULL);
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IXmlReader_MoveToAttributeByName(reader, nsW, xmlns_uriW);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"ns uri");
hr = IXmlReader_MoveToAttributeByName(reader, bW, emptyW);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"value b");
hr = IXmlReader_MoveToAttributeByName(reader, cW, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"value c2");
hr = IXmlReader_MoveToAttributeByName(reader, cW, nsuriW);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
reader_value(reader, L"value c");
IXmlReader_Release(reader);
diff --git a/dlls/xmllite/tests/writer.c b/dlls/xmllite/tests/writer.c
index c69aa42598d..bfcea5d15de 100644
--- a/dlls/xmllite/tests/writer.c
+++ b/dlls/xmllite/tests/writer.c
@@ -41,7 +41,7 @@ static void _expect_ref(IUnknown *obj, ULONG ref, int line)
ULONG refcount;
IUnknown_AddRef(obj);
refcount = IUnknown_Release(obj);
- ok_(__FILE__, line)(refcount == ref, "expected refcount %d, got %d\n", ref, refcount);
+ ok_(__FILE__, line)(refcount == ref, "expected refcount %lu, got %lu.\n", ref, refcount);
}
static void check_output_raw(IStream *stream, const void *expected, SIZE_T size, int line)
@@ -52,10 +52,10 @@ static void check_output_raw(IStream *stream, const void *expected, SIZE_T size,
WCHAR *ptr;
hr = GetHGlobalFromStream(stream, &hglobal);
- ok_(__FILE__, line)(hr == S_OK, "Failed to get the stream handle, hr %#x.\n", hr);
+ ok_(__FILE__, line)(hr == S_OK, "Failed to get the stream handle, hr %#lx.\n", hr);
content_size = GlobalSize(hglobal);
- ok_(__FILE__, line)(size == content_size, "Unexpected test output size %ld.\n", content_size);
+ ok_(__FILE__, line)(size == content_size, "Unexpected test output size %Id.\n", content_size);
ptr = GlobalLock(hglobal);
if (size <= content_size)
ok_(__FILE__, line)(!memcmp(expected, ptr, size), "Unexpected output content.\n");
@@ -73,7 +73,7 @@ static void check_output(IStream *stream, const char *expected, BOOL todo, int l
char *ptr;
hr = GetHGlobalFromStream(stream, &hglobal);
- ok_(__FILE__, line)(hr == S_OK, "got 0x%08x\n", hr);
+ ok_(__FILE__, line)(hr == S_OK, "Unexpected hr %#lx.\n", hr);
size = GlobalSize(hglobal);
ptr = GlobalLock(hglobal);
@@ -111,7 +111,7 @@ static void writer_set_property(IXmlWriter *writer, XmlWriterProperty property)
HRESULT hr;
hr = IXmlWriter_SetProperty(writer, property, TRUE);
- ok(hr == S_OK, "Failed to set writer property, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set writer property, hr %#lx.\n", hr);
}
/* used to test all Write* methods for consistent error state */
@@ -123,67 +123,67 @@ static void check_writer_state(IXmlWriter *writer, HRESULT exp_hr)
/* FIXME: add WriteAttributes */
hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteCData(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteCharEntity(writer, aW[0]);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteChars(writer, aW, 1);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteComment(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteDocType(writer, aW, NULL, NULL, NULL);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteEntityRef(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteName(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteNmToken(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr);
/* FIXME: add WriteNode */
/* FIXME: add WriteNodeShallow */
hr = IXmlWriter_WriteProcessingInstruction(writer, aW, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteQualifiedName(writer, aW, NULL);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteRaw(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteRawChars(writer, aW, 1);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
hr = IXmlWriter_WriteString(writer, aW);
- ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
+ ok(hr == exp_hr, "Unexpected hr %#lx., expected %#lx.\n", hr, exp_hr);
/* FIXME: add WriteSurrogateCharEntity */
/* FIXME: add WriteWhitespace */
@@ -195,10 +195,10 @@ static IStream *writer_set_output(IXmlWriter *writer)
HRESULT hr;
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
return stream;
}
@@ -295,39 +295,39 @@ static void test_writer_create(void)
}
hr = CreateXmlWriter(&IID_IStream, (void **)&unk, NULL);
- ok(hr == E_NOINTERFACE, "got %08x\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriter(&IID_IUnknown, (void **)&unk, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(unk, &IID_IXmlWriter, (void **)&writer);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(unk == (IUnknown *)writer, "unexpected interface pointer\n");
IUnknown_Release(unk);
IXmlWriter_Release(writer);
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* check default properties values */
value = 0;
hr = IXmlWriter_GetProperty(writer, XmlWriterProperty_ByteOrderMark, &value);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
- ok(value == TRUE, "got %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == TRUE, "got %Id.\n", value);
value = TRUE;
hr = IXmlWriter_GetProperty(writer, XmlWriterProperty_Indent, &value);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
- ok(value == FALSE, "got %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == FALSE, "got %Id.\n", value);
value = TRUE;
hr = IXmlWriter_GetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, &value);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
- ok(value == FALSE, "got %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == FALSE, "got %Id.\n", value);
value = XmlConformanceLevel_Auto;
hr = IXmlWriter_GetProperty(writer, XmlWriterProperty_ConformanceLevel, &value);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
- ok(value == XmlConformanceLevel_Document, "got %ld\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == XmlConformanceLevel_Document, "got %Id.\n", value);
IXmlWriter_Release(writer);
}
@@ -337,78 +337,78 @@ static void test_invalid_output_encoding(IXmlWriter *writer, IUnknown *output)
HRESULT hr;
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "Failed to set output, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set output, hr %#lx.\n", hr);
/* TODO: WriteAttributes */
hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCData(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCharEntity(writer, 0x100);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteChars(writer, aW, 1);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteDocType(writer, aW, NULL, NULL, NULL);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, NULL);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEntityRef(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteName(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteNmToken(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
/* TODO: WriteNode */
/* TODO: WriteNodeShallow */
hr = IXmlWriter_WriteProcessingInstruction(writer, aW, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteQualifiedName(writer, aW, NULL);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRawChars(writer, aW, 1);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteString(writer, aW);
- ok(hr == MX_E_ENCODING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr);
/* TODO: WriteSurrogateCharEntity */
- /* ًُُTODO: WriteWhitespace */
+ /* TODO: WriteWhitespace */
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
}
static void test_writeroutput(void)
@@ -425,15 +425,15 @@ static void test_writeroutput(void)
output = NULL;
hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, NULL, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(output, 1);
IUnknown_Release(output);
hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, utf16W, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
unk = NULL;
hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(unk != NULL && unk != output, "got %p, output %p\n", unk, output);
EXPECT_REF(output, 2);
@@ -444,14 +444,14 @@ static void test_writeroutput(void)
output = NULL;
hr = CreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, ~0u, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(output);
hr = CreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, CP_UTF8, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
unk = NULL;
hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(unk != NULL, "got %p\n", unk);
/* releasing 'unk' crashes on native */
IUnknown_Release(output);
@@ -460,27 +460,27 @@ static void test_writeroutput(void)
/* create with us-ascii */
output = NULL;
hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, usasciiW, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(output);
/* Output with codepage 1200. */
hr = CreateXmlWriter(&IID_IXmlWriter, (void **)&writer, NULL);
- ok(hr == S_OK, "Failed to create writer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create writer, hr %#lx.\n", hr);
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "Failed to create stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create stream, hr %#lx.\n", hr);
hr = CreateXmlWriterOutputWithEncodingCodePage((IUnknown *)stream, NULL, 1200, &output);
- ok(hr == S_OK, "Failed to create writer output, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create writer output, hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "Failed to set writer output, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set writer output, hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "Write failed, hr %#x.\n", hr);
+ ok(hr == S_OK, "Write failed, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT_RAW(stream, utf16_outputW, sizeof(utf16_outputW));
@@ -489,11 +489,11 @@ static void test_writeroutput(void)
/* Create output with meaningless code page value. */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "Failed to create stream, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create stream, hr %#lx.\n", hr);
output = NULL;
hr = CreateXmlWriterOutputWithEncodingCodePage((IUnknown *)stream, NULL, ~0u, &output);
- ok(hr == S_OK, "Failed to create writer output, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create writer output, hr %#lx.\n", hr);
test_invalid_output_encoding(writer, output);
CHECK_OUTPUT(stream, "");
@@ -503,11 +503,11 @@ static void test_writeroutput(void)
/* Same, with invalid encoding name. */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
output = NULL;
hr = CreateXmlWriterOutputWithEncodingName((IUnknown *)stream, NULL, dummyW, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
test_invalid_output_encoding(writer, output);
CHECK_OUTPUT(stream, "");
@@ -532,55 +532,55 @@ static void test_writestartdocument(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* output not set */
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
/* nothing written yet */
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, fullprolog);
/* one more time */
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
/* now add PI manually, and try to start a document */
stream = writer_set_output(writer);
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
/* another attempt to add 'xml' PI */
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, prologversion);
@@ -589,23 +589,23 @@ static void test_writestartdocument(void)
/* create with us-ascii */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
output = NULL;
hr = CreateXmlWriterOutputWithEncodingName((IUnknown *)stream, NULL, usasciiW, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriter(&IID_IXmlWriter, (void **)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, prologversion2);
@@ -620,28 +620,28 @@ static void test_flush(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, (IUnknown*)&teststream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
g_write_len = 0;
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(g_write_len > 0, "got %d\n", g_write_len);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(g_write_len > 0, "Unexpected length %lu.\n", g_write_len);
g_write_len = 1;
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(g_write_len == 0, "got %d\n", g_write_len);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(g_write_len == 0, "Unexpected length %lu.\n", g_write_len);
/* Release() flushes too */
g_write_len = 1;
IXmlWriter_Release(writer);
- ok(g_write_len == 0, "got %d\n", g_write_len);
+ ok(g_write_len > 0, "Unexpected length %lu.\n", g_write_len);
}
static void test_omitxmldeclaration(void)
@@ -656,20 +656,20 @@ static void test_omitxmldeclaration(void)
char *ptr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = GetHGlobalFromStream(stream, &hglobal);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ptr = GlobalLock(hglobal);
ok(!ptr, "got %p\n", ptr);
@@ -677,7 +677,7 @@ static void test_omitxmldeclaration(void)
/* one more time */
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
@@ -685,35 +685,35 @@ static void test_omitxmldeclaration(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, prologversion);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, prologversion);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, prologversion);
/* another attempt to add 'xml' PI */
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
IXmlWriter_Release(writer);
@@ -735,25 +735,25 @@ static void test_bom(void)
HRESULT hr;
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* BOM is on by default */
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT_RAW(stream, bomW, sizeof(bomW));
@@ -762,19 +762,19 @@ static void test_bom(void)
/* start with PI */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT_RAW(stream, piW, sizeof(piW));
@@ -783,19 +783,19 @@ static void test_bom(void)
/* start with element */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT_RAW(stream, aopenW, sizeof(aopenW));
@@ -804,24 +804,24 @@ static void test_bom(void)
/* WriteElementString */
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output);
- ok(hr == S_OK, "got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, output);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_Indent);
hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = GetHGlobalFromStream(stream, &hglobal);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT_RAW(stream, afullW, sizeof(afullW));
@@ -922,65 +922,65 @@ static void test_WriteStartElement(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<a");
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, NULL, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteProcessingInstruction(writer, aW, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
IXmlWriter_Release(writer);
/* WriteElementString */
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "b", NULL, "value");
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = write_start_element(writer, "prefix", "a", "uri");
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "b", NULL, "value");
- ok(hr == S_OK, "Failed to write element string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element string, hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "c", NULL, NULL);
- ok(hr == S_OK, "Failed to write element string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element string, hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "d", "uri");
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_start_element(writer, "", "e", "uri");
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_start_element(writer, "prefix2", "f", "uri");
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<prefix:a xmlns:prefix=\"uri\">"
@@ -1000,24 +1000,24 @@ static void test_WriteStartElement(void)
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "Failed to start document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start document, hr %#lx.\n", hr);
hr = write_start_element(writer, start_element_tests[i].prefix, start_element_tests[i].local,
start_element_tests[i].uri);
- ok(hr == start_element_tests[i].hr, "%u: unexpected hr %#x.\n", i, hr);
+ ok(hr == start_element_tests[i].hr, "%u: unexpected hr %#lx.\n", i, hr);
if (SUCCEEDED(start_element_tests[i].hr))
{
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, start_element_tests[i].output_partial, start_element_tests[i].todo_partial, __LINE__);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "Failed to end document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end document, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, start_element_tests[i].output, start_element_tests[i].todo, __LINE__);
}
@@ -1072,54 +1072,54 @@ static void test_WriteElementString(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "b", NULL, "value");
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "b", NULL, "value");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "b", NULL, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix", "b", "uri", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, "prefix", "c", "uri");
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix", "d", NULL, NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix2", "d", "uri", NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "e", "uri", NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix", "f", "uri2", NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, NULL, "g", "uri3", NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix", "h", NULL, NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, "prefix_i", "i", NULL, NULL);
- ok(hr == WR_E_NSPREFIXWITHEMPTYNSURI, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == WR_E_NSPREFIXWITHEMPTYNSURI, "Failed to write element, hr %#lx.\n", hr);
hr = write_element_string(writer, "", "j", "uri", NULL);
- ok(hr == S_OK, "Failed to write element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a><b>value</b><b />"
@@ -1142,24 +1142,24 @@ static void test_WriteElementString(void)
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "Failed to start document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start document, hr %#lx.\n", hr);
hr = write_element_string(writer, element_string_tests[i].prefix, element_string_tests[i].local,
element_string_tests[i].uri, element_string_tests[i].value);
- ok(hr == element_string_tests[i].hr, "%u: unexpected hr %#x.\n", i, hr);
+ ok(hr == element_string_tests[i].hr, "%u: unexpected hr %#lx.\n", i, hr);
if (SUCCEEDED(element_string_tests[i].hr))
{
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, element_string_tests[i].output, element_string_tests[i].todo, __LINE__);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "Failed to end document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end document, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, element_string_tests[i].output, element_string_tests[i].todo, __LINE__);
}
@@ -1177,24 +1177,24 @@ static void test_WriteEndElement(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<a><b /></a>");
@@ -1213,47 +1213,47 @@ static void test_writeenddocument(void)
char *ptr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
/* WriteEndDocument resets it to initial state */
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = GetHGlobalFromStream(stream, &hglobal);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ptr = GlobalLock(hglobal);
ok(ptr == NULL, "got %p\n", ptr);
/* we still need to flush manually, WriteEndDocument doesn't do that */
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<a><b /></a>");
@@ -1271,35 +1271,35 @@ static void test_WriteComment(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteComment(writer, aW);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, aW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, aW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, closeW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<!--a--><b><!--a--><!----><!--- ->-->");
@@ -1318,32 +1318,32 @@ static void test_WriteCData(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteCData(writer, aW);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCData(writer, aW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCData(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCData(writer, closeW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCData(writer, close2W);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<b>"
@@ -1367,48 +1367,48 @@ static void test_WriteRaw(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, rawW);
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = IXmlWriter_WriteRaw(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, rawW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, rawW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, rawW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, rawW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, aW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, rawW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteRaw(writer, rawW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>a<:a<:<!--a<:-->a<:<a>a</a>");
@@ -1424,7 +1424,7 @@ static void test_writer_state(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* initial state */
check_writer_state(writer, E_UNEXPECTED);
@@ -1433,7 +1433,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1442,7 +1442,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1451,7 +1451,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1460,7 +1460,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1469,7 +1469,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteCData(writer, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1478,7 +1478,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteName(writer, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1487,7 +1487,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteNmToken(writer, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1496,7 +1496,7 @@ static void test_writer_state(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteString(writer, aW);
- ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
check_writer_state(writer, WR_E_INVALIDACTION);
IStream_Release(stream);
@@ -1514,7 +1514,7 @@ static void test_indentation(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
@@ -1522,22 +1522,22 @@ static void test_indentation(void)
writer_set_property(writer, XmlWriterProperty_Indent);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteComment(writer, commentW);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -1551,19 +1551,19 @@ static void test_indentation(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteElementString(writer, NULL, bW, NULL, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteElementString(writer, NULL, bW, NULL, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -1678,7 +1678,7 @@ static void test_WriteAttributeString(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
@@ -1687,26 +1687,26 @@ static void test_WriteAttributeString(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "Failed to start document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start document, hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "e", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_attribute_string(writer, attribute_tests[i].prefix, attribute_tests[i].local,
attribute_tests[i].uri, attribute_tests[i].value);
todo_wine_if(attribute_tests[i].todo_hr)
- ok(hr == attribute_tests[i].hr, "%u: unexpected hr %#x, expected %#x.\n", i, hr, attribute_tests[i].hr);
+ ok(hr == attribute_tests[i].hr, "%u: unexpected hr %#lx, expected %#lx.\n", i, hr, attribute_tests[i].hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, attribute_tests[i].output_partial, attribute_tests[i].todo_partial, __LINE__);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "Failed to end document, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end document, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
check_output(stream, attribute_tests[i].output, attribute_tests[i].todo, __LINE__);
IStream_Release(stream);
@@ -1716,41 +1716,41 @@ static void test_WriteAttributeString(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, "p", "a", "outeruri");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, "prefix", "local", "uri", "b");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, NULL, "a", NULL, "b");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, "xmlns", "prefix", NULL, "uri");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, "p", "attr", NULL, "value");
- ok(hr == S_OK, "Failed to write attribute string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write attribute string, hr %#lx.\n", hr);
hr = write_attribute_string(writer, "prefix", "local", NULL, "b");
todo_wine
- ok(hr == WR_E_DUPLICATEATTRIBUTE, "got 0x%08x\n", hr);
+ ok(hr == WR_E_DUPLICATEATTRIBUTE, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, NULL, "attr2", "outeruri", "value");
- ok(hr == S_OK, "Failed to write attribute string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write attribute string, hr %#lx.\n", hr);
hr = write_attribute_string(writer, "pr", "attr3", "outeruri", "value");
- ok(hr == S_OK, "Failed to write attribute string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write attribute string, hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT_TODO(stream,
"<p:a prefix:local=\"b\" a=\"b\" xmlns:prefix=\"uri\" p:attr=\"value\" xmlns:p=\"outeruri\">"
@@ -1763,22 +1763,22 @@ static void test_WriteAttributeString(void)
stream = writer_set_output(writer);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "e", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, "xmlns", "prefix", NULL, "uri");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_attribute_string(writer, "prefix", "attr", NULL, "value");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<e xmlns:prefix=\"uri\" prefix:attr=\"value\" />");
@@ -1796,7 +1796,7 @@ static void test_WriteFullEndElement(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* standalone element */
stream = writer_set_output(writer);
@@ -1805,19 +1805,19 @@ static void test_WriteFullEndElement(void)
writer_set_property(writer, XmlWriterProperty_Indent);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a></a>");
@@ -1830,22 +1830,22 @@ static void test_WriteFullEndElement(void)
writer_set_property(writer, XmlWriterProperty_Indent);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -1864,7 +1864,7 @@ static void test_WriteCharEntity(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* without indentation */
stream = writer_set_output(writer);
@@ -1872,22 +1872,22 @@ static void test_WriteCharEntity(void)
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteCharEntity(writer, 0x100);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndDocument(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>Ā<a /></a>");
@@ -1903,39 +1903,39 @@ static void test_WriteString(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL);
- ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
writer_set_property(writer, XmlWriterProperty_OmitXmlDeclaration);
hr = write_string(writer, "a");
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, "");
- ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr);
+ ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, "");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, "a");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* WriteString automatically escapes markup characters */
hr = write_string(writer, "<&\">=");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<b>a<&\">=");
@@ -1944,22 +1944,22 @@ static void test_WriteString(void)
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = write_string(writer, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<b");
hr = write_string(writer, "");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<b>");
@@ -1969,43 +1969,43 @@ static void test_WriteString(void)
/* With indentation */
hr = CreateXmlWriter(&IID_IXmlWriter, (void **)&writer, NULL);
- ok(hr == S_OK, "Failed to create a writer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a writer, hr %#lx.\n", hr);
stream = writer_set_output(writer);
writer_set_property(writer, XmlWriterProperty_Indent);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_string(writer, "text");
- ok(hr == S_OK, "Failed to write a string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write a string, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
" <b>text");
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
" <b>text</b>");
hr = IXmlWriter_WriteFullEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2017,29 +2017,29 @@ static void test_WriteString(void)
stream = writer_set_output(writer);
hr = write_start_element(writer, NULL, "a", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_start_element(writer, NULL, "b", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
" <b />");
hr = write_start_element(writer, NULL, "c", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_attribute_string(writer, NULL, "attr", NULL, "value");
- ok(hr == S_OK, "Failed to write attribute string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write attribute string, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2047,10 +2047,10 @@ static void test_WriteString(void)
" <c attr=\"value\"");
hr = write_string(writer, "text");
- ok(hr == S_OK, "Failed to write a string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write a string, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2058,10 +2058,10 @@ static void test_WriteString(void)
" <c attr=\"value\">text");
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2069,16 +2069,16 @@ static void test_WriteString(void)
" <c attr=\"value\">text</c>");
hr = write_start_element(writer, NULL, "d", NULL);
- ok(hr == S_OK, "Failed to start element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start element, hr %#lx.\n", hr);
hr = write_string(writer, "");
- ok(hr == S_OK, "Failed to write a string, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to write a string, hr %#lx.\n", hr);
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2087,10 +2087,10 @@ static void test_WriteString(void)
" <d></d>");
hr = IXmlWriter_WriteEndElement(writer);
- ok(hr == S_OK, "Failed to end element, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to end element, hr %#lx.\n", hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream,
"<a>\r\n"
@@ -2163,23 +2163,23 @@ static void test_WriteDocType(void)
HRESULT hr;
hr = CreateXmlWriter(&IID_IXmlWriter, (void **)&writer, NULL);
- ok(hr == S_OK, "Failed to create writer instance, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create writer instance, hr %#lx.\n", hr);
stream = writer_set_output(writer);
hr = IXmlWriter_WriteDocType(writer, NULL, NULL, NULL, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IXmlWriter_WriteDocType(writer, emptyW, NULL, NULL, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Name validation. */
hr = IXmlWriter_WriteDocType(writer, nameW, NULL, NULL, NULL);
- ok(hr == WC_E_NAMECHARACTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == WC_E_NAMECHARACTER, "Unexpected hr %#lx.\n", hr);
/* Pubid validation. */
hr = IXmlWriter_WriteDocType(writer, aW, pubidW, NULL, NULL);
- ok(hr == WC_E_PUBLICID, "Unexpected hr %#x.\n", hr);
+ ok(hr == WC_E_PUBLICID, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
@@ -2189,16 +2189,16 @@ static void test_WriteDocType(void)
hr = write_doctype(writer, doctype_tests[i].name, doctype_tests[i].pubid, doctype_tests[i].sysid,
doctype_tests[i].subset);
- ok(hr == S_OK, "%u: failed to write doctype, hr %#x.\n", i, hr);
+ ok(hr == S_OK, "%u: failed to write doctype, hr %#lx.\n", i, hr);
hr = IXmlWriter_Flush(writer);
- ok(hr == S_OK, "Failed to flush, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr);
CHECK_OUTPUT(stream, doctype_tests[i].output);
hr = write_doctype(writer, doctype_tests[i].name, doctype_tests[i].pubid, doctype_tests[i].sysid,
doctype_tests[i].subset);
- ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#x.\n", hr);
+ ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr);
IStream_Release(stream);
}
--
2.34.1
2
1
[PATCH 1/2] dwrite/tests: Add some tests for Segoe UI font family. (Resend)
by Dmitry Timoshkov 07 Feb '22
by Dmitry Timoshkov 07 Feb '22
07 Feb '22
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/dwrite/tests/layout.c | 139 +++++++++++++++++++++++++++++++++++++
1 file changed, 139 insertions(+)
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 3fe149927ca..c242155cce3 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -6489,6 +6489,144 @@ if (SUCCEEDED(hr))
IDWriteFactory_Release(factory);
}
+#define get_font_name(a, b, c) get_font_name_(a, b, c, __LINE__)
+static void get_font_name_(IDWriteFont *font, WCHAR *name, UINT32 size, int line)
+{
+ HRESULT hr;
+ IDWriteFontFamily *family;
+ IDWriteLocalizedStrings *names;
+ UINT32 index;
+ BOOL exists;
+
+ hr = IDWriteFont_GetFontFamily(font, &family);
+ ok_(__FILE__, line)(hr == S_OK, "got %#x\n", hr);
+
+ hr = IDWriteFontFamily_GetFamilyNames(family, &names);
+ ok_(__FILE__, line)(hr == S_OK, "got %#x\n", hr);
+
+ hr = IDWriteLocalizedStrings_FindLocaleName(names, L"en-us", &index, &exists);
+ ok_(__FILE__, line)(hr == S_OK, "got %#x\n", hr);
+ ok_(__FILE__, line)(index != UINT_MAX && exists, "name was not found\n");
+ hr = IDWriteLocalizedStrings_GetString(names, index, name, size);
+ ok_(__FILE__, line)(hr == S_OK, "got %#x\n", hr);
+
+ IDWriteLocalizedStrings_Release(names);
+ IDWriteFontFamily_Release(family);
+}
+
+static void test_SegoeUI(void)
+{
+ static const WCHAR *families[] = { L"Tahoma", L"Segoe UI", NULL };
+ static const WCHAR text[] = { 0x25d4, 0 };
+ HRESULT hr;
+ IDWriteFactory2 *factory;
+ IDWriteFontCollection *collection;
+ IDWriteFontFamily *family;
+ IDWriteFont *font;
+ IDWriteFontFallback *fallback;
+ UINT32 index, count, i, mappedlength;
+ WCHAR name[256];
+ BOOL exists, found;
+ FLOAT scale;
+
+ hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory2, (IUnknown **)&factory);
+ if (hr != S_OK)
+ {
+ win_skip("IDWriteFactory2 is not supported\n");
+ return;
+ }
+
+ hr = IDWriteFactory2_GetSystemFontCollection(factory, &collection, FALSE);
+ ok(hr == S_OK, "got %#x\n", hr);
+
+ hr = IDWriteFontCollection_FindFamilyName(collection, L"Segoe UI", &index, &exists);
+ ok(hr == S_OK, "got %#x\n", hr);
+ if (!exists)
+ {
+ skip("Segoe UI is not installed\n");
+ IDWriteFontCollection_Release(collection);
+ IDWriteFactory2_Release(factory);
+ return;
+ }
+ ok(index != UINT_MAX && exists, "Segoe UI was not found\n");
+
+ hr = IDWriteFontCollection_GetFontFamily(collection, index, &family);
+ ok(hr == S_OK, "got %#x\n", hr);
+
+ count = IDWriteFontFamily_GetFontCount(family);
+ trace("family Segoe UI has %u fonts\n", count);
+
+ found = FALSE;
+
+ for (i = 0; i < count; i++)
+ {
+ hr = IDWriteFontFamily_GetFont(family, i, &font);
+ ok(hr == S_OK, "got %#x\n", hr);
+
+ get_font_name(font, name, ARRAY_SIZE(name));
+ if (!wcscmp(name, L"Segoe UI Symbol"))
+ found = TRUE;
+
+ hr = IDWriteFont_HasCharacter(font, 0x25d4, &exists);
+ ok(hr == S_OK, "got %#x\n", hr);
+ ok(!exists, "%u: %s has character 0x25d4\n", i, wine_dbgstr_w(name));
+
+ IDWriteFont_Release(font);
+ }
+
+ ok(!found, "Segoe UI Symbol should not be part of Segoe UI family\n");
+
+ IDWriteFontFamily_Release(family);
+
+ hr = IDWriteFactory2_GetSystemFontFallback(factory, &fallback);
+ ok(hr == S_OK, "got %#x\n", hr);
+
+ g_source = text;
+
+ hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, collection, L"Segoe UI", DWRITE_FONT_WEIGHT_NORMAL,
+ DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
+ ok(hr == S_OK, "got %#x\n", hr);
+ ok(mappedlength == 1, "got %u\n", mappedlength);
+ ok(scale == 1.0f, "got %f\n", scale);
+
+ get_font_name(font, name, ARRAY_SIZE(name));
+todo_wine
+ ok(!wcscmp(name, L"Segoe UI Symbol"), "got %s\n", wine_dbgstr_w(name));
+
+ hr = IDWriteFont_HasCharacter(font, 0x25d4, &exists);
+ ok(hr == S_OK, "got %#x\n", hr);
+todo_wine
+ ok(exists, "%s should have character 0x25d4\n", wine_dbgstr_w(name));
+
+ IDWriteFont_Release(font);
+
+ for (i = 0; i < ARRAY_SIZE(families); i++)
+ {
+ hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, collection, families[i], DWRITE_FONT_WEIGHT_NORMAL,
+ DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
+todo_wine_if(families[i] == NULL)
+ ok(hr == S_OK, "%u: %s - got %#x\n", i, wine_dbgstr_w(families[i]), hr);
+ if (hr != S_OK) continue;
+ ok(mappedlength == 1, "got %u\n", mappedlength);
+ ok(scale == 1.0f, "got %f\n", scale);
+
+ get_font_name(font, name, ARRAY_SIZE(name));
+todo_wine
+ ok(!wcscmp(name, L"Segoe UI Symbol"), "got %s\n", wine_dbgstr_w(name));
+
+ hr = IDWriteFont_HasCharacter(font, 0x25d4, &exists);
+ ok(hr == S_OK, "got %#x\n", hr);
+todo_wine
+ ok(exists, "%s should have character 0x25d4\n", wine_dbgstr_w(name));
+
+ IDWriteFont_Release(font);
+ }
+
+ IDWriteFontFallback_Release(fallback);
+ IDWriteFontCollection_Release(collection);
+ IDWriteFactory2_Release(factory);
+}
+
START_TEST(layout)
{
IDWriteFactory *factory;
@@ -6544,6 +6682,7 @@ START_TEST(layout)
test_text_format_axes();
test_layout_range_length();
test_HitTestTextRange();
+ test_SegoeUI();
IDWriteFactory_Release(factory);
}
--
2.34.1
2
7
07 Feb '22
All the notification codes (printed as an id) have negative base value
(SBN_, UDN_, HDN_, BCN_, TBN_, TTN_, RBN_, TRBN_, PGN_, TVN_, LVN_, TCN_,
CBEN_, IPN_, MCN_, DTN_), and printing them as decimal helps to quickly
identify the corresponding notification value in cases when an id in
the message sequence doesn't match. Custom ids in the message sequences
have small numbers (0, 1, 2, ...), so they also get printed correctly.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/comctl32/tests/msg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/tests/msg.h b/dlls/comctl32/tests/msg.h
index 7337c724a5c..8ba2efddb0a 100644
--- a/dlls/comctl32/tests/msg.h
+++ b/dlls/comctl32/tests/msg.h
@@ -261,14 +261,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
failcount++;
dump++;
ok_(file, line) (FALSE,
- "%s: in msg 0x%04x expecting id 0x%x got 0x%x\n",
+ "%s: in msg 0x%04x expecting id %d got %d\n",
context, expected->message, expected->id, actual->id);
}
}
else
{
ok_(file, line) (expected->id == actual->id,
- "%s: in msg 0x%04x expecting id 0x%x got 0x%x\n",
+ "%s: in msg 0x%04x expecting id %d got %d\n",
context, expected->message, expected->id, actual->id);
if (expected->id != actual->id) dump++;
}
--
2.34.1
2
3
The test gets spurious GetScrollInfo SB_HORZ failures if some other
windows were created before using CW_USEDEFAULT positions, for instance
the window from test_capture_4.
This happened on some Win10 VMs, and was thought to be fixed with
9b5346df86bf1a85336ed03a67a630970ce08e9f, but it then broke the test on
some other VMs. This is hopefully a better fix, and it reverts the
previous one too.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=52507
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/user32/tests/win.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 8ec6d8af064..8614a048c4d 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -2256,7 +2256,7 @@ static void test_mdi(void)
mdi_hwndMain = CreateWindowExA(0, "MDI_parent_Class", "MDI parent window",
WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
WS_MAXIMIZEBOX /*| WS_VISIBLE*/,
- 200, 100, CW_USEDEFAULT, CW_USEDEFAULT,
+ 100, 100, CW_USEDEFAULT, CW_USEDEFAULT,
GetDesktopWindow(), 0,
GetModuleHandleA(NULL), NULL);
assert(mdi_hwndMain);
@@ -12644,6 +12644,10 @@ START_TEST(win)
our_pid = GetWindowThreadProcessId(hwndMain, NULL);
+ /* This test is sensitive to other windows created with
+ * CW_USEDEFAULT position, execute it early too */
+ test_mdi();
+
/* Add the tests below this line */
test_child_window_from_point();
test_window_from_point(argv[0]);
@@ -12665,7 +12669,6 @@ START_TEST(win)
test_parent_owner();
test_enum_thread_windows();
- test_mdi();
test_icons();
test_SetWindowPos(hwndMain, hwndMain2);
test_SetMenu(hwndMain);
--
2.34.1
2
1
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/rtworkq/tests/Makefile.in | 1 -
dlls/rtworkq/tests/rtworkq.c | 32 ++++++++++++++++----------------
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/dlls/rtworkq/tests/Makefile.in b/dlls/rtworkq/tests/Makefile.in
index 7a2f6db51c7..8354cd810d1 100644
--- a/dlls/rtworkq/tests/Makefile.in
+++ b/dlls/rtworkq/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = rtworkq.dll
IMPORTS = rtworkq ole32
diff --git a/dlls/rtworkq/tests/rtworkq.c b/dlls/rtworkq/tests/rtworkq.c
index 627e024d761..2ff74d57b84 100644
--- a/dlls/rtworkq/tests/rtworkq.c
+++ b/dlls/rtworkq/tests/rtworkq.c
@@ -33,72 +33,72 @@ static void test_platform_init(void)
/* Startup initializes MTA. */
hr = CoGetApartmentType(&apttype, &qualifier);
- ok(hr == CO_E_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+ ok(hr == CO_E_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
hr = RtwqStartup();
- ok(hr == S_OK, "Failed to start up, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr);
hr = CoGetApartmentType(&apttype, &qualifier);
- ok(hr == S_OK || broken(FAILED(hr)) /* Win8 */, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK || broken(FAILED(hr)) /* Win8 */, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
ok(apttype == APTTYPE_MTA && qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA,
"Unexpected apartment type %d, qualifier %d.\n", apttype, qualifier);
hr = RtwqShutdown();
- ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr);
hr = CoGetApartmentType(&apttype, &qualifier);
- ok(hr == CO_E_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
+ ok(hr == CO_E_NOTINITIALIZED, "Unexpected hr %#lx.\n", hr);
/* Try with STA initialized before startup. */
hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
- ok(hr == S_OK, "Failed to initialize, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to initialize, hr %#lx.\n", hr);
hr = CoGetApartmentType(&apttype, &qualifier);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(apttype == APTTYPE_MAINSTA && qualifier == APTTYPEQUALIFIER_NONE,
"Unexpected apartment type %d, qualifier %d.\n", apttype, qualifier);
hr = RtwqStartup();
- ok(hr == S_OK, "Failed to start up, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr);
hr = CoGetApartmentType(&apttype, &qualifier);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(apttype == APTTYPE_MAINSTA && qualifier == APTTYPEQUALIFIER_NONE,
"Unexpected apartment type %d, qualifier %d.\n", apttype, qualifier);
hr = RtwqShutdown();
- ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr);
CoUninitialize();
/* Startup -> init main STA -> uninitialize -> shutdown */
hr = RtwqStartup();
- ok(hr == S_OK, "Failed to start up, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to start up, hr %#lx.\n", hr);
hr = CoGetApartmentType(&apttype, &qualifier);
- ok(hr == S_OK || broken(FAILED(hr)) /* Win8 */, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK || broken(FAILED(hr)) /* Win8 */, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
ok(apttype == APTTYPE_MTA && qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA,
"Unexpected apartment type %d, qualifier %d.\n", apttype, qualifier);
hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
- ok(hr == S_OK, "Failed to initialize, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to initialize, hr %#lx.\n", hr);
hr = CoGetApartmentType(&apttype, &qualifier);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(apttype == APTTYPE_MAINSTA && qualifier == APTTYPEQUALIFIER_NONE,
"Unexpected apartment type %d, qualifier %d.\n", apttype, qualifier);
CoUninitialize();
hr = CoGetApartmentType(&apttype, &qualifier);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(apttype == APTTYPE_MTA && qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA,
"Unexpected apartment type %d, qualifier %d.\n", apttype, qualifier);
hr = RtwqShutdown();
- ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to shut down, hr %#lx.\n", hr);
}
START_TEST(rtworkq)
--
2.34.1
1
0
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/dinput/tests/Makefile.in | 1 -
dlls/dinput/tests/dinput.c | 1110 ++++++++++++++++++++++-----------
dlls/dinput/tests/dinput8.c | 728 ---------------------
3 files changed, 730 insertions(+), 1109 deletions(-)
delete mode 100644 dlls/dinput/tests/dinput8.c
diff --git a/dlls/dinput/tests/Makefile.in b/dlls/dinput/tests/Makefile.in
index 00295fed60f..b34afde882a 100644
--- a/dlls/dinput/tests/Makefile.in
+++ b/dlls/dinput/tests/Makefile.in
@@ -9,7 +9,6 @@ SOURCES = \
device.c \
device8.c \
dinput.c \
- dinput8.c \
driver_hid.c \
driver_hid.spec \
force_feedback.c \
diff --git a/dlls/dinput/tests/dinput.c b/dlls/dinput/tests/dinput.c
index 10da888fdd4..795a9ed39c6 100644
--- a/dlls/dinput/tests/dinput.c
+++ b/dlls/dinput/tests/dinput.c
@@ -30,37 +30,53 @@
HINSTANCE hInstance;
-enum directinput_versions
-{
- DIRECTINPUT_VERSION_300 = 0x0300,
- DIRECTINPUT_VERSION_500 = 0x0500,
- DIRECTINPUT_VERSION_50A = 0x050A,
- DIRECTINPUT_VERSION_5B2 = 0x05B2,
- DIRECTINPUT_VERSION_602 = 0x0602,
- DIRECTINPUT_VERSION_61A = 0x061A,
- DIRECTINPUT_VERSION_700 = 0x0700,
-};
-
-static const DWORD directinput_version_list[] =
-{
- DIRECTINPUT_VERSION_300,
- DIRECTINPUT_VERSION_500,
- DIRECTINPUT_VERSION_50A,
- DIRECTINPUT_VERSION_5B2,
- DIRECTINPUT_VERSION_602,
- DIRECTINPUT_VERSION_61A,
- DIRECTINPUT_VERSION_700,
-};
-
static HRESULT (WINAPI *pDirectInputCreateEx)(HINSTANCE, DWORD, REFIID, LPVOID *, LPUNKNOWN);
+static const DWORD dinput_versions[] =
+{
+ 0x0300,
+ 0x0500,
+ 0x050A,
+ 0x05B2,
+ 0x0602,
+ 0x061A,
+ 0x0700,
+ 0x0800,
+};
+
+static REFIID dinput7_interfaces[] =
+{
+ &IID_IDirectInputA,
+ &IID_IDirectInputW,
+ &IID_IDirectInput2A,
+ &IID_IDirectInput2W,
+ &IID_IDirectInput7A,
+ &IID_IDirectInput7W,
+};
+
+static REFIID dinput8_interfaces[] =
+{
+ &IID_IDirectInput8A,
+ &IID_IDirectInput8W,
+ &IID_IDirectInputJoyConfig8,
+};
+
+static HRESULT direct_input_create( DWORD version, IDirectInputA **out )
+{
+ HRESULT hr;
+ if (version < 0x800) hr = DirectInputCreateA( hInstance, version, out, NULL );
+ else hr = DirectInput8Create( hInstance, version, &IID_IDirectInput8A, (void **)out, NULL );
+ if (FAILED(hr)) win_skip( "Failed to instantiate a IDirectInput instance, hr %#x\n", hr );
+ return hr;
+}
+
static BOOL CALLBACK dummy_callback(const DIDEVICEINSTANCEA *instance, void *context)
{
ok(0, "Callback was invoked with parameters (%p, %p)\n", instance, context);
return DIENUM_STOP;
}
-static void test_preinitialization(void)
+static void test_CoCreateInstance( DWORD version )
{
static const struct
{
@@ -83,7 +99,6 @@ static void test_preinitialization(void)
LPDIENUMDEVICESCALLBACKA lpCallback;
DWORD dwFlags;
HRESULT expected_hr;
- int todo;
} enum_devices_tests[] =
{
{0, NULL, 0, DIERR_INVALIDPARAM},
@@ -96,122 +111,159 @@ static void test_preinitialization(void)
{0xdeadbeef, dummy_callback, ~0u, DIERR_INVALIDPARAM},
};
- IDirectInputA *pDI;
+ IDirectInputDeviceA *device;
+ IDirectInputA *dinput;
HRESULT hr;
+ LONG ref;
int i;
- IDirectInputDeviceA *pDID;
- hr = CoCreateInstance(&CLSID_DirectInput, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectInputA, (void **)&pDI);
+ if (version < 0x800) hr = CoCreateInstance( &CLSID_DirectInput, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IDirectInputA, (void **)&dinput );
+ else hr = CoCreateInstance( &CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IDirectInput8A, (void **)&dinput );
if (FAILED(hr))
{
- skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
+ win_skip( "Failed to instantiate a IDirectInput instance, hr %#x\n", hr );
return;
}
for (i = 0; i < ARRAY_SIZE(create_device_tests); i++)
{
- if (create_device_tests[i].pdev) pDID = (void *)0xdeadbeef;
- hr = IDirectInput_CreateDevice(pDI, create_device_tests[i].rguid,
- create_device_tests[i].pdev ? &pDID : NULL,
- NULL);
- ok(hr == create_device_tests[i].expected_hr, "[%d] IDirectInput_CreateDevice returned 0x%08x\n", i, hr);
- if (create_device_tests[i].pdev)
- ok(pDID == NULL, "[%d] Output interface pointer is %p\n", i, pDID);
+ winetest_push_context( "%u", i );
+ if (create_device_tests[i].pdev) device = (void *)0xdeadbeef;
+ hr = IDirectInput_CreateDevice( dinput, create_device_tests[i].rguid,
+ create_device_tests[i].pdev ? &device : NULL, NULL );
+ ok( hr == create_device_tests[i].expected_hr, "CreateDevice returned %#x\n", hr );
+ if (create_device_tests[i].pdev) ok( device == NULL, "got device %p\n", device );
+ winetest_pop_context();
}
for (i = 0; i < ARRAY_SIZE(enum_devices_tests); i++)
{
- hr = IDirectInput_EnumDevices(pDI, enum_devices_tests[i].dwDevType,
- enum_devices_tests[i].lpCallback,
- NULL,
- enum_devices_tests[i].dwFlags);
- todo_wine_if(enum_devices_tests[i].todo)
- ok(hr == enum_devices_tests[i].expected_hr, "[%d] IDirectInput_EnumDevice returned 0x%08x\n", i, hr);
+ winetest_push_context( "%u", i );
+ hr = IDirectInput_EnumDevices( dinput, enum_devices_tests[i].dwDevType,
+ enum_devices_tests[i].lpCallback, NULL, enum_devices_tests[i].dwFlags );
+ ok( hr == enum_devices_tests[i].expected_hr, "EnumDevice returned %#x\n", hr );
+ winetest_pop_context();
}
- hr = IDirectInput_GetDeviceStatus(pDI, NULL);
- ok(hr == E_POINTER, "IDirectInput_GetDeviceStatus returned 0x%08x\n", hr);
+ hr = IDirectInput_GetDeviceStatus( dinput, NULL );
+ ok( hr == E_POINTER, "GetDeviceStatus returned %#x\n", hr );
- hr = IDirectInput_GetDeviceStatus(pDI, &GUID_Unknown);
- ok(hr == DIERR_NOTINITIALIZED, "IDirectInput_GetDeviceStatus returned 0x%08x\n", hr);
+ hr = IDirectInput_GetDeviceStatus( dinput, &GUID_Unknown );
+ ok( hr == DIERR_NOTINITIALIZED, "GetDeviceStatus returned %#x\n", hr );
- hr = IDirectInput_GetDeviceStatus(pDI, &GUID_SysMouse);
- ok(hr == DIERR_NOTINITIALIZED, "IDirectInput_GetDeviceStatus returned 0x%08x\n", hr);
+ hr = IDirectInput_GetDeviceStatus( dinput, &GUID_SysMouse );
+ ok( hr == DIERR_NOTINITIALIZED, "GetDeviceStatus returned %#x\n", hr );
- hr = IDirectInput_RunControlPanel(pDI, NULL, 0);
- ok(hr == DIERR_NOTINITIALIZED, "IDirectInput_RunControlPanel returned 0x%08x\n", hr);
+ hr = IDirectInput_RunControlPanel( dinput, NULL, 0 );
+ ok( hr == DIERR_NOTINITIALIZED, "RunControlPanel returned %#x\n", hr );
- hr = IDirectInput_RunControlPanel(pDI, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_RunControlPanel returned 0x%08x\n", hr);
+ hr = IDirectInput_RunControlPanel( dinput, NULL, ~0u );
+ ok( hr == DIERR_INVALIDPARAM, "RunControlPanel returned %#x\n", hr );
- hr = IDirectInput_RunControlPanel(pDI, (HWND)0xdeadbeef, 0);
- ok(hr == E_HANDLE, "IDirectInput_RunControlPanel returned 0x%08x\n", hr);
+ hr = IDirectInput_RunControlPanel( dinput, (HWND)0xdeadbeef, 0 );
+ ok( hr == E_HANDLE, "RunControlPanel returned %#x\n", hr );
- hr = IDirectInput_RunControlPanel(pDI, (HWND)0xdeadbeef, ~0u);
- ok(hr == E_HANDLE, "IDirectInput_RunControlPanel returned 0x%08x\n", hr);
+ hr = IDirectInput_RunControlPanel( dinput, (HWND)0xdeadbeef, ~0u );
+ ok( hr == E_HANDLE, "RunControlPanel returned %#x\n", hr );
- IDirectInput_Release(pDI);
+ ref = IDirectInput_Release( dinput );
+ ok( ref == 0, "Release returned %d\n", ref );
}
-static void test_DirectInputCreateEx(void)
+static void test_DirectInputCreate( DWORD version )
{
- static const struct
+ IUnknown *unknown;
+ struct
{
- BOOL hinst;
- DWORD dwVersion;
- REFIID riid;
- BOOL ppdi;
+ HMODULE instance;
+ DWORD version;
+ REFIID iid;
+ IUnknown **out;
+ IUnknown *expect_out;
HRESULT expected_hr;
- IUnknown *expected_ppdi;
- } invalid_param_list[] =
+ } create_tests[] =
{
- {FALSE, 0, &IID_IUnknown, FALSE, DIERR_NOINTERFACE},
- {FALSE, 0, &IID_IUnknown, TRUE, DIERR_NOINTERFACE, (void *)0xdeadbeef},
- {FALSE, 0, &IID_IDirectInputA, FALSE, E_POINTER},
- {FALSE, 0, &IID_IDirectInputA, TRUE, DIERR_INVALIDPARAM, NULL},
- {FALSE, DIRECTINPUT_VERSION, &IID_IUnknown, FALSE, DIERR_NOINTERFACE},
- {FALSE, DIRECTINPUT_VERSION, &IID_IUnknown, TRUE, DIERR_NOINTERFACE, (void *)0xdeadbeef},
- {FALSE, DIRECTINPUT_VERSION, &IID_IDirectInputA, FALSE, E_POINTER},
- {FALSE, DIRECTINPUT_VERSION, &IID_IDirectInputA, TRUE, DIERR_INVALIDPARAM, NULL},
- {FALSE, DIRECTINPUT_VERSION - 1, &IID_IUnknown, FALSE, DIERR_NOINTERFACE},
- {FALSE, DIRECTINPUT_VERSION - 1, &IID_IUnknown, TRUE, DIERR_NOINTERFACE, (void *)0xdeadbeef},
- {FALSE, DIRECTINPUT_VERSION - 1, &IID_IDirectInputA, FALSE, E_POINTER},
- {FALSE, DIRECTINPUT_VERSION - 1, &IID_IDirectInputA, TRUE, DIERR_INVALIDPARAM, NULL},
- {FALSE, DIRECTINPUT_VERSION + 1, &IID_IUnknown, FALSE, DIERR_NOINTERFACE},
- {FALSE, DIRECTINPUT_VERSION + 1, &IID_IUnknown, TRUE, DIERR_NOINTERFACE, (void *)0xdeadbeef},
- {FALSE, DIRECTINPUT_VERSION + 1, &IID_IDirectInputA, FALSE, E_POINTER},
- {FALSE, DIRECTINPUT_VERSION + 1, &IID_IDirectInputA, TRUE, DIERR_INVALIDPARAM, NULL},
- {TRUE, 0, &IID_IUnknown, FALSE, DIERR_NOINTERFACE},
- {TRUE, 0, &IID_IUnknown, TRUE, DIERR_NOINTERFACE, (void *)0xdeadbeef},
- {TRUE, 0, &IID_IDirectInputA, FALSE, E_POINTER},
- {TRUE, 0, &IID_IDirectInputA, TRUE, DIERR_NOTINITIALIZED, NULL},
- {TRUE, DIRECTINPUT_VERSION, &IID_IUnknown, FALSE, DIERR_NOINTERFACE},
- {TRUE, DIRECTINPUT_VERSION, &IID_IUnknown, TRUE, DIERR_NOINTERFACE, (void *)0xdeadbeef},
- {TRUE, DIRECTINPUT_VERSION, &IID_IDirectInputA, FALSE, E_POINTER},
- {TRUE, DIRECTINPUT_VERSION - 1, &IID_IUnknown, FALSE, DIERR_NOINTERFACE},
- {TRUE, DIRECTINPUT_VERSION - 1, &IID_IUnknown, TRUE, DIERR_NOINTERFACE, (void *)0xdeadbeef},
- {TRUE, DIRECTINPUT_VERSION - 1, &IID_IDirectInputA, FALSE, E_POINTER},
- {TRUE, DIRECTINPUT_VERSION - 1, &IID_IDirectInputA, TRUE, DIERR_BETADIRECTINPUTVERSION, NULL},
- {TRUE, DIRECTINPUT_VERSION + 1, &IID_IUnknown, FALSE, DIERR_NOINTERFACE},
- {TRUE, DIRECTINPUT_VERSION + 1, &IID_IUnknown, TRUE, DIERR_NOINTERFACE, (void *)0xdeadbeef},
- {TRUE, DIRECTINPUT_VERSION + 1, &IID_IDirectInputA, FALSE, E_POINTER},
- {TRUE, DIRECTINPUT_VERSION + 1, &IID_IDirectInputA, TRUE, DIERR_OLDDIRECTINPUTVERSION, NULL},
+ {NULL, 0, NULL, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, 0, NULL, &unknown, NULL, DIERR_INVALIDPARAM},
+ {NULL, version, NULL, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version, NULL, &unknown, NULL, version == 0x300 ? DI_OK : DIERR_INVALIDPARAM},
+ {NULL, version - 1, NULL, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version - 1, NULL, &unknown, NULL, DIERR_INVALIDPARAM},
+ {NULL, version + 1, NULL, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version + 1, NULL, &unknown, NULL, DIERR_INVALIDPARAM},
+ {hInstance, 0, NULL, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, 0, NULL, &unknown, NULL, DIERR_NOTINITIALIZED},
+ {hInstance, version, NULL, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version - 1, NULL, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version - 1, NULL, &unknown, NULL, version <= 0x700 ? DIERR_BETADIRECTINPUTVERSION : DIERR_OLDDIRECTINPUTVERSION},
+ {hInstance, version + 1, NULL, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version + 1, NULL, &unknown, NULL, version < 0x700 ? DIERR_BETADIRECTINPUTVERSION : DIERR_OLDDIRECTINPUTVERSION},
};
-
- static REFIID no_interface_list[] = {&IID_IUnknown, &IID_IDirectInput8A,
- &IID_IDirectInput8W, &IID_IDirectInputDeviceA,
- &IID_IDirectInputDeviceW, &IID_IDirectInputDevice2A,
- &IID_IDirectInputDevice2W, &IID_IDirectInputDevice7A,
- &IID_IDirectInputDevice7W, &IID_IDirectInputDevice8A,
- &IID_IDirectInputDevice8W, &IID_IDirectInputEffect};
-
- static REFIID iid_list[] = {&IID_IDirectInputA, &IID_IDirectInputW,
- &IID_IDirectInput2A, &IID_IDirectInput2W,
- &IID_IDirectInput7A, &IID_IDirectInput7W};
-
- int i, j;
- IUnknown *pUnk;
HRESULT hr;
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(create_tests); i++)
+ {
+ winetest_push_context( "%u", i );
+ unknown = (void *)0xdeadbeef;
+ hr = DirectInputCreateW( create_tests[i].instance, create_tests[i].version, (IDirectInputW **)create_tests[i].out, NULL );
+ todo_wine_if(i == 3 && version == 0x300)
+ ok( hr == create_tests[i].expected_hr, "DirectInputCreateEx returned %#x\n", hr );
+ if (SUCCEEDED(hr)) IUnknown_Release( unknown );
+ else ok( unknown == create_tests[i].expect_out, "got IUnknown %p\n", unknown );
+ winetest_pop_context();
+ }
+}
+
+static void test_DirectInputCreateEx( DWORD version )
+{
+ IUnknown *unknown;
+ struct
+ {
+ HMODULE instance;
+ DWORD version;
+ REFIID iid;
+ IUnknown **out;
+ IUnknown *expect_out;
+ HRESULT expected_hr;
+ } create_tests[] =
+ {
+ {NULL, 0, &IID_IUnknown, NULL, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {NULL, 0, &IID_IUnknown, &unknown, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {NULL, 0, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, 0, &IID_IDirectInputA, &unknown, NULL, DIERR_INVALIDPARAM},
+ {NULL, version, &IID_IUnknown, NULL, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {NULL, version, &IID_IUnknown, &unknown, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {NULL, version, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version, &IID_IDirectInputA, &unknown, NULL, version == 0x300 ? DI_OK : DIERR_INVALIDPARAM},
+ {NULL, version - 1, &IID_IUnknown, NULL, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {NULL, version - 1, &IID_IUnknown, &unknown, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {NULL, version - 1, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version - 1, &IID_IDirectInputA, &unknown, NULL, DIERR_INVALIDPARAM},
+ {NULL, version + 1, &IID_IUnknown, NULL, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {NULL, version + 1, &IID_IUnknown, &unknown, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {NULL, version + 1, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version + 1, &IID_IDirectInputA, &unknown, NULL, DIERR_INVALIDPARAM},
+ {hInstance, 0, &IID_IUnknown, NULL, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {hInstance, 0, &IID_IUnknown, &unknown, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {hInstance, 0, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, 0, &IID_IDirectInputA, &unknown, NULL, DIERR_NOTINITIALIZED},
+ {hInstance, version, &IID_IUnknown, NULL, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {hInstance, version, &IID_IUnknown, &unknown, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {hInstance, version, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version - 1, &IID_IUnknown, NULL, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {hInstance, version - 1, &IID_IUnknown, &unknown, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {hInstance, version - 1, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version - 1, &IID_IDirectInputA, &unknown, NULL, version <= 0x700 ? DIERR_BETADIRECTINPUTVERSION : DIERR_OLDDIRECTINPUTVERSION},
+ {hInstance, version + 1, &IID_IUnknown, NULL, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {hInstance, version + 1, &IID_IUnknown, &unknown, (void *)0xdeadbeef, DIERR_NOINTERFACE},
+ {hInstance, version + 1, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version + 1, &IID_IDirectInputA, &unknown, NULL, version < 0x700 ? DIERR_BETADIRECTINPUTVERSION : DIERR_OLDDIRECTINPUTVERSION},
+ };
+ HRESULT hr;
+ int i;
if (!pDirectInputCreateEx)
{
@@ -219,391 +271,485 @@ static void test_DirectInputCreateEx(void)
return;
}
- for (i = 0; i < ARRAY_SIZE(invalid_param_list); i++)
+ for (i = 0; i < ARRAY_SIZE(create_tests); i++)
{
- if (invalid_param_list[i].ppdi) pUnk = (void *)0xdeadbeef;
- hr = pDirectInputCreateEx(invalid_param_list[i].hinst ? hInstance : NULL,
- invalid_param_list[i].dwVersion,
- invalid_param_list[i].riid,
- invalid_param_list[i].ppdi ? (void **)&pUnk : NULL,
- NULL);
- ok(hr == invalid_param_list[i].expected_hr, "[%d] DirectInputCreateEx returned 0x%08x\n", i, hr);
- if (invalid_param_list[i].ppdi)
- ok(pUnk == invalid_param_list[i].expected_ppdi, "[%d] Output interface pointer is %p\n", i, pUnk);
+ winetest_push_context( "%u", i );
+ unknown = (void *)0xdeadbeef;
+ hr = pDirectInputCreateEx( create_tests[i].instance, create_tests[i].version, create_tests[i].iid,
+ (void **)create_tests[i].out, NULL );
+ todo_wine_if( version == 0x300 && i == 7 )
+ ok( hr == create_tests[i].expected_hr, "DirectInputCreateEx returned %#x\n", hr );
+ if (SUCCEEDED(hr)) IUnknown_Release( unknown );
+ else ok( unknown == create_tests[i].expect_out, "got IUnknown %p\n", unknown );
+ winetest_pop_context();
}
- for (i = 0; i < ARRAY_SIZE(no_interface_list); i++)
+ for (i = 0; i < ARRAY_SIZE(dinput8_interfaces); i++)
{
- pUnk = (void *)0xdeadbeef;
- hr = pDirectInputCreateEx(hInstance, DIRECTINPUT_VERSION, no_interface_list[i], (void **)&pUnk, NULL);
- ok(hr == DIERR_NOINTERFACE, "[%d] DirectInputCreateEx returned 0x%08x\n", i, hr);
- ok(pUnk == (void *)0xdeadbeef, "[%d] Output interface pointer is %p\n", i, pUnk);
+ winetest_push_context( "%u", i );
+ unknown = (void *)0xdeadbeef;
+ hr = pDirectInputCreateEx( hInstance, version, dinput8_interfaces[i], (void **)&unknown, NULL );
+ ok( hr == DIERR_NOINTERFACE, "DirectInputCreateEx returned %#x\n", hr );
+ ok( unknown == (void *)0xdeadbeef, "got IUnknown %p\n", unknown );
+ winetest_pop_context();
}
- for (i = 0; i < ARRAY_SIZE(iid_list); i++)
+ for (i = 0; i < ARRAY_SIZE(dinput7_interfaces); i++)
{
- pUnk = NULL;
- hr = pDirectInputCreateEx(hInstance, DIRECTINPUT_VERSION, iid_list[i], (void **)&pUnk, NULL);
- ok(hr == DI_OK, "[%d] DirectInputCreateEx returned 0x%08x\n", i, hr);
- ok(pUnk != NULL, "[%d] Output interface pointer is NULL\n", i);
- if (pUnk)
- IUnknown_Release(pUnk);
- }
-
- /* Examine combinations of requested interfaces and version numbers. */
- for (i = 0; i < ARRAY_SIZE(directinput_version_list); i++)
- {
- for (j = 0; j < ARRAY_SIZE(iid_list); j++)
- {
- pUnk = NULL;
- hr = pDirectInputCreateEx(hInstance, directinput_version_list[i], iid_list[j], (void **)&pUnk, NULL);
- ok(hr == DI_OK, "[%d/%d] DirectInputCreateEx returned 0x%08x\n", i, j, hr);
- ok(pUnk != NULL, "[%d] Output interface pointer is NULL\n", i);
- if (pUnk)
- IUnknown_Release(pUnk);
- }
+ winetest_push_context( "%u", i );
+ unknown = NULL;
+ hr = pDirectInputCreateEx( hInstance, version, dinput7_interfaces[i], (void **)&unknown, NULL );
+ if (version < 0x800) ok( hr == DI_OK, "DirectInputCreateEx returned %#x\n", hr );
+ else ok( hr == DIERR_OLDDIRECTINPUTVERSION, "DirectInputCreateEx returned %#x\n", hr );
+ if (version < 0x800) ok( unknown != NULL, "got IUnknown NULL\n" );
+ else ok( unknown == NULL, "got IUnknown %p\n", unknown );
+ if (unknown) IUnknown_Release( unknown );
+ winetest_pop_context();
}
}
-static void test_QueryInterface(void)
+static void test_DirectInput8Create( DWORD version )
{
- static REFIID iid_list[] = {&IID_IUnknown, &IID_IDirectInputA, &IID_IDirectInputW,
- &IID_IDirectInput2A, &IID_IDirectInput2W,
- &IID_IDirectInput7A, &IID_IDirectInput7W};
-
- static REFIID no_interface_list[] =
+ IUnknown *unknown;
+ struct
{
- &IID_IDirectInput8A,
- &IID_IDirectInput8W,
- &IID_IDirectInputDeviceA,
- &IID_IDirectInputDeviceW,
- &IID_IDirectInputDevice2A,
- &IID_IDirectInputDevice2W,
- &IID_IDirectInputDevice7A,
- &IID_IDirectInputDevice7W,
- &IID_IDirectInputDevice8A,
- &IID_IDirectInputDevice8W,
- &IID_IDirectInputEffect,
+ HMODULE instance;
+ DWORD version;
+ REFIID iid;
+ IUnknown **out;
+ IUnknown *expect_out;
+ HRESULT expected_hr;
+ } create_tests[] =
+ {
+ {NULL, 0, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, 0, &IID_IDirectInputA, &unknown, NULL, DIERR_NOINTERFACE},
+ {NULL, 0, &IID_IDirectInput8A, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, 0, &IID_IDirectInput8A, &unknown, NULL, DIERR_INVALIDPARAM},
+ {NULL, version, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version, &IID_IDirectInputA, &unknown, NULL, DIERR_NOINTERFACE},
+ {NULL, version, &IID_IDirectInput8A, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version, &IID_IDirectInput8A, &unknown, NULL, DIERR_INVALIDPARAM},
+ {NULL, version - 1, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version - 1, &IID_IDirectInputA, &unknown, NULL, DIERR_NOINTERFACE},
+ {NULL, version - 1, &IID_IDirectInput8A, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version - 1, &IID_IDirectInput8A, &unknown, NULL, DIERR_INVALIDPARAM},
+ {NULL, version + 1, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version + 1, &IID_IDirectInputA, &unknown, NULL, DIERR_NOINTERFACE},
+ {NULL, version + 1, &IID_IDirectInput8A, NULL, (void *)0xdeadbeef, E_POINTER},
+ {NULL, version + 1, &IID_IDirectInput8A, &unknown, NULL, DIERR_INVALIDPARAM},
+ {hInstance, 0, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, 0, &IID_IDirectInputA, &unknown, NULL, DIERR_NOINTERFACE},
+ {hInstance, 0, &IID_IDirectInput8A, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, 0, &IID_IDirectInput8A, &unknown, NULL, DIERR_NOTINITIALIZED},
+ {hInstance, version, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version, &IID_IDirectInputA, &unknown, NULL, DIERR_NOINTERFACE},
+ {hInstance, version, &IID_IDirectInput8A, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version - 1, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version - 1, &IID_IDirectInputA, &unknown, NULL, DIERR_NOINTERFACE},
+ {hInstance, version - 1, &IID_IDirectInput8A, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version - 1, &IID_IDirectInput8A, &unknown, NULL, DIERR_BETADIRECTINPUTVERSION},
+ {hInstance, version + 1, &IID_IDirectInputA, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version + 1, &IID_IDirectInputA, &unknown, NULL, DIERR_NOINTERFACE},
+ {hInstance, version + 1, &IID_IDirectInput8A, NULL, (void *)0xdeadbeef, E_POINTER},
+ {hInstance, version + 1, &IID_IDirectInput8A, &unknown, NULL, version <= 0x700 ? DIERR_BETADIRECTINPUTVERSION : DIERR_OLDDIRECTINPUTVERSION},
};
-
- IDirectInputA *pDI;
HRESULT hr;
- IUnknown *pUnk, *iface, *tmp_iface;
int i;
- hr = DirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &pDI, NULL);
- if (FAILED(hr))
+ for (i = 0; i < ARRAY_SIZE(create_tests); i++)
{
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
+ winetest_push_context( "%u", i );
+ unknown = (void *)0xdeadbeef;
+ hr = DirectInput8Create( create_tests[i].instance, create_tests[i].version, create_tests[i].iid,
+ (void **)create_tests[i].out, NULL );
+ ok( hr == create_tests[i].expected_hr, "DirectInput8Create returned %#x\n", hr );
+ if (SUCCEEDED(hr)) IUnknown_Release( unknown );
+ else ok( unknown == create_tests[i].expect_out, "got IUnknown %p\n", unknown );
+ winetest_pop_context();
}
- hr = IDirectInput_QueryInterface(pDI, NULL, NULL);
- ok(hr == E_POINTER, "IDirectInput_QueryInterface returned 0x%08x\n", hr);
-
- pUnk = (void *)0xdeadbeef;
- hr = IDirectInput_QueryInterface(pDI, NULL, (void **)&pUnk);
- ok(hr == E_POINTER, "IDirectInput_QueryInterface returned 0x%08x\n", hr);
- ok(pUnk == (void *)0xdeadbeef, "Output interface pointer is %p\n", pUnk);
-
- hr = IDirectInput_QueryInterface(pDI, &IID_IUnknown, NULL);
- ok(hr == E_POINTER, "IDirectInput_QueryInterface returned 0x%08x\n", hr);
-
- for (i = 0; i < ARRAY_SIZE(iid_list); i++)
+ for (i = 0; i < ARRAY_SIZE(dinput7_interfaces); i++)
{
- pUnk = NULL;
- hr = IDirectInput_QueryInterface(pDI, iid_list[i], (void **)&pUnk);
- ok(hr == S_OK, "[%d] IDirectInput_QueryInterface returned 0x%08x\n", i, hr);
- ok(pUnk != NULL, "[%d] Output interface pointer is NULL\n", i);
- if (pUnk) IUnknown_Release(pUnk);
+ winetest_push_context( "%u", i );
+ unknown = (void *)0xdeadbeef;
+ hr = DirectInput8Create( hInstance, version, dinput7_interfaces[i], (void **)&unknown, NULL );
+ ok( hr == DIERR_NOINTERFACE, "DirectInput8Create returned %#x\n", hr );
+ ok( unknown == NULL, "got IUnknown %p\n", unknown );
+ winetest_pop_context();
}
- for (i = 0; i < ARRAY_SIZE(no_interface_list); i++)
+ for (i = 0; i < ARRAY_SIZE(dinput8_interfaces); i++)
{
- pUnk = (void *)0xdeadbeef;
- hr = IDirectInput_QueryInterface(pDI, no_interface_list[i], (void **)&pUnk);
- ok(hr == E_NOINTERFACE, "[%d] IDirectInput_QueryInterface returned 0x%08x\n", i, hr);
- ok(pUnk == NULL, "[%d] Output interface pointer is %p\n", i, pUnk);
+ winetest_push_context( "%u", i );
+ unknown = NULL;
+ hr = DirectInput8Create( hInstance, version, dinput8_interfaces[i], (void **)&unknown, NULL );
+ if (i == 2) ok( hr == DIERR_NOINTERFACE, "DirectInput8Create returned %#x\n", hr );
+ else if (version == 0x800) ok( hr == DI_OK, "DirectInput8Create returned %#x\n", hr );
+ else ok( hr == DIERR_BETADIRECTINPUTVERSION, "DirectInput8Create returned %#x\n", hr );
+ if (i == 2) ok( unknown == NULL, "got IUnknown %p\n", unknown );
+ else if (version == 0x800) ok( unknown != NULL, "got NULL IUnknown\n" );
+ else ok( unknown == NULL, "got IUnknown %p\n", unknown );
+ if (unknown) IUnknown_Release( unknown );
+ winetest_pop_context();
}
-
- hr = IUnknown_QueryInterface( pDI, &IID_IDirectInputA, (void **)&iface );
- ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInputA) failed: %08x\n", hr );
- hr = IUnknown_QueryInterface( pDI, &IID_IDirectInput2A, (void **)&tmp_iface );
- ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInput2A) failed: %08x\n", hr );
- ok( tmp_iface == iface, "IID_IDirectInput2A iface differs from IID_IDirectInputA\n" );
- IUnknown_Release( tmp_iface );
- hr = IUnknown_QueryInterface( pDI, &IID_IDirectInput7A, (void **)&tmp_iface );
- ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInput7A) failed: %08x\n", hr );
- ok( tmp_iface == iface, "IID_IDirectInput7A iface differs from IID_IDirectInputA\n" );
- IUnknown_Release( tmp_iface );
- IUnknown_Release( iface );
-
- hr = IUnknown_QueryInterface( pDI, &IID_IUnknown, (void **)&iface );
- ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IUnknown) failed: %08x\n", hr );
- hr = IUnknown_QueryInterface( pDI, &IID_IDirectInputW, (void **)&tmp_iface );
- ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInputW) failed: %08x\n", hr );
- ok( tmp_iface == iface, "IID_IDirectInputW iface differs from IID_IUnknown\n" );
- IUnknown_Release( tmp_iface );
- hr = IUnknown_QueryInterface( pDI, &IID_IDirectInput2W, (void **)&tmp_iface );
- ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInput2W) failed: %08x\n", hr );
- ok( tmp_iface == iface, "IID_IDirectInput2W iface differs from IID_IUnknown\n" );
- IUnknown_Release( tmp_iface );
- hr = IUnknown_QueryInterface( pDI, &IID_IDirectInput7W, (void **)&tmp_iface );
- ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInput7W) failed: %08x\n", hr );
- ok( tmp_iface == iface, "IID_IDirectInput7W iface differs from IID_IUnknown\n" );
- IUnknown_Release( tmp_iface );
- IUnknown_Release( iface );
-
- IDirectInput_Release(pDI);
}
-static void test_CreateDevice(void)
+static void test_QueryInterface( DWORD version )
{
- IDirectInputA *pDI;
+ IUnknown *iface, *tmp_iface;
+ IDirectInputA *dinput;
HRESULT hr;
- IDirectInputDeviceA *pDID;
+ ULONG ref;
+ int i;
- hr = DirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &pDI, NULL);
- if (FAILED(hr))
+ if (FAILED(hr = direct_input_create( version, &dinput ))) return;
+
+ hr = IDirectInput_QueryInterface( dinput, NULL, NULL );
+ ok( hr == E_POINTER, "QueryInterface returned 0x%08x\n", hr );
+
+ iface = (void *)0xdeadbeef;
+ hr = IDirectInput_QueryInterface( dinput, NULL, (void **)&iface );
+ ok( hr == E_POINTER, "QueryInterface returned 0x%08x\n", hr );
+ ok( iface == (void *)0xdeadbeef, "Output interface pointer is %p\n", iface );
+
+ hr = IDirectInput_QueryInterface( dinput, &IID_IUnknown, NULL );
+ ok( hr == E_POINTER, "QueryInterface returned 0x%08x\n", hr );
+
+ hr = IDirectInput_QueryInterface( dinput, &IID_IUnknown, (void **)&iface );
+ ok( hr == S_OK, "QueryInterface returned 0x%08x\n", hr );
+ ok( iface != NULL, "got iface NULL\n" );
+ ref = IUnknown_Release( iface );
+ ok( ref == 1, "Release returned %u\n", ref );
+
+ for (i = 0; i < ARRAY_SIZE(dinput7_interfaces); i++)
{
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
+ winetest_push_context("%u", i);
+ iface = (void *)0xdeadbeef;
+ hr = IDirectInput_QueryInterface( dinput, dinput7_interfaces[i], (void **)&iface );
+ if (version >= 0x800)
+ {
+ ok( hr == E_NOINTERFACE, "QueryInterface returned 0x%08x\n", hr );
+ ok( iface == NULL, "got iface %p\n", iface );
+ }
+ else
+ {
+ ok( hr == S_OK, "QueryInterface returned 0x%08x\n", hr );
+ ok( iface != NULL, "got iface NULL\n" );
+ ref = IUnknown_Release( iface );
+ ok( ref == 1, "Release returned %u\n", ref );
+ }
+ winetest_pop_context();
}
- hr = IDirectInput_CreateDevice(pDI, NULL, NULL, NULL);
- ok(hr == E_POINTER, "IDirectInput_CreateDevice returned 0x%08x\n", hr);
+ for (i = 0; i < ARRAY_SIZE(dinput8_interfaces); i++)
+ {
+ winetest_push_context("%u", i);
+ iface = (void *)0xdeadbeef;
+ hr = IDirectInput_QueryInterface( dinput, dinput8_interfaces[i], (void **)&iface );
+ if (version < 0x800)
+ {
+ todo_wine_if(i == 2)
+ ok( hr == E_NOINTERFACE, "QueryInterface returned 0x%08x\n", hr );
+ todo_wine_if(i == 2)
+ ok( iface == NULL, "got iface %p\n", iface );
+ }
+ else
+ {
+ ok( hr == S_OK, "QueryInterface returned 0x%08x\n", hr );
+ ok( iface != NULL, "got iface NULL\n" );
+ ref = IUnknown_Release( iface );
+ ok( ref == 1, "Release returned %u\n", ref );
+ }
+ winetest_pop_context();
+ }
- pDID = (void *)0xdeadbeef;
- hr = IDirectInput_CreateDevice(pDI, NULL, &pDID, NULL);
- ok(hr == E_POINTER, "IDirectInput_CreateDevice returned 0x%08x\n", hr);
- ok(pDID == NULL, "Output interface pointer is %p\n", pDID);
+ if (version < 0x800)
+ {
+ hr = IUnknown_QueryInterface( dinput, &IID_IDirectInputA, (void **)&iface );
+ ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInputA) failed: %08x\n", hr );
+ hr = IUnknown_QueryInterface( dinput, &IID_IDirectInput2A, (void **)&tmp_iface );
+ ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInput2A) failed: %08x\n", hr );
+ ok( tmp_iface == iface, "IID_IDirectInput2A iface differs from IID_IDirectInputA\n" );
+ IUnknown_Release( tmp_iface );
+ hr = IUnknown_QueryInterface( dinput, &IID_IDirectInput7A, (void **)&tmp_iface );
+ ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInput7A) failed: %08x\n", hr );
+ ok( tmp_iface == iface, "IID_IDirectInput7A iface differs from IID_IDirectInputA\n" );
+ IUnknown_Release( tmp_iface );
+ IUnknown_Release( iface );
- hr = IDirectInput_CreateDevice(pDI, &GUID_Unknown, NULL, NULL);
- ok(hr == E_POINTER, "IDirectInput_CreateDevice returned 0x%08x\n", hr);
+ hr = IUnknown_QueryInterface( dinput, &IID_IUnknown, (void **)&iface );
+ ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IUnknown) failed: %08x\n", hr );
+ hr = IUnknown_QueryInterface( dinput, &IID_IDirectInputW, (void **)&tmp_iface );
+ ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInputW) failed: %08x\n", hr );
+ ok( tmp_iface == iface, "IID_IDirectInputW iface differs from IID_IUnknown\n" );
+ IUnknown_Release( tmp_iface );
+ hr = IUnknown_QueryInterface( dinput, &IID_IDirectInput2W, (void **)&tmp_iface );
+ ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInput2W) failed: %08x\n", hr );
+ ok( tmp_iface == iface, "IID_IDirectInput2W iface differs from IID_IUnknown\n" );
+ IUnknown_Release( tmp_iface );
+ hr = IUnknown_QueryInterface( dinput, &IID_IDirectInput7W, (void **)&tmp_iface );
+ ok( SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInput7W) failed: %08x\n", hr );
+ ok( tmp_iface == iface, "IID_IDirectInput7W iface differs from IID_IUnknown\n" );
+ IUnknown_Release( tmp_iface );
+ IUnknown_Release( iface );
+ }
- pDID = (void *)0xdeadbeef;
- hr = IDirectInput_CreateDevice(pDI, &GUID_Unknown, &pDID, NULL);
- ok(hr == DIERR_DEVICENOTREG, "IDirectInput_CreateDevice returned 0x%08x\n", hr);
- ok(pDID == NULL, "Output interface pointer is %p\n", pDID);
+ ref = IDirectInput_Release( dinput );
+ todo_wine_if( version < 0x800 )
+ ok( ref == 0, "Release returned %u\n", ref );
+}
- hr = IDirectInput_CreateDevice(pDI, &GUID_SysMouse, NULL, NULL);
- ok(hr == E_POINTER, "IDirectInput_CreateDevice returned 0x%08x\n", hr);
+static void test_CreateDevice( DWORD version )
+{
+ IDirectInputDeviceA *device;
+ IDirectInputA *dinput;
+ HRESULT hr;
+ ULONG ref;
- hr = IDirectInput_CreateDevice(pDI, &GUID_SysMouse, &pDID, NULL);
- ok(hr == DI_OK, "IDirectInput_CreateDevice returned 0x%08x\n", hr);
+ if (FAILED(hr = direct_input_create( version, &dinput ))) return;
- IDirectInputDevice_Release(pDID);
- IDirectInput_Release(pDI);
+ hr = IDirectInput_CreateDevice( dinput, NULL, NULL, NULL );
+ ok( hr == E_POINTER, "CreateDevice returned 0x%08x\n", hr );
+
+ device = (void *)0xdeadbeef;
+ hr = IDirectInput_CreateDevice( dinput, NULL, &device, NULL );
+ ok( hr == E_POINTER, "CreateDevice returned 0x%08x\n", hr );
+ ok( device == NULL, "Output interface pointer is %p\n", device );
+
+ hr = IDirectInput_CreateDevice( dinput, &GUID_Unknown, NULL, NULL );
+ ok( hr == E_POINTER, "CreateDevice returned 0x%08x\n", hr );
+
+ device = (void *)0xdeadbeef;
+ hr = IDirectInput_CreateDevice( dinput, &GUID_Unknown, &device, NULL );
+ ok( hr == DIERR_DEVICENOTREG, "CreateDevice returned 0x%08x\n", hr );
+ ok( device == NULL, "Output interface pointer is %p\n", device );
+
+ hr = IDirectInput_CreateDevice( dinput, &GUID_SysMouse, NULL, NULL );
+ ok( hr == E_POINTER, "CreateDevice returned 0x%08x\n", hr );
+
+ hr = IDirectInput_CreateDevice( dinput, &GUID_SysMouse, &device, NULL );
+ ok( hr == DI_OK, "CreateDevice returned 0x%08x\n", hr );
+
+ ref = IDirectInputDevice_Release( device );
+ ok( ref == 0, "Release returned %u\n", ref );
+ ref = IDirectInput_Release( dinput );
+ ok( ref == 0, "Release returned %u\n", ref );
}
struct enum_devices_test
{
unsigned int device_count;
BOOL return_value;
+ DWORD version;
};
+DEFINE_GUID( pidvid_product_guid, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 'P', 'I', 'D', 'V', 'I', 'D' );
+
static BOOL CALLBACK enum_devices_callback(const DIDEVICEINSTANCEA *instance, void *context)
{
+ BYTE type = GET_DIDEVICE_TYPE( instance->dwDevType );
struct enum_devices_test *enum_test = context;
- if ((instance->dwDevType & 0xff) == DIDEVTYPE_KEYBOARD ||
- (instance->dwDevType & 0xff) == DIDEVTYPE_MOUSE) {
- const char *device = ((instance->dwDevType & 0xff) ==
- DIDEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse";
- ok(IsEqualGUID(&instance->guidInstance, &instance->guidProduct),
- "%s guidInstance (%s) does not match guidProduct (%s)\n",
- device, wine_dbgstr_guid(&instance->guidInstance),
- wine_dbgstr_guid(&instance->guidProduct));
+ if (winetest_debug > 1)
+ {
+ trace( "---- Device Information ----\n"
+ "Product Name : %s\n"
+ "Instance Name : %s\n"
+ "devType : 0x%08x\n"
+ "GUID Product : %s\n"
+ "GUID Instance : %s\n"
+ "HID Page : 0x%04x\n"
+ "HID Usage : 0x%04x\n",
+ instance->tszProductName, instance->tszInstanceName, instance->dwDevType,
+ wine_dbgstr_guid( &instance->guidProduct ),
+ wine_dbgstr_guid( &instance->guidInstance ), instance->wUsagePage, instance->wUsage );
}
- if ((instance->dwDevType & 0xff) == DIDEVTYPE_KEYBOARD)
- ok(IsEqualGUID(&instance->guidProduct, &GUID_SysKeyboard),
- "Keyboard guidProduct (%s) does not match GUID_SysKeyboard (%s)\n",
- wine_dbgstr_guid(&instance->guidProduct),
- wine_dbgstr_guid(&GUID_SysMouse));
- else if ((instance->dwDevType & 0xff) == DIDEVTYPE_MOUSE)
- ok(IsEqualGUID(&instance->guidProduct, &GUID_SysMouse),
- "Mouse guidProduct (%s) does not match GUID_SysMouse (%s)\n",
- wine_dbgstr_guid(&instance->guidProduct),
- wine_dbgstr_guid(&GUID_SysMouse));
- else {
- /* Non-keyboard/mouse devices use the "PIDVID" guidProduct */
- static const GUID pidvid_product_guid = { /* device_pidvid-0000-0000-0000-504944564944 "PIDVID" */
- 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44}
- };
+ if (enum_test->version >= 0x800)
+ {
+ if (type == DI8DEVTYPE_KEYBOARD || type == DI8DEVTYPE_MOUSE)
+ {
+ const char *device = (type == DI8DEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse";
+ ok( IsEqualGUID( &instance->guidInstance, &instance->guidProduct ),
+ "%s guidInstance (%s) does not match guidProduct (%s)\n", device,
+ wine_dbgstr_guid( &instance->guidInstance ), wine_dbgstr_guid( &instance->guidProduct ) );
+ }
+ }
+ else
+ {
+ if (type == DIDEVTYPE_KEYBOARD || type == DIDEVTYPE_MOUSE)
+ {
+ const char *device = (type == DIDEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse";
+ ok( IsEqualGUID( &instance->guidInstance, &instance->guidProduct ),
+ "%s guidInstance (%s) does not match guidProduct (%s)\n", device,
+ wine_dbgstr_guid( &instance->guidInstance ), wine_dbgstr_guid( &instance->guidProduct ) );
+ }
- ok(instance->guidProduct.Data2 == pidvid_product_guid.Data2,
- "guidProduct.Data2 is %04x\n", instance->guidProduct.Data2);
- ok(instance->guidProduct.Data3 == pidvid_product_guid.Data3,
- "guidProduct.Data3 is %04x\n", instance->guidProduct.Data3);
- ok(!memcmp(instance->guidProduct.Data4, pidvid_product_guid.Data4, sizeof(pidvid_product_guid.Data4)),
- "guidProduct.Data4 does not match: %s\n", wine_dbgstr_guid(&instance->guidProduct));
+ if (type == DIDEVTYPE_KEYBOARD)
+ ok( IsEqualGUID( &instance->guidProduct, &GUID_SysKeyboard ),
+ "Keyboard guidProduct (%s) does not match GUID_SysKeyboard (%s)\n",
+ wine_dbgstr_guid( &instance->guidProduct ), wine_dbgstr_guid( &GUID_SysMouse ) );
+ else if (type == DIDEVTYPE_MOUSE)
+ ok( IsEqualGUID( &instance->guidProduct, &GUID_SysMouse ),
+ "Mouse guidProduct (%s) does not match GUID_SysMouse (%s)\n",
+ wine_dbgstr_guid( &instance->guidProduct ), wine_dbgstr_guid( &GUID_SysMouse ) );
+ else
+ {
+ ok( instance->guidProduct.Data2 == pidvid_product_guid.Data2,
+ "guidProduct.Data2 is %04x\n", instance->guidProduct.Data2 );
+ ok( instance->guidProduct.Data3 == pidvid_product_guid.Data3,
+ "guidProduct.Data3 is %04x\n", instance->guidProduct.Data3 );
+ ok( !memcmp( instance->guidProduct.Data4, pidvid_product_guid.Data4,
+ sizeof(pidvid_product_guid.Data4) ),
+ "guidProduct.Data4 does not match: %s\n", wine_dbgstr_guid( &instance->guidProduct ) );
+ }
}
enum_test->device_count++;
return enum_test->return_value;
}
-static void test_EnumDevices(void)
+static void test_EnumDevices( DWORD version )
{
- IDirectInputA *pDI;
+ struct enum_devices_test enum_test = {.version = version}, enum_test_return = {.version = version};
+ IDirectInputA *dinput;
HRESULT hr;
- struct enum_devices_test enum_test, enum_test_return;
+ ULONG ref;
- hr = DirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &pDI, NULL);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
+ if (FAILED(hr = direct_input_create( version, &dinput ))) return;
- hr = IDirectInput_EnumDevices(pDI, 0, NULL, NULL, 0);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_EnumDevices returned 0x%08x\n", hr);
+ hr = IDirectInput_EnumDevices( dinput, 0, NULL, NULL, 0 );
+ ok( hr == DIERR_INVALIDPARAM, "EnumDevices returned 0x%08x\n", hr );
- hr = IDirectInput_EnumDevices(pDI, 0, NULL, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_EnumDevices returned 0x%08x\n", hr);
+ hr = IDirectInput_EnumDevices( dinput, 0, NULL, NULL, ~0u );
+ ok( hr == DIERR_INVALIDPARAM, "EnumDevices returned 0x%08x\n", hr );
/* Test crashes on Wine. */
if (0)
{
- hr = IDirectInput_EnumDevices(pDI, 0, enum_devices_callback, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_EnumDevices returned 0x%08x\n", hr);
+ hr = IDirectInput_EnumDevices( dinput, 0, enum_devices_callback, NULL, ~0u );
+ ok( hr == DIERR_INVALIDPARAM, "EnumDevices returned 0x%08x\n", hr );
}
- hr = IDirectInput_EnumDevices(pDI, 0xdeadbeef, NULL, NULL, 0);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_EnumDevices returned 0x%08x\n", hr);
+ hr = IDirectInput_EnumDevices( dinput, 0xdeadbeef, NULL, NULL, 0 );
+ ok( hr == DIERR_INVALIDPARAM, "EnumDevices returned 0x%08x\n", hr );
- hr = IDirectInput_EnumDevices(pDI, 0xdeadbeef, NULL, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_EnumDevices returned 0x%08x\n", hr);
+ hr = IDirectInput_EnumDevices( dinput, 0xdeadbeef, NULL, NULL, ~0u );
+ ok( hr == DIERR_INVALIDPARAM, "EnumDevices returned 0x%08x\n", hr );
- hr = IDirectInput_EnumDevices(pDI, 0xdeadbeef, enum_devices_callback, NULL, 0);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_EnumDevices returned 0x%08x\n", hr);
+ hr = IDirectInput_EnumDevices( dinput, 0xdeadbeef, enum_devices_callback, NULL, 0 );
+ ok( hr == DIERR_INVALIDPARAM, "EnumDevices returned 0x%08x\n", hr );
- hr = IDirectInput_EnumDevices(pDI, 0xdeadbeef, enum_devices_callback, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_EnumDevices returned 0x%08x\n", hr);
+ hr = IDirectInput_EnumDevices( dinput, 0xdeadbeef, enum_devices_callback, NULL, ~0u );
+ ok( hr == DIERR_INVALIDPARAM, "EnumDevices returned 0x%08x\n", hr );
enum_test.device_count = 0;
enum_test.return_value = DIENUM_CONTINUE;
- hr = IDirectInput_EnumDevices(pDI, 0, enum_devices_callback, &enum_test, 0);
- ok(hr == DI_OK, "IDirectInput_EnumDevices returned 0x%08x\n", hr);
+ hr = IDirectInput_EnumDevices( dinput, 0, enum_devices_callback, &enum_test, 0 );
+ ok( hr == DI_OK, "EnumDevices returned 0x%08x\n", hr );
ok(enum_test.device_count != 0, "Device count is %u\n", enum_test.device_count);
/* Enumeration only stops with an explicit DIENUM_STOP. */
enum_test_return.device_count = 0;
enum_test_return.return_value = 42;
- hr = IDirectInput_EnumDevices(pDI, 0, enum_devices_callback, &enum_test_return, 0);
- ok(hr == DI_OK, "IDirectInput_EnumDevices returned 0x%08x\n", hr);
+ hr = IDirectInput_EnumDevices( dinput, 0, enum_devices_callback, &enum_test_return, 0 );
+ ok( hr == DI_OK, "EnumDevices returned 0x%08x\n", hr );
ok(enum_test_return.device_count == enum_test.device_count,
"Device count is %u vs. %u\n", enum_test_return.device_count, enum_test.device_count);
enum_test.device_count = 0;
enum_test.return_value = DIENUM_STOP;
- hr = IDirectInput_EnumDevices(pDI, 0, enum_devices_callback, &enum_test, 0);
- ok(hr == DI_OK, "IDirectInput_EnumDevices returned 0x%08x\n", hr);
+ hr = IDirectInput_EnumDevices( dinput, 0, enum_devices_callback, &enum_test, 0 );
+ ok( hr == DI_OK, "EnumDevices returned 0x%08x\n", hr );
ok(enum_test.device_count == 1, "Device count is %u\n", enum_test.device_count);
- IDirectInput_Release(pDI);
+ ref = IDirectInput_Release( dinput );
+ ok( ref == 0, "Release returned %u\n", ref );
}
-static void test_GetDeviceStatus(void)
+static void test_GetDeviceStatus( DWORD version )
{
- IDirectInputA *pDI;
+ IDirectInputA *dinput;
HRESULT hr;
+ ULONG ref;
- hr = DirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &pDI, NULL);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
+ if (FAILED(hr = direct_input_create( version, &dinput ))) return;
- hr = IDirectInput_GetDeviceStatus(pDI, NULL);
- ok(hr == E_POINTER, "IDirectInput_GetDeviceStatus returned 0x%08x\n", hr);
+ hr = IDirectInput_GetDeviceStatus( dinput, NULL );
+ ok( hr == E_POINTER, "GetDeviceStatus returned %#x\n", hr );
- hr = IDirectInput_GetDeviceStatus(pDI, &GUID_Unknown);
+ hr = IDirectInput_GetDeviceStatus( dinput, &GUID_Unknown );
todo_wine
- ok(hr == DIERR_DEVICENOTREG, "IDirectInput_GetDeviceStatus returned 0x%08x\n", hr);
+ ok( hr == DIERR_DEVICENOTREG, "GetDeviceStatus returned %#x\n", hr );
- hr = IDirectInput_GetDeviceStatus(pDI, &GUID_SysMouse);
- ok(hr == DI_OK, "IDirectInput_GetDeviceStatus returned 0x%08x\n", hr);
+ hr = IDirectInput_GetDeviceStatus( dinput, &GUID_SysMouse );
+ ok( hr == DI_OK, "GetDeviceStatus returned %#x\n", hr );
- IDirectInput_Release(pDI);
+ ref = IDirectInput_Release( dinput );
+ ok( ref == 0, "Release returned %u\n", ref );
}
-static void test_Initialize(void)
+static void test_Initialize( DWORD version )
{
- IDirectInputA *pDI;
+ IDirectInputA *dinput;
HRESULT hr;
- int i;
+ ULONG ref;
- hr = CoCreateInstance(&CLSID_DirectInput, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectInputA, (void **)&pDI);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
+ if (FAILED(hr = direct_input_create( version, &dinput ))) return;
- hr = IDirectInput_Initialize(pDI, NULL, 0);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_Initialize returned 0x%08x\n", hr);
+ hr = IDirectInput_Initialize( dinput, NULL, 0 );
+ ok( hr == DIERR_INVALIDPARAM, "Initialize returned %#x\n", hr );
- hr = IDirectInput_Initialize(pDI, NULL, DIRECTINPUT_VERSION);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_Initialize returned 0x%08x\n", hr);
+ hr = IDirectInput_Initialize( dinput, NULL, version );
+ if (version == 0x300) todo_wine ok( hr == S_OK, "Initialize returned %#x\n", hr );
+ else ok( hr == DIERR_INVALIDPARAM, "Initialize returned %#x\n", hr );
- hr = IDirectInput_Initialize(pDI, hInstance, 0);
- ok(hr == DIERR_NOTINITIALIZED, "IDirectInput_Initialize returned 0x%08x\n", hr);
+ hr = IDirectInput_Initialize( dinput, hInstance, 0 );
+ ok( hr == DIERR_NOTINITIALIZED, "Initialize returned %#x\n", hr );
- /* Invalid DirectInput versions less than 0x0700 yield DIERR_BETADIRECTINPUTVERSION. */
- hr = IDirectInput_Initialize(pDI, hInstance, 0x0123);
- ok(hr == DIERR_BETADIRECTINPUTVERSION, "IDirectInput_Initialize returned 0x%08x\n", hr);
+ hr = IDirectInput_Initialize( dinput, hInstance, version - 1 );
+ ok( hr == DIERR_BETADIRECTINPUTVERSION, "Initialize returned %#x\n", hr );
- /* Invalid DirectInput versions greater than 0x0700 yield DIERR_BETADIRECTINPUTVERSION. */
- hr = IDirectInput_Initialize(pDI, hInstance, 0xcafe);
- ok(hr == DIERR_OLDDIRECTINPUTVERSION, "IDirectInput_Initialize returned 0x%08x\n", hr);
-
- for (i = 0; i < ARRAY_SIZE(directinput_version_list); i++)
- {
- hr = IDirectInput_Initialize(pDI, hInstance, directinput_version_list[i]);
- ok(hr == DI_OK, "IDirectInput_Initialize returned 0x%08x\n", hr);
- }
+ hr = IDirectInput_Initialize( dinput, hInstance, version + 1 );
+ if (version >= 0x700) ok( hr == DIERR_OLDDIRECTINPUTVERSION, "Initialize returned %#x\n", hr );
+ else ok( hr == DIERR_BETADIRECTINPUTVERSION, "Initialize returned %#x\n", hr );
/* Parameters are still validated after successful initialization. */
- hr = IDirectInput_Initialize(pDI, hInstance, 0);
- ok(hr == DIERR_NOTINITIALIZED, "IDirectInput_Initialize returned 0x%08x\n", hr);
+ hr = IDirectInput_Initialize( dinput, hInstance, 0 );
+ ok( hr == DIERR_NOTINITIALIZED, "Initialize returned %#x\n", hr );
- IDirectInput_Release(pDI);
+ ref = IDirectInput_Release( dinput );
+ ok( ref == 0, "Release returned %u\n", ref );
}
-static void test_RunControlPanel(void)
+static void test_RunControlPanel( DWORD version )
{
- IDirectInputA *pDI;
+ IDirectInputA *dinput;
HRESULT hr;
+ ULONG ref;
- hr = DirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &pDI, NULL);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
+ if (FAILED(hr = direct_input_create( version, &dinput ))) return;
if (winetest_interactive)
{
- hr = IDirectInput_RunControlPanel(pDI, NULL, 0);
- ok(hr == S_OK, "IDirectInput_RunControlPanel returned 0x%08x\n", hr);
+ hr = IDirectInput_RunControlPanel( dinput, NULL, 0 );
+ ok( hr == S_OK, "RunControlPanel returned %#x\n", hr );
- hr = IDirectInput_RunControlPanel(pDI, GetDesktopWindow(), 0);
- ok(hr == S_OK, "IDirectInput_RunControlPanel returned 0x%08x\n", hr);
+ hr = IDirectInput_RunControlPanel( dinput, GetDesktopWindow(), 0 );
+ ok( hr == S_OK, "RunControlPanel returned %#x\n", hr );
}
- hr = IDirectInput_RunControlPanel(pDI, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput_RunControlPanel returned 0x%08x\n", hr);
+ hr = IDirectInput_RunControlPanel( dinput, NULL, ~0u );
+ ok( hr == DIERR_INVALIDPARAM, "RunControlPanel returned %#x\n", hr );
- hr = IDirectInput_RunControlPanel(pDI, (HWND)0xdeadbeef, 0);
- ok(hr == E_HANDLE, "IDirectInput_RunControlPanel returned 0x%08x\n", hr);
+ hr = IDirectInput_RunControlPanel( dinput, (HWND)0xdeadbeef, 0 );
+ ok( hr == E_HANDLE, "RunControlPanel returned %#x\n", hr );
- hr = IDirectInput_RunControlPanel(pDI, (HWND)0xdeadbeef, ~0u);
- ok(hr == E_HANDLE, "IDirectInput_RunControlPanel returned 0x%08x\n", hr);
+ hr = IDirectInput_RunControlPanel( dinput, (HWND)0xdeadbeef, ~0u );
+ ok( hr == E_HANDLE, "RunControlPanel returned %#x\n", hr );
- IDirectInput_Release(pDI);
+ ref = IDirectInput_Release( dinput );
+ ok( ref == 0, "Release returned %u\n", ref );
}
static void test_DirectInputJoyConfig8(void)
@@ -644,7 +790,7 @@ static void test_DirectInputJoyConfig8(void)
if (SUCCEEDED(hr))
{
hr = IDirectInput_CreateDevice(pDI, &info.guidInstance, &pDID, NULL);
- ok (SUCCEEDED(hr), "IDirectInput_CreateDevice failed with guid from GetConfig hr = 0x%08x\n", hr);
+ ok( SUCCEEDED(hr), "CreateDevice failed with guid from GetConfig hr = 0x%08x\n", hr );
IDirectInputDevice_Release(pDID);
}
}
@@ -653,23 +799,227 @@ static void test_DirectInputJoyConfig8(void)
IDirectInput_Release(pDI);
}
+struct enum_semantics_test
+{
+ unsigned int device_count;
+ DWORD first_remaining;
+ BOOL mouse;
+ BOOL keyboard;
+ DIACTIONFORMATA *action_format;
+ const char *username;
+};
+
+static DIACTIONA actionMapping[] = {
+ /* axis */
+ {0, 0x01008A01 /* DIAXIS_DRIVINGR_STEER */, 0, {"Steer.\0"}},
+ /* button */
+ {1, 0x01000C01 /* DIBUTTON_DRIVINGR_SHIFTUP */, 0, {"Upshift.\0"}},
+ /* keyboard key */
+ {2, DIKEYBOARD_SPACE, 0, {"Missile.\0"}},
+ /* mouse button */
+ {3, DIMOUSE_BUTTON0, 0, {"Select\0"}},
+ /* mouse axis */
+ {4, DIMOUSE_YAXIS, 0, {"Y Axis\0"}}};
+/* By placing the memory pointed to by lptszActionName right before memory with PAGE_NOACCESS
+ * one can find out that the regular ansi string termination is not respected by
+ * EnumDevicesBySemantics. Adding a double termination, making it a valid wide string termination,
+ * made the test succeed. Therefore it looks like ansi version of EnumDevicesBySemantics forwards
+ * the string to the wide variant without conversation. */
+
+static BOOL CALLBACK enum_semantics_callback( const DIDEVICEINSTANCEA *lpddi, IDirectInputDevice8A *lpdid,
+ DWORD dwFlags, DWORD dwRemaining, void *context )
+{
+ struct enum_semantics_test *data = context;
+
+ if (context == NULL) return DIENUM_STOP;
+
+ if (!data->device_count)
+ {
+ data->first_remaining = dwRemaining;
+ }
+ ok( dwRemaining == data->first_remaining - data->device_count,
+ "enum semantics remaining devices is wrong, expected %d, had %d\n",
+ data->first_remaining - data->device_count, dwRemaining );
+ data->device_count++;
+
+ if (IsEqualGUID( &lpddi->guidInstance, &GUID_SysKeyboard )) data->keyboard = TRUE;
+
+ if (IsEqualGUID( &lpddi->guidInstance, &GUID_SysMouse )) data->mouse = TRUE;
+
+ return DIENUM_CONTINUE;
+}
+
+static BOOL CALLBACK set_action_map_callback( const DIDEVICEINSTANCEA *lpddi, IDirectInputDevice8A *lpdid,
+ DWORD dwFlags, DWORD dwRemaining, void *context )
+{
+ HRESULT hr;
+ struct enum_semantics_test *data = context;
+
+ /* Building and setting an action map */
+ /* It should not use any pre-stored mappings so we use DIDBAM_INITIALIZE */
+ hr = IDirectInputDevice8_BuildActionMap( lpdid, data->action_format, NULL, DIDBAM_INITIALIZE );
+ ok( SUCCEEDED(hr), "BuildActionMap failed hr=%08x\n", hr );
+
+ hr = IDirectInputDevice8_SetActionMap( lpdid, data->action_format, data->username, 0 );
+ ok( SUCCEEDED(hr), "SetActionMap failed hr=%08x\n", hr );
+
+ return DIENUM_CONTINUE;
+}
+
+static void test_EnumDevicesBySemantics(void)
+{
+ DIACTIONFORMATA action_format;
+ const GUID ACTION_MAPPING_GUID = {0x1, 0x2, 0x3, {0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}};
+ struct enum_semantics_test data = {0, 0, FALSE, FALSE, &action_format, NULL};
+ IDirectInput8A *dinput;
+ int device_total = 0;
+ HRESULT hr;
+
+ hr = DirectInput8Create( hInstance, 0x800, &IID_IDirectInput8A, (void **)&dinput, NULL );
+ if (FAILED(hr))
+ {
+ win_skip( "Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr );
+ return;
+ }
+
+ memset( &action_format, 0, sizeof(action_format) );
+ action_format.dwSize = sizeof(action_format);
+ action_format.dwActionSize = sizeof(DIACTIONA);
+ action_format.dwNumActions = ARRAY_SIZE(actionMapping);
+ action_format.dwDataSize = 4 * action_format.dwNumActions;
+ action_format.rgoAction = actionMapping;
+ action_format.guidActionMap = ACTION_MAPPING_GUID;
+ action_format.dwGenre = 0x01000000; /* DIVIRTUAL_DRIVING_RACE */
+ action_format.dwBufferSize = 32;
+
+ /* Test enumerating all attached and installed devices */
+ data.keyboard = FALSE;
+ data.mouse = FALSE;
+ data.device_count = 0;
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, NULL, &action_format, enum_semantics_callback,
+ &data, DIEDBSFL_ATTACHEDONLY );
+ ok( data.device_count > 0, "EnumDevicesBySemantics did not call the callback hr=%08x\n", hr );
+ ok( data.keyboard, "EnumDevicesBySemantics should enumerate the keyboard\n" );
+ ok( data.mouse, "EnumDevicesBySemantics should enumerate the mouse\n" );
+
+ /* Enumerate Force feedback devices. We should get no mouse nor keyboard */
+ data.keyboard = FALSE;
+ data.mouse = FALSE;
+ data.device_count = 0;
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, NULL, &action_format, enum_semantics_callback,
+ &data, DIEDBSFL_FORCEFEEDBACK );
+ ok( SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr );
+ ok( !data.keyboard, "Keyboard should not be enumerated when asking for forcefeedback\n" );
+ ok( !data.mouse, "Mouse should not be enumerated when asking for forcefeedback\n" );
+
+ /* Enumerate available devices. That is devices not owned by any user.
+ Before setting the action map for all devices we still have them available. */
+ data.device_count = 0;
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, NULL, &action_format, enum_semantics_callback,
+ &data, DIEDBSFL_AVAILABLEDEVICES );
+ ok( SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr );
+ ok( data.device_count > 0,
+ "There should be devices available before action mapping available=%d\n", data.device_count );
+
+ /* Keep the device total */
+ device_total = data.device_count;
+
+ /* There should be no devices for any user. No device should be enumerated with DIEDBSFL_THISUSER.
+ MSDN defines that all unowned devices are also enumerated but this doesn't seem to be happening. */
+ data.device_count = 0;
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, "Sh4d0w M4g3", &action_format,
+ enum_semantics_callback, &data, DIEDBSFL_THISUSER );
+ ok( SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr );
+ ok( data.device_count == 0, "No devices should be assigned for this user assigned=%d\n", data.device_count );
+
+ /* This enumeration builds and sets the action map for all devices with a NULL username */
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, NULL, &action_format, set_action_map_callback,
+ &data, DIEDBSFL_ATTACHEDONLY );
+ ok( SUCCEEDED(hr), "EnumDevicesBySemantics failed: hr=%08x\n", hr );
+
+ /* After a successful action mapping we should have no devices available */
+ data.device_count = 0;
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, NULL, &action_format, enum_semantics_callback,
+ &data, DIEDBSFL_AVAILABLEDEVICES );
+ ok( SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr );
+ ok( data.device_count == 0, "No device should be available after action mapping available=%d\n",
+ data.device_count );
+
+ /* Now we'll give all the devices to a specific user */
+ data.username = "Sh4d0w M4g3";
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, NULL, &action_format, set_action_map_callback,
+ &data, DIEDBSFL_ATTACHEDONLY );
+ ok( SUCCEEDED(hr), "EnumDevicesBySemantics failed: hr=%08x\n", hr );
+
+ /* Testing with the default user, DIEDBSFL_THISUSER has no effect */
+ data.device_count = 0;
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, NULL, &action_format,
+ enum_semantics_callback, &data, DIEDBSFL_THISUSER );
+ ok( SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr );
+ ok( data.device_count == device_total, "THISUSER has no effect with NULL username owned=%d, expected=%d\n",
+ data.device_count, device_total );
+
+ /* Using an empty user string is the same as passing NULL, DIEDBSFL_THISUSER has no effect */
+ data.device_count = 0;
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, "", &action_format, enum_semantics_callback, &data, DIEDBSFL_THISUSER );
+ ok( SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr );
+ ok( data.device_count == device_total, "THISUSER has no effect with \"\" as username owned=%d, expected=%d\n",
+ data.device_count, device_total );
+
+ /* Testing with a user with no ownership of the devices */
+ data.device_count = 0;
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, "Ninja Brian", &action_format,
+ enum_semantics_callback, &data, DIEDBSFL_THISUSER );
+ ok( SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr );
+ ok( data.device_count == 0, "This user should own no devices owned=%d\n", data.device_count );
+
+ /* Sh4d0w M4g3 has ownership of all devices */
+ data.device_count = 0;
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, "Sh4d0w M4g3", &action_format,
+ enum_semantics_callback, &data, DIEDBSFL_THISUSER );
+ ok( SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr );
+ ok( data.device_count == device_total, "This user should own %d devices owned=%d\n",
+ device_total, data.device_count );
+
+ /* The call fails with a zeroed GUID */
+ memset( &action_format.guidActionMap, 0, sizeof(GUID) );
+ data.device_count = 0;
+ hr = IDirectInput8_EnumDevicesBySemantics( dinput, NULL, &action_format, enum_semantics_callback, NULL, 0 );
+ todo_wine
+ ok( FAILED(hr), "EnumDevicesBySemantics succeeded with invalid GUID hr=%08x\n", hr );
+
+ IDirectInput8_Release( dinput );
+}
+
START_TEST(dinput)
{
HMODULE dinput_mod = GetModuleHandleA("dinput.dll");
+ DWORD i;
hInstance = GetModuleHandleA(NULL);
pDirectInputCreateEx = (void *)GetProcAddress(dinput_mod, "DirectInputCreateEx");
- CoInitialize(NULL);
- test_preinitialization();
- test_DirectInputCreateEx();
- test_QueryInterface();
- test_CreateDevice();
- test_EnumDevices();
- test_GetDeviceStatus();
- test_Initialize();
- test_RunControlPanel();
- test_DirectInputJoyConfig8();
+ CoInitialize( NULL );
+ test_CoCreateInstance( 0x700 );
+ test_CoCreateInstance( 0x800 );
CoUninitialize();
+
+ for (i = 0; i < ARRAY_SIZE(dinput_versions); i++)
+ {
+ winetest_push_context( "%#x", dinput_versions[i] );
+ test_DirectInputCreate( dinput_versions[i] );
+ test_DirectInputCreateEx( dinput_versions[i] );
+ test_DirectInput8Create( dinput_versions[i] );
+ test_QueryInterface( dinput_versions[i] );
+ test_CreateDevice( dinput_versions[i] );
+ test_EnumDevices( dinput_versions[i] );
+ test_GetDeviceStatus( dinput_versions[i] );
+ test_RunControlPanel( dinput_versions[i] );
+ test_Initialize( dinput_versions[i] );
+ winetest_pop_context();
+ }
+
+ test_DirectInputJoyConfig8();
+ test_EnumDevicesBySemantics();
}
diff --git a/dlls/dinput/tests/dinput8.c b/dlls/dinput/tests/dinput8.c
deleted file mode 100644
index 81aeb8191f6..00000000000
--- a/dlls/dinput/tests/dinput8.c
+++ /dev/null
@@ -1,728 +0,0 @@
-/*
- * Copyright (c) 2011 Andrew Nguyen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#define DIRECTINPUT_VERSION 0x0800
-
-#define COBJMACROS
-#include <windows.h>
-#include <objidl.h>
-
-#include <dinput.h>
-#include <dinputd.h>
-
-#include "wine/test.h"
-
-static HINSTANCE hInstance;
-
-static BOOL CALLBACK dummy_callback(const DIDEVICEINSTANCEA *instance, void *context)
-{
- ok(0, "Callback was invoked with parameters (%p, %p)\n", instance, context);
- return DIENUM_STOP;
-}
-
-static void test_preinitialization(void)
-{
- static const struct
- {
- REFGUID rguid;
- BOOL pdev;
- HRESULT expected_hr;
- } create_device_tests[] =
- {
- {NULL, FALSE, E_POINTER},
- {NULL, TRUE, E_POINTER},
- {&GUID_Unknown, FALSE, E_POINTER},
- {&GUID_Unknown, TRUE, DIERR_NOTINITIALIZED},
- {&GUID_SysMouse, FALSE, E_POINTER},
- {&GUID_SysMouse, TRUE, DIERR_NOTINITIALIZED},
- };
-
- static const struct
- {
- DWORD dwDevType;
- LPDIENUMDEVICESCALLBACKA lpCallback;
- DWORD dwFlags;
- HRESULT expected_hr;
- int todo;
- } enum_devices_tests[] =
- {
- {0, NULL, 0, DIERR_INVALIDPARAM},
- {0, NULL, ~0u, DIERR_INVALIDPARAM},
- {0, dummy_callback, 0, DIERR_NOTINITIALIZED},
- {0, dummy_callback, ~0u, DIERR_INVALIDPARAM},
- {0xdeadbeef, NULL, 0, DIERR_INVALIDPARAM},
- {0xdeadbeef, NULL, ~0u, DIERR_INVALIDPARAM},
- {0xdeadbeef, dummy_callback, 0, DIERR_INVALIDPARAM},
- {0xdeadbeef, dummy_callback, ~0u, DIERR_INVALIDPARAM},
- };
-
- IDirectInput8A *pDI;
- HRESULT hr;
- int i;
- IDirectInputDevice8A *pDID;
-
- hr = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectInput8A, (void **)&pDI);
- if (FAILED(hr))
- {
- skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
-
- for (i = 0; i < ARRAY_SIZE(create_device_tests); i++)
- {
- if (create_device_tests[i].pdev) pDID = (void *)0xdeadbeef;
- hr = IDirectInput8_CreateDevice(pDI, create_device_tests[i].rguid,
- create_device_tests[i].pdev ? &pDID : NULL,
- NULL);
- ok(hr == create_device_tests[i].expected_hr, "[%d] IDirectInput8_CreateDevice returned 0x%08x\n", i, hr);
- if (create_device_tests[i].pdev)
- ok(pDID == NULL, "[%d] Output interface pointer is %p\n", i, pDID);
- }
-
- for (i = 0; i < ARRAY_SIZE(enum_devices_tests); i++)
- {
- hr = IDirectInput8_EnumDevices(pDI, enum_devices_tests[i].dwDevType,
- enum_devices_tests[i].lpCallback,
- NULL,
- enum_devices_tests[i].dwFlags);
- todo_wine_if(enum_devices_tests[i].todo)
- ok(hr == enum_devices_tests[i].expected_hr, "[%d] IDirectInput8_EnumDevice returned 0x%08x\n", i, hr);
- }
-
- hr = IDirectInput8_GetDeviceStatus(pDI, NULL);
- ok(hr == E_POINTER, "IDirectInput8_GetDeviceStatus returned 0x%08x\n", hr);
-
- hr = IDirectInput8_GetDeviceStatus(pDI, &GUID_Unknown);
- ok(hr == DIERR_NOTINITIALIZED, "IDirectInput8_GetDeviceStatus returned 0x%08x\n", hr);
-
- hr = IDirectInput8_GetDeviceStatus(pDI, &GUID_SysMouse);
- ok(hr == DIERR_NOTINITIALIZED, "IDirectInput8_GetDeviceStatus returned 0x%08x\n", hr);
-
- hr = IDirectInput8_RunControlPanel(pDI, NULL, 0);
- ok(hr == DIERR_NOTINITIALIZED, "IDirectInput8_RunControlPanel returned 0x%08x\n", hr);
-
- hr = IDirectInput8_RunControlPanel(pDI, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_RunControlPanel returned 0x%08x\n", hr);
-
- hr = IDirectInput8_RunControlPanel(pDI, (HWND)0xdeadbeef, 0);
- ok(hr == E_HANDLE, "IDirectInput8_RunControlPanel returned 0x%08x\n", hr);
-
- hr = IDirectInput8_RunControlPanel(pDI, (HWND)0xdeadbeef, ~0u);
- ok(hr == E_HANDLE, "IDirectInput8_RunControlPanel returned 0x%08x\n", hr);
-
- IDirectInput8_Release(pDI);
-}
-
-static void test_DirectInput8Create(void)
-{
- static const struct
- {
- BOOL hinst;
- DWORD dwVersion;
- REFIID riid;
- BOOL ppdi;
- HRESULT expected_hr;
- } invalid_param_list[] =
- {
- {FALSE, 0, &IID_IDirectInputA, FALSE, E_POINTER},
- {FALSE, 0, &IID_IDirectInputA, TRUE, DIERR_NOINTERFACE},
- {FALSE, 0, &IID_IDirectInput8A, FALSE, E_POINTER},
- {FALSE, 0, &IID_IDirectInput8A, TRUE, DIERR_INVALIDPARAM},
- {FALSE, DIRECTINPUT_VERSION, &IID_IDirectInputA, FALSE, E_POINTER},
- {FALSE, DIRECTINPUT_VERSION, &IID_IDirectInputA, TRUE, DIERR_NOINTERFACE},
- {FALSE, DIRECTINPUT_VERSION, &IID_IDirectInput8A, FALSE, E_POINTER},
- {FALSE, DIRECTINPUT_VERSION, &IID_IDirectInput8A, TRUE, DIERR_INVALIDPARAM},
- {FALSE, DIRECTINPUT_VERSION - 1, &IID_IDirectInputA, FALSE, E_POINTER},
- {FALSE, DIRECTINPUT_VERSION - 1, &IID_IDirectInputA, TRUE, DIERR_NOINTERFACE},
- {FALSE, DIRECTINPUT_VERSION - 1, &IID_IDirectInput8A, FALSE, E_POINTER},
- {FALSE, DIRECTINPUT_VERSION - 1, &IID_IDirectInput8A, TRUE, DIERR_INVALIDPARAM},
- {FALSE, DIRECTINPUT_VERSION + 1, &IID_IDirectInputA, FALSE, E_POINTER},
- {FALSE, DIRECTINPUT_VERSION + 1, &IID_IDirectInputA, TRUE, DIERR_NOINTERFACE},
- {FALSE, DIRECTINPUT_VERSION + 1, &IID_IDirectInput8A, FALSE, E_POINTER},
- {FALSE, DIRECTINPUT_VERSION + 1, &IID_IDirectInput8A, TRUE, DIERR_INVALIDPARAM},
- {TRUE, 0, &IID_IDirectInputA, FALSE, E_POINTER},
- {TRUE, 0, &IID_IDirectInputA, TRUE, DIERR_NOINTERFACE},
- {TRUE, 0, &IID_IDirectInput8A, FALSE, E_POINTER},
- {TRUE, 0, &IID_IDirectInput8A, TRUE, DIERR_NOTINITIALIZED},
- {TRUE, DIRECTINPUT_VERSION, &IID_IDirectInputA, FALSE, E_POINTER},
- {TRUE, DIRECTINPUT_VERSION, &IID_IDirectInputA, TRUE, DIERR_NOINTERFACE},
- {TRUE, DIRECTINPUT_VERSION, &IID_IDirectInput8A, FALSE, E_POINTER},
- {TRUE, DIRECTINPUT_VERSION - 1, &IID_IDirectInputA, FALSE, E_POINTER},
- {TRUE, DIRECTINPUT_VERSION - 1, &IID_IDirectInputA, TRUE, DIERR_NOINTERFACE},
- {TRUE, DIRECTINPUT_VERSION - 1, &IID_IDirectInput8A, FALSE, E_POINTER},
- {TRUE, DIRECTINPUT_VERSION - 1, &IID_IDirectInput8A, TRUE, DIERR_BETADIRECTINPUTVERSION},
- {TRUE, DIRECTINPUT_VERSION + 1, &IID_IDirectInputA, FALSE, E_POINTER},
- {TRUE, DIRECTINPUT_VERSION + 1, &IID_IDirectInputA, TRUE, DIERR_NOINTERFACE},
- {TRUE, DIRECTINPUT_VERSION + 1, &IID_IDirectInput8A, FALSE, E_POINTER},
- {TRUE, DIRECTINPUT_VERSION + 1, &IID_IDirectInput8A, TRUE, DIERR_OLDDIRECTINPUTVERSION},
- };
-
- static REFIID no_interface_list[] = {&IID_IDirectInputA, &IID_IDirectInputW,
- &IID_IDirectInput2A, &IID_IDirectInput2W,
- &IID_IDirectInput7A, &IID_IDirectInput7W,
- &IID_IDirectInputDeviceA, &IID_IDirectInputDeviceW,
- &IID_IDirectInputDevice2A, &IID_IDirectInputDevice2W,
- &IID_IDirectInputDevice7A, &IID_IDirectInputDevice7W,
- &IID_IDirectInputDevice8A, &IID_IDirectInputDevice8W,
- &IID_IDirectInputEffect};
-
- static REFIID iid_list[] = {&IID_IUnknown, &IID_IDirectInput8A, &IID_IDirectInput8W};
-
- int i;
- IUnknown *pUnk;
- HRESULT hr;
-
- for (i = 0; i < ARRAY_SIZE(invalid_param_list); i++)
- {
- if (invalid_param_list[i].ppdi) pUnk = (void *)0xdeadbeef;
- hr = DirectInput8Create(invalid_param_list[i].hinst ? hInstance : NULL,
- invalid_param_list[i].dwVersion,
- invalid_param_list[i].riid,
- invalid_param_list[i].ppdi ? (void **)&pUnk : NULL,
- NULL);
- ok(hr == invalid_param_list[i].expected_hr, "[%d] DirectInput8Create returned 0x%08x\n", i, hr);
- if (invalid_param_list[i].ppdi)
- ok(pUnk == NULL, "[%d] Output interface pointer is %p\n", i, pUnk);
- }
-
- for (i = 0; i < ARRAY_SIZE(no_interface_list); i++)
- {
- pUnk = (void *)0xdeadbeef;
- hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, no_interface_list[i], (void **)&pUnk, NULL);
- ok(hr == DIERR_NOINTERFACE, "[%d] DirectInput8Create returned 0x%08x\n", i, hr);
- ok(pUnk == NULL, "[%d] Output interface pointer is %p\n", i, pUnk);
- }
-
- for (i = 0; i < ARRAY_SIZE(iid_list); i++)
- {
- pUnk = NULL;
- hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, iid_list[i], (void **)&pUnk, NULL);
- ok(hr == DI_OK, "[%d] DirectInput8Create returned 0x%08x\n", i, hr);
- ok(pUnk != NULL, "[%d] Output interface pointer is NULL\n", i);
- if (pUnk)
- IUnknown_Release(pUnk);
- }
-}
-
-static void test_QueryInterface(void)
-{
- static REFIID iid_list[] = {&IID_IUnknown, &IID_IDirectInput8A, &IID_IDirectInput8W, &IID_IDirectInputJoyConfig8};
-
- static REFIID no_interface_list[] =
- {
- &IID_IDirectInputA,
- &IID_IDirectInputW,
- &IID_IDirectInput2A,
- &IID_IDirectInput2W,
- &IID_IDirectInput7A,
- &IID_IDirectInput7W,
- &IID_IDirectInputDeviceA,
- &IID_IDirectInputDeviceW,
- &IID_IDirectInputDevice2A,
- &IID_IDirectInputDevice2W,
- &IID_IDirectInputDevice7A,
- &IID_IDirectInputDevice7W,
- &IID_IDirectInputDevice8A,
- &IID_IDirectInputDevice8W,
- &IID_IDirectInputEffect,
- };
-
- IDirectInput8A *pDI;
- HRESULT hr;
- IUnknown *pUnk;
- int i;
-
- hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, &IID_IDirectInput8A, (void **)&pDI, NULL);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
-
- hr = IDirectInput8_QueryInterface(pDI, NULL, NULL);
- ok(hr == E_POINTER, "IDirectInput8_QueryInterface returned 0x%08x\n", hr);
-
- pUnk = (void *)0xdeadbeef;
- hr = IDirectInput8_QueryInterface(pDI, NULL, (void **)&pUnk);
- ok(hr == E_POINTER, "IDirectInput8_QueryInterface returned 0x%08x\n", hr);
- ok(pUnk == (void *)0xdeadbeef, "Output interface pointer is %p\n", pUnk);
-
- hr = IDirectInput8_QueryInterface(pDI, &IID_IUnknown, NULL);
- ok(hr == E_POINTER, "IDirectInput8_QueryInterface returned 0x%08x\n", hr);
-
- for (i = 0; i < ARRAY_SIZE(iid_list); i++)
- {
- pUnk = NULL;
- hr = IDirectInput8_QueryInterface(pDI, iid_list[i], (void **)&pUnk);
- ok(hr == S_OK, "[%d] IDirectInput8_QueryInterface returned 0x%08x\n", i, hr);
- ok(pUnk != NULL, "[%d] Output interface pointer is NULL\n", i);
- if (pUnk)
- {
- int j;
- for (j = 0; j < ARRAY_SIZE(iid_list); j++)
- {
- IUnknown *pUnk1 = NULL;
- hr = IDirectInput8_QueryInterface(pUnk, iid_list[j], (void **)&pUnk1);
- ok(hr == S_OK, "[%d] IDirectInput8_QueryInterface(pUnk) returned 0x%08x\n", j, hr);
- ok(pUnk1 != NULL, "[%d] Output interface pointer is NULL\n", i);
- if (pUnk1) IUnknown_Release(pUnk1);
- }
- IUnknown_Release(pUnk);
- }
- }
-
- for (i = 0; i < ARRAY_SIZE(no_interface_list); i++)
- {
- pUnk = (void *)0xdeadbeef;
- hr = IDirectInput8_QueryInterface(pDI, no_interface_list[i], (void **)&pUnk);
-
- ok(hr == E_NOINTERFACE, "[%d] IDirectInput8_QueryInterface returned 0x%08x\n", i, hr);
- ok(pUnk == NULL, "[%d] Output interface pointer is %p\n", i, pUnk);
- }
-
- IDirectInput8_Release(pDI);
-}
-
-static void test_CreateDevice(void)
-{
- IDirectInput8A *pDI;
- HRESULT hr;
- IDirectInputDevice8A *pDID;
-
- hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, &IID_IDirectInput8A, (void **)&pDI, NULL);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
-
- hr = IDirectInput8_CreateDevice(pDI, NULL, NULL, NULL);
- ok(hr == E_POINTER, "IDirectInput8_CreateDevice returned 0x%08x\n", hr);
-
- pDID = (void *)0xdeadbeef;
- hr = IDirectInput8_CreateDevice(pDI, NULL, &pDID, NULL);
- ok(hr == E_POINTER, "IDirectInput8_CreateDevice returned 0x%08x\n", hr);
- ok(pDID == NULL, "Output interface pointer is %p\n", pDID);
-
- hr = IDirectInput8_CreateDevice(pDI, &GUID_Unknown, NULL, NULL);
- ok(hr == E_POINTER, "IDirectInput8_CreateDevice returned 0x%08x\n", hr);
-
- pDID = (void *)0xdeadbeef;
- hr = IDirectInput8_CreateDevice(pDI, &GUID_Unknown, &pDID, NULL);
- ok(hr == DIERR_DEVICENOTREG, "IDirectInput8_CreateDevice returned 0x%08x\n", hr);
- ok(pDID == NULL, "Output interface pointer is %p\n", pDID);
-
- hr = IDirectInput8_CreateDevice(pDI, &GUID_SysMouse, NULL, NULL);
- ok(hr == E_POINTER, "IDirectInput8_CreateDevice returned 0x%08x\n", hr);
-
- hr = IDirectInput8_CreateDevice(pDI, &GUID_SysMouse, &pDID, NULL);
- ok(hr == DI_OK, "IDirectInput8_CreateDevice returned 0x%08x\n", hr);
-
- IDirectInputDevice_Release(pDID);
- IDirectInput8_Release(pDI);
-}
-
-struct enum_devices_test
-{
- unsigned int device_count;
- BOOL return_value;
-};
-
-static BOOL CALLBACK enum_devices_callback(const DIDEVICEINSTANCEA *instance, void *context)
-{
- struct enum_devices_test *enum_test = context;
-
- trace("---- Device Information ----\n"
- "Product Name : %s\n"
- "Instance Name : %s\n"
- "devType : 0x%08x\n"
- "GUID Product : %s\n"
- "GUID Instance : %s\n"
- "HID Page : 0x%04x\n"
- "HID Usage : 0x%04x\n",
- instance->tszProductName,
- instance->tszInstanceName,
- instance->dwDevType,
- wine_dbgstr_guid(&instance->guidProduct),
- wine_dbgstr_guid(&instance->guidInstance),
- instance->wUsagePage,
- instance->wUsage);
-
- if ((instance->dwDevType & 0xff) == DI8DEVTYPE_KEYBOARD ||
- (instance->dwDevType & 0xff) == DI8DEVTYPE_MOUSE) {
- const char *device = ((instance->dwDevType & 0xff) ==
- DI8DEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse";
- ok(IsEqualGUID(&instance->guidInstance, &instance->guidProduct),
- "%s guidInstance (%s) does not match guidProduct (%s)\n",
- device, wine_dbgstr_guid(&instance->guidInstance),
- wine_dbgstr_guid(&instance->guidProduct));
- }
-
- enum_test->device_count++;
- return enum_test->return_value;
-}
-
-static void test_EnumDevices(void)
-{
- IDirectInput8A *pDI;
- HRESULT hr;
- struct enum_devices_test enum_test, enum_test_return;
-
- hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, &IID_IDirectInput8A, (void **)&pDI, NULL);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
-
- hr = IDirectInput8_EnumDevices(pDI, 0, NULL, NULL, 0);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_EnumDevices returned 0x%08x\n", hr);
-
- hr = IDirectInput8_EnumDevices(pDI, 0, NULL, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_EnumDevices returned 0x%08x\n", hr);
-
- /* Test crashes on Wine. */
- if (0)
- {
- hr = IDirectInput8_EnumDevices(pDI, 0, enum_devices_callback, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_EnumDevices returned 0x%08x\n", hr);
- }
-
- hr = IDirectInput8_EnumDevices(pDI, 0xdeadbeef, NULL, NULL, 0);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_EnumDevices returned 0x%08x\n", hr);
-
- hr = IDirectInput8_EnumDevices(pDI, 0xdeadbeef, NULL, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_EnumDevices returned 0x%08x\n", hr);
-
- hr = IDirectInput8_EnumDevices(pDI, 0xdeadbeef, enum_devices_callback, NULL, 0);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_EnumDevices returned 0x%08x\n", hr);
-
- hr = IDirectInput8_EnumDevices(pDI, 0xdeadbeef, enum_devices_callback, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_EnumDevices returned 0x%08x\n", hr);
-
- enum_test.device_count = 0;
- enum_test.return_value = DIENUM_CONTINUE;
- hr = IDirectInput8_EnumDevices(pDI, 0, enum_devices_callback, &enum_test, 0);
- ok(hr == DI_OK, "IDirectInput8_EnumDevices returned 0x%08x\n", hr);
- ok(enum_test.device_count != 0, "Device count is %u\n", enum_test.device_count);
-
- /* Enumeration only stops with an explicit DIENUM_STOP. */
- enum_test_return.device_count = 0;
- enum_test_return.return_value = 42;
- hr = IDirectInput8_EnumDevices(pDI, 0, enum_devices_callback, &enum_test_return, 0);
- ok(hr == DI_OK, "IDirectInput8_EnumDevices returned 0x%08x\n", hr);
- ok(enum_test_return.device_count == enum_test.device_count,
- "Device count is %u vs. %u\n", enum_test_return.device_count, enum_test.device_count);
-
- enum_test.device_count = 0;
- enum_test.return_value = DIENUM_STOP;
- hr = IDirectInput8_EnumDevices(pDI, 0, enum_devices_callback, &enum_test, 0);
- ok(hr == DI_OK, "IDirectInput8_EnumDevices returned 0x%08x\n", hr);
- ok(enum_test.device_count == 1, "Device count is %u\n", enum_test.device_count);
-
- IDirectInput8_Release(pDI);
-}
-
-struct enum_semantics_test
-{
- unsigned int device_count;
- DWORD first_remaining;
- BOOL mouse;
- BOOL keyboard;
- DIACTIONFORMATA *lpdiaf;
- const char* username;
-};
-
-static DIACTIONA actionMapping[]=
-{
- /* axis */
- { 0, 0x01008A01 /* DIAXIS_DRIVINGR_STEER */, 0, { "Steer.\0" } },
- /* button */
- { 1, 0x01000C01 /* DIBUTTON_DRIVINGR_SHIFTUP */, 0, { "Upshift.\0" } },
- /* keyboard key */
- { 2, DIKEYBOARD_SPACE, 0, { "Missile.\0" } },
- /* mouse button */
- { 3, DIMOUSE_BUTTON0, 0, { "Select\0" } },
- /* mouse axis */
- { 4, DIMOUSE_YAXIS, 0, { "Y Axis\0" } }
-};
-/* By placing the memory pointed to by lptszActionName right before memory with PAGE_NOACCESS
- * one can find out that the regular ansi string termination is not respected by EnumDevicesBySemantics.
- * Adding a double termination, making it a valid wide string termination, made the test succeed.
- * Therefore it looks like ansi version of EnumDevicesBySemantics forwards the string to
- * the wide variant without conversation. */
-
-static BOOL CALLBACK enum_semantics_callback(const DIDEVICEINSTANCEA *lpddi, IDirectInputDevice8A *lpdid, DWORD dwFlags, DWORD dwRemaining, void *context)
-{
- struct enum_semantics_test *data = context;
-
- if (context == NULL) return DIENUM_STOP;
-
- if (!data->device_count) {
- data->first_remaining = dwRemaining;
- }
- ok (dwRemaining == data->first_remaining - data->device_count,
- "enum semantics remaining devices is wrong, expected %d, had %d\n",
- data->first_remaining - data->device_count, dwRemaining);
- data->device_count++;
-
- if (IsEqualGUID(&lpddi->guidInstance, &GUID_SysKeyboard)) data->keyboard = TRUE;
-
- if (IsEqualGUID(&lpddi->guidInstance, &GUID_SysMouse)) data->mouse = TRUE;
-
- return DIENUM_CONTINUE;
-}
-
-static BOOL CALLBACK set_action_map_callback(const DIDEVICEINSTANCEA *lpddi, IDirectInputDevice8A *lpdid, DWORD dwFlags, DWORD dwRemaining, void *context)
-{
- HRESULT hr;
- struct enum_semantics_test *data = context;
-
- /* Building and setting an action map */
- /* It should not use any pre-stored mappings so we use DIDBAM_INITIALIZE */
- hr = IDirectInputDevice8_BuildActionMap(lpdid, data->lpdiaf, NULL, DIDBAM_INITIALIZE);
- ok (SUCCEEDED(hr), "BuildActionMap failed hr=%08x\n", hr);
-
- hr = IDirectInputDevice8_SetActionMap(lpdid, data->lpdiaf, data->username, 0);
- ok (SUCCEEDED(hr), "SetActionMap failed hr=%08x\n", hr);
-
- return DIENUM_CONTINUE;
-}
-
-static void test_EnumDevicesBySemantics(void)
-{
- IDirectInput8A *pDI;
- HRESULT hr;
- DIACTIONFORMATA diaf;
- const GUID ACTION_MAPPING_GUID = { 0x1, 0x2, 0x3, { 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb } };
- struct enum_semantics_test data = { 0, 0, FALSE, FALSE, &diaf, NULL };
- int device_total = 0;
-
- hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, &IID_IDirectInput8A, (void **)&pDI, NULL);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
-
- memset (&diaf, 0, sizeof(diaf));
- diaf.dwSize = sizeof(diaf);
- diaf.dwActionSize = sizeof(DIACTIONA);
- diaf.dwNumActions = ARRAY_SIZE(actionMapping);
- diaf.dwDataSize = 4 * diaf.dwNumActions;
- diaf.rgoAction = actionMapping;
- diaf.guidActionMap = ACTION_MAPPING_GUID;
- diaf.dwGenre = 0x01000000; /* DIVIRTUAL_DRIVING_RACE */
- diaf.dwBufferSize = 32;
-
- /* Test enumerating all attached and installed devices */
- data.keyboard = FALSE;
- data.mouse = FALSE;
- data.device_count = 0;
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &diaf, enum_semantics_callback, &data, DIEDBSFL_ATTACHEDONLY);
- ok (data.device_count > 0, "EnumDevicesBySemantics did not call the callback hr=%08x\n", hr);
- ok (data.keyboard, "EnumDevicesBySemantics should enumerate the keyboard\n");
- ok (data.mouse, "EnumDevicesBySemantics should enumerate the mouse\n");
-
- /* Enumerate Force feedback devices. We should get no mouse nor keyboard */
- data.keyboard = FALSE;
- data.mouse = FALSE;
- data.device_count = 0;
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &diaf, enum_semantics_callback, &data, DIEDBSFL_FORCEFEEDBACK);
- ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr);
- ok (!data.keyboard, "Keyboard should not be enumerated when asking for forcefeedback\n");
- ok (!data.mouse, "Mouse should not be enumerated when asking for forcefeedback\n");
-
- /* Enumerate available devices. That is devices not owned by any user.
- Before setting the action map for all devices we still have them available. */
- data.device_count = 0;
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &diaf, enum_semantics_callback, &data, DIEDBSFL_AVAILABLEDEVICES);
- ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr);
- ok (data.device_count > 0, "There should be devices available before action mapping available=%d\n", data.device_count);
-
- /* Keep the device total */
- device_total = data.device_count;
-
- /* There should be no devices for any user. No device should be enumerated with DIEDBSFL_THISUSER.
- MSDN defines that all unowned devices are also enumerated but this doesn't seem to be happening. */
- data.device_count = 0;
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, "Sh4d0w M4g3", &diaf, enum_semantics_callback, &data, DIEDBSFL_THISUSER);
- ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr);
- ok (data.device_count == 0, "No devices should be assigned for this user assigned=%d\n", data.device_count);
-
- /* This enumeration builds and sets the action map for all devices with a NULL username */
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &diaf, set_action_map_callback, &data, DIEDBSFL_ATTACHEDONLY);
- ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed: hr=%08x\n", hr);
-
- /* After a successful action mapping we should have no devices available */
- data.device_count = 0;
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &diaf, enum_semantics_callback, &data, DIEDBSFL_AVAILABLEDEVICES);
- ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr);
- ok (data.device_count == 0, "No device should be available after action mapping available=%d\n", data.device_count);
-
- /* Now we'll give all the devices to a specific user */
- data.username = "Sh4d0w M4g3";
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &diaf, set_action_map_callback, &data, DIEDBSFL_ATTACHEDONLY);
- ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed: hr=%08x\n", hr);
-
- /* Testing with the default user, DIEDBSFL_THISUSER has no effect */
- data.device_count = 0;
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &diaf, enum_semantics_callback, &data, DIEDBSFL_THISUSER);
- ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr);
- ok (data.device_count == device_total, "THISUSER has no effect with NULL username owned=%d, expected=%d\n", data.device_count, device_total);
-
- /* Using an empty user string is the same as passing NULL, DIEDBSFL_THISUSER has no effect */
- data.device_count = 0;
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, "", &diaf, enum_semantics_callback, &data, DIEDBSFL_THISUSER);
- ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr);
- ok (data.device_count == device_total, "THISUSER has no effect with \"\" as username owned=%d, expected=%d\n", data.device_count, device_total);
-
- /* Testing with a user with no ownership of the devices */
- data.device_count = 0;
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, "Ninja Brian", &diaf, enum_semantics_callback, &data, DIEDBSFL_THISUSER);
- ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr);
- ok (data.device_count == 0, "This user should own no devices owned=%d\n", data.device_count);
-
- /* Sh4d0w M4g3 has ownership of all devices */
- data.device_count = 0;
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, "Sh4d0w M4g3", &diaf, enum_semantics_callback, &data, DIEDBSFL_THISUSER);
- ok (SUCCEEDED(hr), "EnumDevicesBySemantics failed hr=%08x\n", hr);
- ok (data.device_count == device_total, "This user should own %d devices owned=%d\n", device_total, data.device_count);
-
- /* The call fails with a zeroed GUID */
- memset(&diaf.guidActionMap, 0, sizeof(GUID));
- data.device_count = 0;
- hr = IDirectInput8_EnumDevicesBySemantics(pDI, NULL, &diaf, enum_semantics_callback, NULL, 0);
- todo_wine ok(FAILED(hr), "EnumDevicesBySemantics succeeded with invalid GUID hr=%08x\n", hr);
-
- IDirectInput8_Release(pDI);
-}
-
-static void test_GetDeviceStatus(void)
-{
- IDirectInput8A *pDI;
- HRESULT hr;
-
- hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, &IID_IDirectInput8A, (void **)&pDI, NULL);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
-
- hr = IDirectInput8_GetDeviceStatus(pDI, NULL);
- ok(hr == E_POINTER, "IDirectInput8_GetDeviceStatus returned 0x%08x\n", hr);
-
- hr = IDirectInput8_GetDeviceStatus(pDI, &GUID_Unknown);
- todo_wine
- ok(hr == DIERR_DEVICENOTREG, "IDirectInput8_GetDeviceStatus returned 0x%08x\n", hr);
-
- hr = IDirectInput8_GetDeviceStatus(pDI, &GUID_SysMouse);
- ok(hr == DI_OK, "IDirectInput8_GetDeviceStatus returned 0x%08x\n", hr);
-
- IDirectInput8_Release(pDI);
-}
-
-static void test_RunControlPanel(void)
-{
- IDirectInput8A *pDI;
- HRESULT hr;
-
- hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, &IID_IDirectInput8A, (void **)&pDI, NULL);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
-
- if (winetest_interactive)
- {
- hr = IDirectInput8_RunControlPanel(pDI, NULL, 0);
- ok(hr == S_OK, "IDirectInput8_RunControlPanel returned 0x%08x\n", hr);
-
- hr = IDirectInput8_RunControlPanel(pDI, GetDesktopWindow(), 0);
- ok(hr == S_OK, "IDirectInput8_RunControlPanel returned 0x%08x\n", hr);
- }
-
- hr = IDirectInput8_RunControlPanel(pDI, NULL, ~0u);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_RunControlPanel returned 0x%08x\n", hr);
-
- hr = IDirectInput8_RunControlPanel(pDI, (HWND)0xdeadbeef, 0);
- ok(hr == E_HANDLE, "IDirectInput8_RunControlPanel returned 0x%08x\n", hr);
-
- hr = IDirectInput8_RunControlPanel(pDI, (HWND)0xdeadbeef, ~0u);
- ok(hr == E_HANDLE, "IDirectInput8_RunControlPanel returned 0x%08x\n", hr);
-
- IDirectInput8_Release(pDI);
-}
-
-static void test_Initialize(void)
-{
- IDirectInput8A *pDI;
- HRESULT hr;
-
- hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, &IID_IDirectInput8A, (void **)&pDI, NULL);
- if (FAILED(hr))
- {
- win_skip("Failed to instantiate a IDirectInputA instance: 0x%08x\n", hr);
- return;
- }
-
- hr = IDirectInput8_Initialize(pDI, NULL, 0);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_Initialize returned 0x%08x\n", hr);
-
- hr = IDirectInput8_Initialize(pDI, NULL, DIRECTINPUT_VERSION);
- ok(hr == DIERR_INVALIDPARAM, "IDirectInput8_Initialize returned 0x%08x\n", hr);
-
- hr = IDirectInput8_Initialize(pDI, hInstance, 0);
- ok(hr == DIERR_NOTINITIALIZED, "IDirectInput8_Initialize returned 0x%08x\n", hr);
-
- /* Invalid DirectInput versions less than DIRECTINPUT_VERSION yield DIERR_BETADIRECTINPUTVERSION. */
- hr = IDirectInput8_Initialize(pDI, hInstance, DIRECTINPUT_VERSION - 1);
- ok(hr == DIERR_BETADIRECTINPUTVERSION, "IDirectInput8_Initialize returned 0x%08x\n", hr);
-
- /* Invalid DirectInput versions greater than DIRECTINPUT_VERSION yield DIERR_BETADIRECTINPUTVERSION. */
- hr = IDirectInput8_Initialize(pDI, hInstance, DIRECTINPUT_VERSION + 1);
- ok(hr == DIERR_OLDDIRECTINPUTVERSION, "IDirectInput8_Initialize returned 0x%08x\n", hr);
-
- hr = IDirectInput8_Initialize(pDI, hInstance, DIRECTINPUT_VERSION);
- ok(hr == DI_OK, "IDirectInput8_Initialize returned 0x%08x\n", hr);
-
- /* Parameters are still validated after successful initialization. */
- hr = IDirectInput8_Initialize(pDI, hInstance, 0);
- ok(hr == DIERR_NOTINITIALIZED, "IDirectInput8_Initialize returned 0x%08x\n", hr);
-
- IDirectInput8_Release(pDI);
-}
-
-START_TEST(dinput8)
-{
- hInstance = GetModuleHandleA(NULL);
-
- CoInitialize(NULL);
- test_preinitialization();
- test_DirectInput8Create();
- test_QueryInterface();
- test_CreateDevice();
- test_EnumDevices();
- test_EnumDevicesBySemantics();
- test_GetDeviceStatus();
- test_RunControlPanel();
- test_Initialize();
- CoUninitialize();
-}
--
2.34.1
1
5
07 Feb '22
Keep it consistent with Windows.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/treeview.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 6e9f6dd6d1b..84fde215ff8 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -3034,13 +3034,11 @@ TREEVIEW_InitCheckboxes(TREEVIEW_INFO *infoPtr)
rc.left = width;
rc.right = rc.left + width;
- DrawFrameControl(hdc, &rc, DFC_BUTTON,
- DFCS_BUTTONCHECK|DFCS_FLAT);
+ DrawFrameControl(hdc, &rc, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_MONO);
rc.left = width * 2;
rc.right = rc.left + width;
- DrawFrameControl(hdc, &rc, DFC_BUTTON,
- DFCS_BUTTONCHECK|DFCS_FLAT|DFCS_CHECKED);
+ DrawFrameControl(hdc, &rc, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_MONO | DFCS_CHECKED);
SelectObject(hdc, hbmOld);
nIndex = ImageList_AddMasked(infoPtr->himlState, hbm,
--
2.32.0
1
0