Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a42f3cb4
Commit
a42f3cb4
authored
Sep 27, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added WeekDayName implementation.
parent
5f5f20d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
10 deletions
+66
-10
global.c
dlls/vbscript/global.c
+46
-5
api.vbs
dlls/vbscript/tests/api.vbs
+15
-0
run.c
dlls/vbscript/tests/run.c
+5
-5
No files found.
dlls/vbscript/global.c
View file @
a42f3cb4
...
...
@@ -63,7 +63,7 @@ static IInternetHostSecurityManager *get_sec_mgr(script_ctx_t *ctx)
return
ctx
->
secmgr
=
secmgr
;
}
static
HRESULT
return_
bstr
(
VARIANT
*
res
,
const
WCHAR
*
str
)
static
HRESULT
return_
string
(
VARIANT
*
res
,
const
WCHAR
*
str
)
{
BSTR
ret
;
...
...
@@ -79,6 +79,17 @@ static HRESULT return_bstr(VARIANT *res, const WCHAR *str)
return
S_OK
;
}
static
HRESULT
return_bstr
(
VARIANT
*
res
,
BSTR
str
)
{
if
(
res
)
{
V_VT
(
res
)
=
VT_BSTR
;
V_BSTR
(
res
)
=
str
;
}
else
{
SysFreeString
(
str
);
}
return
S_OK
;
}
static
HRESULT
return_short
(
VARIANT
*
res
,
short
val
)
{
if
(
res
)
{
...
...
@@ -137,6 +148,9 @@ static HRESULT to_int(VARIANT *v, int *ret)
*
ret
=
n
;
break
;
}
case
VT_BOOL
:
*
ret
=
V_BOOL
(
v
)
?
-
1
:
0
;
break
;
default:
FIXME
(
"not supported %s
\n
"
,
debugstr_variant
(
v
));
return
E_NOTIMPL
;
...
...
@@ -427,7 +441,7 @@ static HRESULT Global_Hex(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
*
ptr
=
'0'
;
}
return
return_
bstr
(
res
,
ptr
);
return
return_
string
(
res
,
ptr
);
}
static
HRESULT
Global_Oct
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
@@ -1224,8 +1238,35 @@ static HRESULT Global_FormatDateTime(vbdisp_t *This, VARIANT *arg, unsigned args
static
HRESULT
Global_WeekdayName
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
int
weekday
,
first_day
=
0
,
abbrev
=
0
;
BSTR
ret
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
assert
(
1
<=
args_cnt
&&
args_cnt
<=
3
);
hres
=
to_int
(
arg
+
args_cnt
-
1
,
&
weekday
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
args_cnt
>
1
)
{
hres
=
to_int
(
arg
+
args_cnt
-
2
,
&
abbrev
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
args_cnt
==
3
)
{
hres
=
to_int
(
arg
,
&
first_day
);
if
(
FAILED
(
hres
))
return
hres
;
}
}
hres
=
VarWeekdayName
(
weekday
,
abbrev
,
first_day
,
0
,
&
ret
);
if
(
FAILED
(
hres
))
return
hres
;
return
return_bstr
(
res
,
ret
);
}
static
HRESULT
Global_MonthName
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
@@ -1988,7 +2029,7 @@ static const builtin_prop_t global_props[] = {
{
DISPID_GLOBAL_FORMATCURRENCY
,
Global_FormatCurrency
,
0
,
1
,
5
},
{
DISPID_GLOBAL_FORMATPERCENT
,
Global_FormatPercent
,
0
,
1
,
5
},
{
DISPID_GLOBAL_FORMATDATETIME
,
Global_FormatDateTime
,
0
,
1
,
2
},
{
DISPID_GLOBAL_WEEKDAYNAME
,
Global_WeekdayName
,
0
,
3
},
{
DISPID_GLOBAL_WEEKDAYNAME
,
Global_WeekdayName
,
0
,
1
,
3
},
{
DISPID_GLOBAL_MONTHNAME
,
Global_MonthName
,
0
,
1
,
2
},
{
DISPID_GLOBAL_ROUND
,
Global_Round
,
0
,
1
,
2
},
{
DISPID_GLOBAL_ESCAPE
,
Global_Escape
,
0
,
1
},
...
...
dlls/vbscript/tests/api.vbs
View file @
a42f3cb4
...
...
@@ -190,6 +190,7 @@ Call ok(Len(empty) = 0, "Len(empty) = " & Len(empty))
Call
ok
(
Space
(
1
)
=
" "
,
"Space(1) = "
&
Space
(
1
)
&
"
""
"
)
Call
ok
(
Space
(
0
)
=
""
,
"Space(0) = "
&
Space
(
0
)
&
"
""
"
)
Call
ok
(
Space
(
false
)
=
""
,
"Space(false) = "
&
Space
(
false
)
&
"
""
"
)
Call
ok
(
Space
(
5
)
=
" "
,
"Space(5) = "
&
Space
(
5
)
&
"
""
"
)
Call
ok
(
Space
(
5.2
)
=
" "
,
"Space(5.2) = "
&
Space
(
5.2
)
&
"
""
"
)
Call
ok
(
Space
(
5.8
)
=
" "
,
"Space(5.8) = "
&
Space
(
5.8
)
&
"
""
"
)
...
...
@@ -210,4 +211,18 @@ TestRound "2", 2, "VT_R8"
TestRound
true
,
true
,
"VT_BOOL"
TestRound
false
,
false
,
"VT_BOOL"
if
isEnglishLang
then
Call
ok
(
WeekDayName
(
1
)
=
"Sunday"
,
"WeekDayName(1) = "
&
WeekDayName
(
1
))
Call
ok
(
WeekDayName
(
3
)
=
"Tuesday"
,
"WeekDayName(3) = "
&
WeekDayName
(
3
))
Call
ok
(
WeekDayName
(
7
)
=
"Saturday"
,
"WeekDayName(7) = "
&
WeekDayName
(
7
))
Call
ok
(
WeekDayName
(
1.1
)
=
"Sunday"
,
"WeekDayName(1.1) = "
&
WeekDayName
(
1.1
))
Call
ok
(
WeekDayName
(
1
,
false
)
=
"Sunday"
,
"WeekDayName(1, false) = "
&
WeekDayName
(
1
,
false
))
Call
ok
(
WeekDayName
(
1
,
true
)
=
"Sun"
,
"WeekDayName(1, true) = "
&
WeekDayName
(
1
,
true
))
Call
ok
(
WeekDayName
(
1
,
10
)
=
"Sun"
,
"WeekDayName(1, 10) = "
&
WeekDayName
(
1
,
10
))
Call
ok
(
WeekDayName
(
1
,
true
,
0
)
=
"Sun"
,
"WeekDayName(1, true, 0) = "
&
WeekDayName
(
1
,
true
,
0
))
Call
ok
(
WeekDayName
(
1
,
true
,
2
)
=
"Mon"
,
"WeekDayName(1, true, 2) = "
&
WeekDayName
(
1
,
true
,
2
))
Call
ok
(
WeekDayName
(
1
,
true
,
7
)
=
"Sat"
,
"WeekDayName(1, true, 7) = "
&
WeekDayName
(
1
,
true
,
7
))
Call
ok
(
WeekDayName
(
1
,
true
,
7.1
)
=
"Sat"
,
"WeekDayName(1, true, 7.1) = "
&
WeekDayName
(
1
,
true
,
7.1
))
end
if
Call
reportSuccess
()
dlls/vbscript/tests/run.c
View file @
a42f3cb4
...
...
@@ -202,10 +202,10 @@ static BOOL is_lang_english(void)
pGetThreadUILanguage
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetThreadUILanguage"
);
pGetUserDefaultUILanguage
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetUserDefaultUILanguage"
);
}
if
(
pGetThreadUILanguage
)
return
PRIMARYLANGID
(
pGetThreadUILanguage
())
==
LANG_ENGLISH
;
if
(
pGetUserDefaultUILanguage
)
return
PRIMARYLANGID
(
pGetUserDefaultUILanguage
())
==
LANG_ENGLISH
;
if
(
pGetThreadUILanguage
&&
PRIMARYLANGID
(
pGetThreadUILanguage
())
!=
LANG_ENGLISH
)
return
FALSE
;
if
(
pGetUserDefaultUILanguage
&&
PRIMARYLANGID
(
pGetUserDefaultUILanguage
())
!=
LANG_ENGLISH
)
return
FALSE
;
return
PRIMARYLANGID
(
GetUserDefaultLangID
())
==
LANG_ENGLISH
;
}
...
...
@@ -1906,7 +1906,7 @@ START_TEST(run)
is_english
=
is_lang_english
();
if
(
!
is_english
)
skip
(
"Skipping some tests in non-English
UIs
\n
"
);
skip
(
"Skipping some tests in non-English
locale
\n
"
);
argc
=
winetest_get_mainargs
(
&
argv
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment