Commit b01337e3 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

msscript.ocx/tests: Use wide-char string literals.

parent e377786a
......@@ -34,7 +34,6 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
#define TESTSCRIPT_CLSID "{178fc164-f585-4e24-9c13-4bb7faf80746}"
static const GUID CLSID_TestScript =
{0x178fc164,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x07,0x46}};
static const WCHAR vbW[] = {'V','B','S','c','r','i','p','t',0};
#ifdef _WIN64
......@@ -1371,9 +1370,6 @@ static void test_olecontrol(void)
static void test_Language(void)
{
static const WCHAR jsW[] = {'J','S','c','r','i','p','t',0};
static const WCHAR vb2W[] = {'v','B','s','c','r','i','p','t',0};
static const WCHAR dummyW[] = {'d','u','m','m','y',0};
IScriptControl *sc;
HRESULT hr;
BSTR str;
......@@ -1390,39 +1386,39 @@ static void test_Language(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(str == NULL, "got %s\n", wine_dbgstr_w(str));
str = SysAllocString(vbW);
str = SysAllocString(L"VBScript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
str = SysAllocString(vb2W);
str = SysAllocString(L"vBscript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
hr = IScriptControl_get_Language(sc, &str);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(!lstrcmpW(str, vbW), "got %s\n", wine_dbgstr_w(str));
ok(!lstrcmpW(str, L"VBScript"), "got %s\n", wine_dbgstr_w(str));
SysFreeString(str);
str = SysAllocString(dummyW);
str = SysAllocString(L"dummy");
hr = IScriptControl_put_Language(sc, str);
ok(hr == CTL_E_INVALIDPROPERTYVALUE, "got 0x%08x\n", hr);
SysFreeString(str);
hr = IScriptControl_get_Language(sc, &str);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(!lstrcmpW(str, vbW), "got %s\n", wine_dbgstr_w(str));
ok(!lstrcmpW(str, L"VBScript"), "got %s\n", wine_dbgstr_w(str));
SysFreeString(str);
str = SysAllocString(jsW);
str = SysAllocString(L"JScript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
hr = IScriptControl_get_Language(sc, &str);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(!lstrcmpW(str, jsW), "got %s\n", wine_dbgstr_w(str));
ok(!lstrcmpW(str, L"JScript"), "got %s\n", wine_dbgstr_w(str));
SysFreeString(str);
hr = IScriptControl_put_Language(sc, NULL);
......@@ -1436,8 +1432,6 @@ static void test_Language(void)
/* custom script engine */
if (have_custom_engine) {
static const WCHAR testscriptW[] = {'t','e','s','t','s','c','r','i','p','t',0};
hr = CoCreateInstance(&CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IScriptControl, (void**)&sc);
ok(hr == S_OK, "got 0x%08x\n", hr);
......@@ -1448,7 +1442,7 @@ static void test_Language(void)
SET_EXPECT(QI_IActiveScriptParse);
SET_EXPECT(InitNew);
str = SysAllocString(testscriptW);
str = SysAllocString(L"testscript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
......@@ -1462,7 +1456,7 @@ static void test_Language(void)
todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
if (hr == S_OK)
ok(!lstrcmpW(testscriptW, str), "%s\n", wine_dbgstr_w(str));
ok(!lstrcmpW(L"testscript", str), "%s\n", wine_dbgstr_w(str));
SysFreeString(str);
IActiveScriptSite_Release(site);
......@@ -1687,7 +1681,7 @@ static void test_timeout(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(val == 0, "got %d\n", val);
str = SysAllocString(vbW);
str = SysAllocString(L"VBScript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
......@@ -1716,7 +1710,7 @@ static void test_Reset(void)
hr = IScriptControl_Reset(sc);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
str = SysAllocString(vbW);
str = SysAllocString(L"VBScript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
......@@ -1726,15 +1720,13 @@ static void test_Reset(void)
hr = IScriptControl_get_Language(sc, &str);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(!lstrcmpW(str, vbW), "got %s\n", wine_dbgstr_w(str));
ok(!lstrcmpW(str, L"VBScript"), "got %s\n", wine_dbgstr_w(str));
SysFreeString(str);
IScriptControl_Release(sc);
/* custom script engine */
if (have_custom_engine) {
static const WCHAR testscriptW[] = {'t','e','s','t','s','c','r','i','p','t',0};
hr = CoCreateInstance(&CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IScriptControl, (void**)&sc);
ok(hr == S_OK, "got 0x%08x\n", hr);
......@@ -1745,7 +1737,7 @@ static void test_Reset(void)
SET_EXPECT(QI_IActiveScriptParse);
SET_EXPECT(InitNew);
str = SysAllocString(testscriptW);
str = SysAllocString(L"testscript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
......@@ -1833,7 +1825,6 @@ static IDispatch testdisp = { &dispvtbl };
static void test_AddObject(void)
{
static const WCHAR oW[] = {'o',0};
IScriptControl *sc;
BSTR str, objname;
HRESULT hr;
......@@ -1842,14 +1833,14 @@ static void test_AddObject(void)
&IID_IScriptControl, (void**)&sc);
ok(hr == S_OK, "got 0x%08x\n", hr);
objname = SysAllocString(oW);
objname = SysAllocString(L"o");
hr = IScriptControl_AddObject(sc, objname, NULL, VARIANT_FALSE);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = IScriptControl_AddObject(sc, objname, &testdisp, VARIANT_FALSE);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
str = SysAllocString(vbW);
str = SysAllocString(L"VBScript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
......@@ -1867,8 +1858,6 @@ static void test_AddObject(void)
/* custom script engine */
if (have_custom_engine) {
static const WCHAR testscriptW[] = {'t','e','s','t','s','c','r','i','p','t',0};
hr = CoCreateInstance(&CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IScriptControl, (void**)&sc);
ok(hr == S_OK, "got 0x%08x\n", hr);
......@@ -1879,7 +1868,7 @@ static void test_AddObject(void)
SET_EXPECT(QI_IActiveScriptParse);
SET_EXPECT(InitNew);
str = SysAllocString(testscriptW);
str = SysAllocString(L"testscript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
......@@ -2122,7 +2111,7 @@ static void test_UseSafeSubset(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(use_safe_subset == VARIANT_TRUE, "got %d\n", use_safe_subset);
str = SysAllocString(vbW);
str = SysAllocString(L"VBScript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
......@@ -2239,7 +2228,7 @@ static void test_State(void)
hr = IScriptControl_put_State(sc, Connected);
ok(hr == E_FAIL, "got 0x%08x\n", hr);
str = SysAllocString(vbW);
str = SysAllocString(L"VBScript");
hr = IScriptControl_put_Language(sc, str);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
......
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