hlink: Add a short test case.
This commit is contained in:
parent
af29c05a05
commit
a430db9e39
@ -1617,6 +1617,7 @@ dlls/glut32/Makefile
|
|||||||
dlls/gphoto2.ds/Makefile
|
dlls/gphoto2.ds/Makefile
|
||||||
dlls/hhctrl.ocx/Makefile
|
dlls/hhctrl.ocx/Makefile
|
||||||
dlls/hlink/Makefile
|
dlls/hlink/Makefile
|
||||||
|
dlls/hlink/tests/Makefile
|
||||||
dlls/iccvid/Makefile
|
dlls/iccvid/Makefile
|
||||||
dlls/icmp/Makefile
|
dlls/icmp/Makefile
|
||||||
dlls/ifsmgr.vxd/Makefile
|
dlls/ifsmgr.vxd/Makefile
|
||||||
|
1
dlls/.gitignore
vendored
1
dlls/.gitignore
vendored
@ -94,6 +94,7 @@ dsound/libdsound.def
|
|||||||
gdi/libgdi32.def
|
gdi/libgdi32.def
|
||||||
glu32/libglu32.def
|
glu32/libglu32.def
|
||||||
glut32/libglut32.def
|
glut32/libglut32.def
|
||||||
|
hlink/libhlink.def
|
||||||
icmp/libicmp.def
|
icmp/libicmp.def
|
||||||
imagehlp/libimagehlp.def
|
imagehlp/libimagehlp.def
|
||||||
imm32/libimm32.def
|
imm32/libimm32.def
|
||||||
|
@ -475,6 +475,7 @@ IMPORT_LIBS = \
|
|||||||
gdi/libgdi32.$(IMPLIBEXT) \
|
gdi/libgdi32.$(IMPLIBEXT) \
|
||||||
glu32/libglu32.$(IMPLIBEXT) \
|
glu32/libglu32.$(IMPLIBEXT) \
|
||||||
glut32/libglut32.$(IMPLIBEXT) \
|
glut32/libglut32.$(IMPLIBEXT) \
|
||||||
|
hlink/libhlink.$(IMPLIBEXT) \
|
||||||
icmp/libicmp.$(IMPLIBEXT) \
|
icmp/libicmp.$(IMPLIBEXT) \
|
||||||
imagehlp/libimagehlp.$(IMPLIBEXT) \
|
imagehlp/libimagehlp.$(IMPLIBEXT) \
|
||||||
imm32/libimm32.$(IMPLIBEXT) \
|
imm32/libimm32.$(IMPLIBEXT) \
|
||||||
@ -669,6 +670,9 @@ glu32/libglu32.$(IMPLIBEXT): glu32/glu32.spec $(WINEBUILD)
|
|||||||
glut32/libglut32.$(IMPLIBEXT): glut32/glut32.spec $(WINEBUILD)
|
glut32/libglut32.$(IMPLIBEXT): glut32/glut32.spec $(WINEBUILD)
|
||||||
@cd glut32 && $(MAKE) libglut32.$(IMPLIBEXT)
|
@cd glut32 && $(MAKE) libglut32.$(IMPLIBEXT)
|
||||||
|
|
||||||
|
hlink/libhlink.$(IMPLIBEXT): hlink/hlink.spec $(WINEBUILD)
|
||||||
|
@cd hlink && $(MAKE) libhlink.$(IMPLIBEXT)
|
||||||
|
|
||||||
icmp/libicmp.$(IMPLIBEXT): icmp/icmp.spec $(WINEBUILD)
|
icmp/libicmp.$(IMPLIBEXT): icmp/icmp.spec $(WINEBUILD)
|
||||||
@cd icmp && $(MAKE) libicmp.$(IMPLIBEXT)
|
@cd icmp && $(MAKE) libicmp.$(IMPLIBEXT)
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ SRCDIR = @srcdir@
|
|||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = hlink.dll
|
MODULE = hlink.dll
|
||||||
IMPORTS = ole32 advapi32 kernel32
|
IMPORTS = ole32 advapi32 kernel32
|
||||||
|
IMPORTLIB = libhlink.$(IMPLIBEXT)
|
||||||
DELAYIMPORTS = urlmon
|
DELAYIMPORTS = urlmon
|
||||||
EXTRALIBS = -luuid
|
EXTRALIBS = -luuid
|
||||||
|
|
||||||
@ -12,6 +13,8 @@ C_SRCS = \
|
|||||||
hlink_main.c \
|
hlink_main.c \
|
||||||
link.c
|
link.c
|
||||||
|
|
||||||
|
SUBDIRS = tests
|
||||||
|
|
||||||
@MAKE_DLL_RULES@
|
@MAKE_DLL_RULES@
|
||||||
|
|
||||||
### Dependencies:
|
### Dependencies:
|
||||||
|
14
dlls/hlink/tests/Makefile.in
Normal file
14
dlls/hlink/tests/Makefile.in
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
TOPSRCDIR = @top_srcdir@
|
||||||
|
TOPOBJDIR = ../../..
|
||||||
|
SRCDIR = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
TESTDLL = hlink.dll
|
||||||
|
IMPORTS = hlink ole32 kernel32
|
||||||
|
EXTRALIBS = -luuid
|
||||||
|
|
||||||
|
CTESTS = \
|
||||||
|
hlink.c
|
||||||
|
|
||||||
|
@MAKE_TEST_RULES@
|
||||||
|
|
||||||
|
### Dependencies:
|
72
dlls/hlink/tests/hlink.c
Normal file
72
dlls/hlink/tests/hlink.c
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* Implementation of hyperlinking (hlink.dll)
|
||||||
|
*
|
||||||
|
* Copyright 2006 Mike McCormack
|
||||||
|
*
|
||||||
|
* 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 <hlink.h>
|
||||||
|
#include <hlguids.h>
|
||||||
|
|
||||||
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
START_TEST(hlink)
|
||||||
|
{
|
||||||
|
HRESULT r;
|
||||||
|
IHlink *lnk = NULL;
|
||||||
|
IMoniker *mk = NULL;
|
||||||
|
const WCHAR url[] = { 'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o','r','g',0 };
|
||||||
|
const WCHAR url2[] = { 'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o','r','g','/',0 };
|
||||||
|
LPWSTR str = NULL;
|
||||||
|
|
||||||
|
CoInitialize(NULL);
|
||||||
|
|
||||||
|
r = HlinkCreateFromString(url, NULL, NULL, NULL,
|
||||||
|
0, NULL, &IID_IHlink, (LPVOID*) &lnk);
|
||||||
|
ok(r == S_OK, "failed to create link\n");
|
||||||
|
if (FAILED(r))
|
||||||
|
return;
|
||||||
|
|
||||||
|
r = IHlink_GetMonikerReference(lnk, HLINKGETREF_DEFAULT, NULL, NULL);
|
||||||
|
ok(r == S_OK, "failed\n");
|
||||||
|
|
||||||
|
r = IHlink_GetMonikerReference(lnk, HLINKGETREF_DEFAULT, &mk, &str);
|
||||||
|
ok(r == S_OK, "failed\n");
|
||||||
|
ok(mk != NULL, "no moniker\n");
|
||||||
|
ok(str == NULL, "string should be null\n");
|
||||||
|
|
||||||
|
r = IMoniker_Release(mk);
|
||||||
|
ok( r == 1, "moniker refcount wrong\n");
|
||||||
|
|
||||||
|
r = IHlink_GetStringReference(lnk, -1, &str, NULL);
|
||||||
|
ok(r == S_OK, "failed\n");
|
||||||
|
|
||||||
|
r = IHlink_GetStringReference(lnk, HLINKGETREF_DEFAULT, &str, NULL);
|
||||||
|
ok(r == S_OK, "failed\n");
|
||||||
|
todo_wine {
|
||||||
|
ok(!lstrcmpW(str, url2), "url wrong\n");
|
||||||
|
}
|
||||||
|
CoTaskMemFree(str);
|
||||||
|
|
||||||
|
r = IHlink_GetStringReference(lnk, HLINKGETREF_DEFAULT, NULL, NULL);
|
||||||
|
ok(r == S_OK, "failed\n");
|
||||||
|
|
||||||
|
r = IHlink_GetStringReference(lnk, HLINKGETREF_DEFAULT, NULL, &str);
|
||||||
|
ok(r == S_OK, "failed\n");
|
||||||
|
ok(str == NULL, "string should be null\n");
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user