-- v3: geolocation: Add tests for dll name
From: Fabian Maurer dark.shadow4@web.de
--- configure.ac | 4 ++-- .../Makefile.in | 2 +- .../classes.idl | 2 +- .../geolocation.spec} | 0 .../main.c | 0 .../private.h | 4 ++-- dlls/geolocation/tests/Makefile.in | 5 +++++ .../tests/geolocator.c | 0 .../windows.devices.geolocation.geolocator/tests/Makefile.in | 5 ----- 9 files changed, 11 insertions(+), 11 deletions(-) rename dlls/{windows.devices.geolocation.geolocator => geolocation}/Makefile.in (56%) rename dlls/{windows.devices.geolocation.geolocator => geolocation}/classes.idl (93%) rename dlls/{windows.devices.geolocation.geolocator/windows.devices.geolocation.geolocator.spec => geolocation/geolocation.spec} (100%) rename dlls/{windows.devices.geolocation.geolocator => geolocation}/main.c (100%) rename dlls/{windows.devices.geolocation.geolocator => geolocation}/private.h (90%) create mode 100644 dlls/geolocation/tests/Makefile.in rename dlls/{windows.devices.geolocation.geolocator => geolocation}/tests/geolocator.c (100%) delete mode 100644 dlls/windows.devices.geolocation.geolocator/tests/Makefile.in
diff --git a/configure.ac b/configure.ac index 87a05fa903d..d1c5063201f 100644 --- a/configure.ac +++ b/configure.ac @@ -2631,6 +2631,8 @@ WINE_CONFIG_MAKEFILE(dlls/gdi32) WINE_CONFIG_MAKEFILE(dlls/gdi32/tests) WINE_CONFIG_MAKEFILE(dlls/gdiplus) WINE_CONFIG_MAKEFILE(dlls/gdiplus/tests) +WINE_CONFIG_MAKEFILE(dlls/geolocation) +WINE_CONFIG_MAKEFILE(dlls/geolocation/tests) WINE_CONFIG_MAKEFILE(dlls/glu32) WINE_CONFIG_MAKEFILE(dlls/gphoto2.ds) WINE_CONFIG_MAKEFILE(dlls/gpkcsp) @@ -3140,8 +3142,6 @@ WINE_CONFIG_MAKEFILE(dlls/windows.devices.bluetooth) WINE_CONFIG_MAKEFILE(dlls/windows.devices.bluetooth/tests) WINE_CONFIG_MAKEFILE(dlls/windows.devices.enumeration) WINE_CONFIG_MAKEFILE(dlls/windows.devices.enumeration/tests) -WINE_CONFIG_MAKEFILE(dlls/windows.devices.geolocation.geolocator) -WINE_CONFIG_MAKEFILE(dlls/windows.devices.geolocation.geolocator/tests) WINE_CONFIG_MAKEFILE(dlls/windows.gaming.input) WINE_CONFIG_MAKEFILE(dlls/windows.gaming.input/tests) WINE_CONFIG_MAKEFILE(dlls/windows.gaming.ui.gamebar) diff --git a/dlls/windows.devices.geolocation.geolocator/Makefile.in b/dlls/geolocation/Makefile.in similarity index 56% rename from dlls/windows.devices.geolocation.geolocator/Makefile.in rename to dlls/geolocation/Makefile.in index 42b5e50442b..b1274a1e2c8 100644 --- a/dlls/windows.devices.geolocation.geolocator/Makefile.in +++ b/dlls/geolocation/Makefile.in @@ -1,4 +1,4 @@ -MODULE = windows.devices.geolocation.geolocator.dll +MODULE = geolocation.dll IMPORTS = combase uuid
C_SRCS = \ diff --git a/dlls/windows.devices.geolocation.geolocator/classes.idl b/dlls/geolocation/classes.idl similarity index 93% rename from dlls/windows.devices.geolocation.geolocator/classes.idl rename to dlls/geolocation/classes.idl index 9c55cf20446..9a21dba5edc 100644 --- a/dlls/windows.devices.geolocation.geolocator/classes.idl +++ b/dlls/geolocation/classes.idl @@ -1,4 +1,4 @@ -/* Runtime Classes for windows.devices.geolocation.geolocator.dll +/* Runtime Classes for geolocation.dll * * Copyright 2023 Fabian Maurer * diff --git a/dlls/windows.devices.geolocation.geolocator/windows.devices.geolocation.geolocator.spec b/dlls/geolocation/geolocation.spec similarity index 100% rename from dlls/windows.devices.geolocation.geolocator/windows.devices.geolocation.geolocator.spec rename to dlls/geolocation/geolocation.spec diff --git a/dlls/windows.devices.geolocation.geolocator/main.c b/dlls/geolocation/main.c similarity index 100% rename from dlls/windows.devices.geolocation.geolocator/main.c rename to dlls/geolocation/main.c diff --git a/dlls/windows.devices.geolocation.geolocator/private.h b/dlls/geolocation/private.h similarity index 90% rename from dlls/windows.devices.geolocation.geolocator/private.h rename to dlls/geolocation/private.h index 7250bc1fe36..a188b5dacf3 100644 --- a/dlls/windows.devices.geolocation.geolocator/private.h +++ b/dlls/geolocation/private.h @@ -17,8 +17,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#ifndef __WINE_WINDOWS_DEVICES_GEOLOCATION_GEOLOCATOR_PRIVATE_H -#define __WINE_WINDOWS_DEVICES_GEOLOCATION_GEOLOCATOR_PRIVATE_H +#ifndef __WINE_GEOLOCATION_PRIVATE_H +#define __WINE_GEOLOCATION_PRIVATE_H
#include <stdarg.h>
diff --git a/dlls/geolocation/tests/Makefile.in b/dlls/geolocation/tests/Makefile.in new file mode 100644 index 00000000000..216e741fea8 --- /dev/null +++ b/dlls/geolocation/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = geolocation.dll +IMPORTS = combase uuid + +C_SRCS = \ + geolocator.c diff --git a/dlls/windows.devices.geolocation.geolocator/tests/geolocator.c b/dlls/geolocation/tests/geolocator.c similarity index 100% rename from dlls/windows.devices.geolocation.geolocator/tests/geolocator.c rename to dlls/geolocation/tests/geolocator.c diff --git a/dlls/windows.devices.geolocation.geolocator/tests/Makefile.in b/dlls/windows.devices.geolocation.geolocator/tests/Makefile.in deleted file mode 100644 index 1be5ca78258..00000000000 --- a/dlls/windows.devices.geolocation.geolocator/tests/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ -TESTDLL = windows.devices.geolocation.geolocator.dll -IMPORTS = combase uuid - -C_SRCS = \ - geolocator.c
From: Fabian Maurer dark.shadow4@web.de
--- dlls/geolocation/tests/geolocator.c | 31 +++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-)
diff --git a/dlls/geolocation/tests/geolocator.c b/dlls/geolocation/tests/geolocator.c index ca12f0d3a9d..cb3b4a53f20 100644 --- a/dlls/geolocation/tests/geolocator.c +++ b/dlls/geolocation/tests/geolocator.c @@ -48,10 +48,12 @@ static void check_interface_(unsigned int line, void *obj, const IID *iid) IUnknown_Release(unk); }
+HRESULT (WINAPI *pDllGetActivationFactory)(HSTRING, IActivationFactory **); + void test_basic(void) { static const WCHAR *geolocator_name = L"Windows.Devices.Geolocation.Geolocator"; - IActivationFactory *factory; + IActivationFactory *factory, *factory2; IInspectable *inspectable; IGeolocator *geolocator; IGeolocator *geolocator2; @@ -61,19 +63,40 @@ void test_basic(void) void *dummy; HSTRING str; HRESULT hr; + HMODULE hdll;
hr = WindowsCreateString(geolocator_name, wcslen(geolocator_name), &str); ok(hr == S_OK, "got hr %#lx.\n", hr);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); - WindowsDeleteString(str); + ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "got hr %#lx.\n", hr); if (hr == REGDB_E_CLASSNOTREG) { - win_skip("%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w(geolocator_name)); - return; + WindowsDeleteString(str); + win_skip("%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w(geolocator_name)); + return; + } + + /* Check what dll the class comes from */ + hdll = LoadLibraryW(L"geolocation.dll"); + ok (!!hdll || broken(!hdll), "Failed to load library, err %lu.\n", GetLastError()); + if (!hdll) /* Win8 has windows.devices.geolocation.dll */ + { + hdll = LoadLibraryW(L"windows.devices.geolocation.dll"); + ok (!!hdll, "Failed to load library, err %lu.\n", GetLastError()); }
+ pDllGetActivationFactory = (void *)GetProcAddress(hdll, "DllGetActivationFactory"); + ok(!!pDllGetActivationFactory, "DllGetActivationFactory not found.\n"); + if (pDllGetActivationFactory) + { + hr = pDllGetActivationFactory(str, &factory2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + IActivationFactory_Release(factory2); + } + WindowsDeleteString(str); + /* Don't check IID_IAgileObject since it's ignored on win 8 */ check_interface(factory, &IID_IUnknown); check_interface(factory, &IID_IInspectable);
On Fri Jul 7 22:43:53 2023 +0000, **** wrote:
Win8 doesn't have `geolocation`, instead it has `windows.devices.geolocation` like I originally had. I adapted the tests, but am unsure how to do it properly, please advise.
On Fri Jul 7 23:45:01 2023 +0000, Fabian Maurer wrote:
I'd suggest to name it like Win10 and maybe forget about testing the library name. It should not matter until there's some direct export that some application uses.