Jacek Caban : vbscript: Added creation tests.
Alexandre Julliard
julliard at winehq.org
Tue Jul 19 12:42:54 CDT 2011
Module: wine
Branch: master
Commit: 68c6f58e6ef8ed6ee0c5f10d65ec7ed125125ea9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=68c6f58e6ef8ed6ee0c5f10d65ec7ed125125ea9
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Jul 19 13:46:50 2011 +0200
vbscript: Added creation tests.
---
configure | 1 +
configure.ac | 1 +
dlls/vbscript/tests/Makefile.in | 7 ++++
dlls/vbscript/tests/vbscript.c | 71 +++++++++++++++++++++++++++++++++++++++
4 files changed, 80 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index d6a4958..4ecbcb6 100755
--- a/configure
+++ b/configure
@@ -15124,6 +15124,7 @@ wine_fn_config_lib uuid
wine_fn_config_dll uxtheme enable_uxtheme implib
wine_fn_config_test dlls/uxtheme/tests uxtheme_test
wine_fn_config_dll vbscript enable_vbscript
+wine_fn_config_test dlls/vbscript/tests vbscript_test
wine_fn_config_dll vcomp enable_vcomp
wine_fn_config_dll vdhcp.vxd enable_win16
wine_fn_config_dll vdmdbg enable_vdmdbg implib
diff --git a/configure.ac b/configure.ac
index cd5fc18..b213923 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2797,6 +2797,7 @@ WINE_CONFIG_LIB(uuid)
WINE_CONFIG_DLL(uxtheme,,[implib])
WINE_CONFIG_TEST(dlls/uxtheme/tests)
WINE_CONFIG_DLL(vbscript)
+WINE_CONFIG_TEST(dlls/vbscript/tests)
WINE_CONFIG_DLL(vcomp)
WINE_CONFIG_DLL(vdhcp.vxd,enable_win16)
WINE_CONFIG_DLL(vdmdbg,,[implib])
diff --git a/dlls/vbscript/tests/Makefile.in b/dlls/vbscript/tests/Makefile.in
new file mode 100644
index 0000000..87742f0
--- /dev/null
+++ b/dlls/vbscript/tests/Makefile.in
@@ -0,0 +1,7 @@
+TESTDLL = vbscript.dll
+IMPORTS = ole32
+
+C_SRCS = \
+ vbscript.c
+
+ at MAKE_TEST_RULES@
diff --git a/dlls/vbscript/tests/vbscript.c b/dlls/vbscript/tests/vbscript.c
new file mode 100644
index 0000000..7de424f
--- /dev/null
+++ b/dlls/vbscript/tests/vbscript.c
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2011 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
+#define CONST_VTABLE
+
+#include <initguid.h>
+#include <ole2.h>
+#include <activscp.h>
+
+#include "wine/test.h"
+
+DEFINE_GUID(CLSID_VBScript, 0xb54f3741, 0x5b07, 0x11cf, 0xa4,0xb0, 0x00,0xaa,0x00,0x4a,0x55,0xe8);
+
+static void test_vbscript(void)
+{
+ IActiveScriptParse *parser;
+ IActiveScript *vbscript;
+ HRESULT hres;
+
+ hres = CoCreateInstance(&CLSID_VBScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
+ &IID_IActiveScript, (void**)&vbscript);
+ ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
+
+ hres = IActiveScript_QueryInterface(vbscript, &IID_IActiveScriptParse, (void**)&parser);
+ ok(hres == S_OK, "Could not get IActiveScriptParse iface: %08x\n", hres);
+
+ IActiveScriptParse64_Release(parser);
+ IActiveScript_Release(vbscript);
+}
+
+static BOOL check_vbscript(void)
+{
+ IActiveScript *vbscript;
+ HRESULT hres;
+
+ hres = CoCreateInstance(&CLSID_VBScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
+ &IID_IActiveScript, (void**)&vbscript);
+ if(SUCCEEDED(hres))
+ IActiveScript_Release(vbscript);
+
+ return hres == S_OK;
+}
+
+
+START_TEST(vbscript)
+{
+ CoInitialize(NULL);
+
+ if(check_vbscript())
+ test_vbscript();
+ else
+ win_skip("VBScript engine not available\n");
+
+ CoUninitialize();
+}
More information about the wine-cvs
mailing list