Austin English : ole32: Add tests for CoInitializeEx.
Alexandre Julliard
julliard at winehq.org
Tue Jan 13 10:56:40 CST 2009
Module: wine
Branch: master
Commit: 753affe48d317025e34cce01c717211fd9559641
URL: http://source.winehq.org/git/wine.git/?a=commit;h=753affe48d317025e34cce01c717211fd9559641
Author: Austin English <austinenglish at gmail.com>
Date: Tue Jan 13 03:52:41 2009 -0600
ole32: Add tests for CoInitializeEx.
---
dlls/ole32/tests/compobj.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index 02dc080..450db78 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -1017,6 +1017,27 @@ static void test_CoGetObjectContext(void)
CoUninitialize();
}
+static void test_CoInitializeEx(void)
+{
+ HRESULT hr;
+
+ hr = pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+ ok(hr == S_OK, "CoInitializeEx failed with error 0x%08x\n", hr);
+
+ /* Calling OleInitialize for the first time should yield S_OK even with
+ * apartment already initialized by previous CoInitialize(Ex) calls. */
+ hr = OleInitialize(NULL);
+ todo_wine ok(hr == S_OK, "OleInitialize failed with error 0x%08x\n", hr);
+
+ /* Subsequent calls to OleInitialize should return S_FALSE */
+ hr = OleInitialize(NULL);
+ ok(hr == S_FALSE, "Expected S_FALSE, hr = 0x%08x\n", hr);
+
+ /* Cleanup */
+ CoUninitialize();
+ OleUninitialize();
+}
+
START_TEST(compobj)
{
HMODULE hOle32 = GetModuleHandle("ole32");
@@ -1045,4 +1066,5 @@ START_TEST(compobj)
test_registered_object_thread_affinity();
test_CoFreeUnusedLibraries();
test_CoGetObjectContext();
+ test_CoInitializeEx();
}
More information about the wine-cvs
mailing list