Commit 51445845 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

opcservices/tests: Add some tests.

parent 2346a401
......@@ -19715,6 +19715,7 @@ wine_fn_config_makefile dlls/olesvr.dll16 enable_win16
wine_fn_config_makefile dlls/olesvr32 enable_olesvr32
wine_fn_config_makefile dlls/olethk32 enable_olethk32
wine_fn_config_makefile dlls/opcservices enable_opcservices
wine_fn_config_makefile dlls/opcservices/tests enable_tests
wine_fn_config_makefile dlls/openal32 enable_openal32
wine_fn_config_makefile dlls/opencl enable_opencl
wine_fn_config_makefile dlls/opengl32 enable_opengl32
......
......@@ -3574,6 +3574,7 @@ WINE_CONFIG_MAKEFILE(dlls/olesvr.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/olesvr32)
WINE_CONFIG_MAKEFILE(dlls/olethk32)
WINE_CONFIG_MAKEFILE(dlls/opcservices)
WINE_CONFIG_MAKEFILE(dlls/opcservices/tests)
WINE_CONFIG_MAKEFILE(dlls/openal32)
WINE_CONFIG_MAKEFILE(dlls/opencl)
WINE_CONFIG_MAKEFILE(dlls/opengl32)
......
TESTDLL = opcservices.dll
IMPORTS = ole32
C_SRCS = \
opcservices.c
/*
* Font related tests
*
* Copyright 2012, 2014-2017 Nikolay Sivov for CodeWeavers
* Copyright 2014 Aric Stewart for CodeWeavers
*
* 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 COBJMACROS
#include "windows.h"
#include "initguid.h"
#include "msopc.h"
#include "wine/test.h"
static IOpcFactory *create_factory(void)
{
IOpcFactory *factory = NULL;
CoCreateInstance(&CLSID_OpcFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IOpcFactory, (void **)&factory);
return factory;
}
static void test_package(void)
{
IOpcPartSet *partset, *partset2;
IOpcFactory *factory;
IOpcPackage *package;
HRESULT hr;
factory = create_factory();
hr = IOpcFactory_CreatePackage(factory, &package);
ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) /* Vista */, "Failed to create a package, hr %#x.\n", hr);
if (FAILED(hr))
{
IOpcFactory_Release(factory);
return;
}
hr = IOpcPackage_GetPartSet(package, &partset);
ok(SUCCEEDED(hr), "Failed to create a part set, hr %#x.\n", hr);
hr = IOpcPackage_GetPartSet(package, &partset2);
ok(SUCCEEDED(hr), "Failed to create a part set, hr %#x.\n", hr);
ok(partset == partset2, "Expected same part set instance.\n");
IOpcPackage_Release(package);
IOpcFactory_Release(factory);
}
START_TEST(opcservices)
{
IOpcFactory *factory;
HRESULT hr;
hr = CoInitialize(NULL);
ok(SUCCEEDED(hr), "Failed to initialize COM, hr %#x.\n", hr);
if (!(factory = create_factory())) {
win_skip("Failed to create IOpcFactory factory.\n");
CoUninitialize();
return;
}
test_package();
IOpcFactory_Release(factory);
CoUninitialize();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment