Module: wine Branch: master Commit: 63ebe0191e3881956b5bbd8308ef2b117f40533f URL: http://source.winehq.org/git/wine.git/?a=commit;h=63ebe0191e3881956b5bbd8308...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Mar 24 21:53:14 2008 +0100
jscript: Added tests.
---
.gitignore | 4 ++ Makefile.in | 2 + configure | 3 ++ configure.ac | 1 + dlls/Makefile.in | 1 + dlls/jscript/tests/Makefile.in | 13 ++++++++ dlls/jscript/tests/jscript.c | 62 ++++++++++++++++++++++++++++++++++++++++ programs/winetest/Makefile.in | 3 ++ programs/winetest/winetest.rc | 1 + 9 files changed, 90 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore index a11719f..f6088d3 100644 --- a/.gitignore +++ b/.gitignore @@ -163,6 +163,9 @@ dlls/iphlpapi/tests/testlist.c dlls/itss/tests/*.ok dlls/itss/tests/itss_crosstest.exe dlls/itss/tests/testlist.c +dlls/jscript/tests/*.ok +dlls/jscript/tests/jscript_crosstest.exe +dlls/jscript/tests/testlist.c dlls/kernel32/libkernel32.def dlls/kernel32/nls/winerr_deu.mc.rc dlls/kernel32/nls/winerr_enu.mc.rc @@ -629,6 +632,7 @@ programs/winetest/inetcomm_test.exe programs/winetest/infosoft_test.exe programs/winetest/iphlpapi_test.exe programs/winetest/itss_test.exe +programs/winetest/jscript_test.exe programs/winetest/kernel32_test.exe programs/winetest/localspl_test.exe programs/winetest/localui_test.exe diff --git a/Makefile.in b/Makefile.in index 6366e9f..9364ba2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -300,6 +300,7 @@ ALL_MAKEFILES = \ dlls/itss/Makefile \ dlls/itss/tests/Makefile \ dlls/jscript/Makefile \ + dlls/jscript/tests/Makefile \ dlls/kernel32/Makefile \ dlls/kernel32/tests/Makefile \ dlls/localspl/Makefile \ @@ -722,6 +723,7 @@ dlls/itircl/Makefile: dlls/itircl/Makefile.in dlls/Makedll.rules dlls/itss/Makefile: dlls/itss/Makefile.in dlls/Makedll.rules dlls/itss/tests/Makefile: dlls/itss/tests/Makefile.in dlls/Maketest.rules dlls/jscript/Makefile: dlls/jscript/Makefile.in dlls/Makedll.rules +dlls/jscript/tests/Makefile: dlls/jscript/tests/Makefile.in dlls/Maketest.rules dlls/kernel32/Makefile: dlls/kernel32/Makefile.in dlls/Makedll.rules dlls/kernel32/tests/Makefile: dlls/kernel32/tests/Makefile.in dlls/Maketest.rules dlls/localspl/Makefile: dlls/localspl/Makefile.in dlls/Makedll.rules diff --git a/configure b/configure index 4ddce93..97e2a78 100755 --- a/configure +++ b/configure @@ -21548,6 +21548,8 @@ ac_config_files="$ac_config_files dlls/itss/tests/Makefile"
ac_config_files="$ac_config_files dlls/jscript/Makefile"
+ac_config_files="$ac_config_files dlls/jscript/tests/Makefile" + ac_config_files="$ac_config_files dlls/kernel32/Makefile"
ac_config_files="$ac_config_files dlls/kernel32/tests/Makefile" @@ -22794,6 +22796,7 @@ do "dlls/itss/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/itss/Makefile" ;; "dlls/itss/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/itss/tests/Makefile" ;; "dlls/jscript/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/jscript/Makefile" ;; + "dlls/jscript/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/jscript/tests/Makefile" ;; "dlls/kernel32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/kernel32/Makefile" ;; "dlls/kernel32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/kernel32/tests/Makefile" ;; "dlls/localspl/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/localspl/Makefile" ;; diff --git a/configure.ac b/configure.ac index 1ecf47c..1cfeedc 100644 --- a/configure.ac +++ b/configure.ac @@ -1803,6 +1803,7 @@ AC_CONFIG_FILES([dlls/itircl/Makefile]) AC_CONFIG_FILES([dlls/itss/Makefile]) AC_CONFIG_FILES([dlls/itss/tests/Makefile]) AC_CONFIG_FILES([dlls/jscript/Makefile]) +AC_CONFIG_FILES([dlls/jscript/tests/Makefile]) AC_CONFIG_FILES([dlls/kernel32/Makefile]) AC_CONFIG_FILES([dlls/kernel32/tests/Makefile]) AC_CONFIG_FILES([dlls/localspl/Makefile]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index 669d514..68c6be4 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -311,6 +311,7 @@ TESTSUBDIRS = \ infosoft/tests \ iphlpapi/tests \ itss/tests \ + jscript/tests \ kernel32/tests \ localspl/tests \ localui/tests \ diff --git a/dlls/jscript/tests/Makefile.in b/dlls/jscript/tests/Makefile.in new file mode 100644 index 0000000..2201a4a --- /dev/null +++ b/dlls/jscript/tests/Makefile.in @@ -0,0 +1,13 @@ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +TESTDLL = jscript.dll +IMPORTS = ole32 kernel32 + +CTESTS = \ + jscript.c + +@MAKE_TEST_RULES@ + +@DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/jscript/tests/jscript.c b/dlls/jscript/tests/jscript.c new file mode 100644 index 0000000..a811ef2 --- /dev/null +++ b/dlls/jscript/tests/jscript.c @@ -0,0 +1,62 @@ +/* + * Copyright 2008 Jacek Caban 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 <initguid.h> + +#include <ole2.h> +#include <activscp.h> + +#include "wine/test.h" + +static const CLSID CLSID_JScript = + {0xf414c260,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}}; + +static void test_jscript(void) +{ + IActiveScriptParse *parse; + IActiveScript *script; + IUnknown *unk; + HRESULT hres; + + hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, + &IID_IUnknown, (void**)&unk); + ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); + if(FAILED(hres)) + return; + + hres = IUnknown_QueryInterface(unk, &IID_IActiveScript, (void**)&script); + ok(hres == S_OK, "Could not get IActiveScript: %08x\n", hres); + + hres = IUnknown_QueryInterface(unk, &IID_IActiveScriptParse, (void**)&parse); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + + IActiveScriptParse_Release(parse); + IActiveScript_Release(script); + IUnknown_Release(unk); +} + +START_TEST(jscript) +{ + CoInitialize(NULL); + + test_jscript(); + + CoUninitialize(); +} diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in index b2102ce..4552284 100644 --- a/programs/winetest/Makefile.in +++ b/programs/winetest/Makefile.in @@ -48,6 +48,7 @@ TESTBINS = \ infosoft_test.exe \ iphlpapi_test.exe \ itss_test.exe \ + jscript_test.exe \ kernel32_test.exe \ localspl_test.exe \ localui_test.exe \ @@ -155,6 +156,8 @@ iphlpapi_test.exe: $(DLLDIR)/iphlpapi/tests/iphlpapi_test.exe$(DLLEXT) cp $(DLLDIR)/iphlpapi/tests/iphlpapi_test.exe$(DLLEXT) $@ && $(STRIP) $@ itss_test.exe: $(DLLDIR)/itss/tests/itss_test.exe$(DLLEXT) cp $(DLLDIR)/itss/tests/itss_test.exe$(DLLEXT) $@ && $(STRIP) $@ +jscript_test.exe: $(DLLDIR)/jscript/tests/jscript_test.exe$(DLLEXT) + cp $(DLLDIR)/jscript/tests/jscript_test.exe$(DLLEXT) $@ && $(STRIP) $@ kernel32_test.exe: $(DLLDIR)/kernel32/tests/kernel32_test.exe$(DLLEXT) cp $(DLLDIR)/kernel32/tests/kernel32_test.exe$(DLLEXT) $@ && $(STRIP) $@ localspl_test.exe: $(DLLDIR)/localspl/tests/localspl_test.exe$(DLLEXT) diff --git a/programs/winetest/winetest.rc b/programs/winetest/winetest.rc index 950981e..2a70931 100644 --- a/programs/winetest/winetest.rc +++ b/programs/winetest/winetest.rc @@ -106,6 +106,7 @@ inetcomm_test.exe TESTRES "inetcomm_test.exe" infosoft_test.exe TESTRES "infosoft_test.exe" iphlpapi_test.exe TESTRES "iphlpapi_test.exe" itss_test.exe TESTRES "itss_test.exe" +jscript_test.exe TESTRES "jscript_test.exe" kernel32_test.exe TESTRES "kernel32_test.exe" localspl_test.exe TESTRES "localspl_test.exe" localui_test.exe TESTRES "localui_test.exe"