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
6f3b45d2
Commit
6f3b45d2
authored
Aug 23, 2016
by
Bernhard Übelacker
Committed by
Alexandre Julliard
Aug 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mlang/tests: Test IMultiLanguage_GetCharsetInfo with malformed charsets.
Signed-off-by:
Bernhard Übelacker
<
bernhardu@mailbox.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7888382e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
5 deletions
+39
-5
mlang.c
dlls/mlang/tests/mlang.c
+39
-5
No files found.
dlls/mlang/tests/mlang.c
View file @
6f3b45d2
...
@@ -696,15 +696,49 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags)
...
@@ -696,15 +696,49 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags)
IEnumCodePage_Release
(
iEnumCP
);
IEnumCodePage_Release
(
iEnumCP
);
}
}
static
void
test_GetCharsetInfo_
alias
(
IMultiLanguage
*
ml
)
static
void
test_GetCharsetInfo_
other
(
IMultiLanguage
*
ml
)
{
{
WCHAR
asciiW
[]
=
{
'a'
,
's'
,
'c'
,
'i'
,
'i'
,
0
};
WCHAR
asciiW
[]
=
{
'a'
,
's'
,
'c'
,
'i'
,
'i'
,
0
};
WCHAR
iso88591_1W
[]
=
{
'I'
,
'S'
,
'O'
,
'-'
,
'8'
,
'8'
,
'5'
,
'9'
,
'-'
,
'1'
,
0
};
WCHAR
iso88591_1retW
[]
=
{
'i'
,
's'
,
'o'
,
'-'
,
'8'
,
'8'
,
'5'
,
'9'
,
'-'
,
'1'
,
0
};
WCHAR
iso88591_2W
[]
=
{
'I'
,
'S'
,
'O'
,
'8'
,
'8'
,
'5'
,
'9'
,
'-'
,
'1'
,
0
};
WCHAR
iso88591_2retW
[]
=
{
'i'
,
's'
,
'o'
,
'8'
,
'8'
,
'5'
,
'9'
,
'-'
,
'1'
,
0
};
WCHAR
iso88591_3W
[]
=
{
'I'
,
'S'
,
'O'
,
'8'
,
'8'
,
'5'
,
'9'
,
'1'
,
0
};
WCHAR
iso88591_4W
[]
=
{
'I'
,
'S'
,
'O'
,
'-'
,
'8'
,
'8'
,
'5'
,
'9'
,
'1'
,
0
};
WCHAR
iso88591_5W
[]
=
{
'I'
,
'S'
,
'O'
,
'8'
,
'8'
,
'-'
,
'5'
,
'9'
,
'1'
,
0
};
WCHAR
iso88591_6W
[]
=
{
'-'
,
'I'
,
'S'
,
'O'
,
'8'
,
'8'
,
'5'
,
'9'
,
'1'
,
0
};
WCHAR
iso88591_7W
[]
=
{
' '
,
'I'
,
'S'
,
'O'
,
'-'
,
'8'
,
'8'
,
'5'
,
'9'
,
'-'
,
'1'
,
0
};
struct
other
{
int
todo
;
HRESULT
hr
;
WCHAR
*
charset
;
WCHAR
*
ret_charset
;
}
other
[]
=
{
{
0
,
S_OK
,
asciiW
,
asciiW
},
{
0
,
S_OK
,
iso88591_1W
,
iso88591_1retW
},
{
1
,
S_OK
,
iso88591_2W
,
iso88591_2retW
},
{
0
,
E_FAIL
,
iso88591_3W
,
0
},
{
0
,
E_FAIL
,
iso88591_4W
,
0
},
{
0
,
E_FAIL
,
iso88591_5W
,
0
},
{
0
,
E_FAIL
,
iso88591_6W
,
0
},
{
0
,
E_FAIL
,
iso88591_7W
,
0
},
};
MIMECSETINFO
info
;
MIMECSETINFO
info
;
HRESULT
hr
;
HRESULT
hr
;
int
i
;
hr
=
IMultiLanguage_GetCharsetInfo
(
ml
,
asciiW
,
&
info
);
for
(
i
=
0
;
i
<
sizeof
(
other
)
/
sizeof
(
*
other
);
i
++
)
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
{
ok
(
!
lstrcmpW
(
info
.
wszCharset
,
asciiW
),
"got %s
\n
"
,
wine_dbgstr_w
(
info
.
wszCharset
));
hr
=
IMultiLanguage_GetCharsetInfo
(
ml
,
other
[
i
].
charset
,
&
info
);
todo_wine_if
(
other
[
i
].
todo
)
ok
(
hr
==
other
[
i
].
hr
,
"#%d: got %08x, expected %08x
\n
"
,
i
,
hr
,
other
[
i
].
hr
);
if
(
hr
==
S_OK
)
todo_wine_if
(
other
[
i
].
todo
)
ok
(
!
lstrcmpW
(
info
.
wszCharset
,
other
[
i
].
ret_charset
),
"#%d: got %s, expected %s
\n
"
,
i
,
wine_dbgstr_w
(
info
.
wszCharset
),
wine_dbgstr_w
(
other
[
i
].
ret_charset
));
}
}
}
static
void
scriptinfo_cmp
(
SCRIPTINFO
*
sinfo1
,
SCRIPTINFO
*
sinfo2
)
static
void
scriptinfo_cmp
(
SCRIPTINFO
*
sinfo1
,
SCRIPTINFO
*
sinfo2
)
...
@@ -2206,7 +2240,7 @@ START_TEST(mlang)
...
@@ -2206,7 +2240,7 @@ START_TEST(mlang)
test_GetNumberOfCodePageInfo
((
IMultiLanguage2
*
)
iML
);
test_GetNumberOfCodePageInfo
((
IMultiLanguage2
*
)
iML
);
test_IMLangConvertCharset
(
iML
);
test_IMLangConvertCharset
(
iML
);
test_GetCharsetInfo_
alias
(
iML
);
test_GetCharsetInfo_
other
(
iML
);
IMultiLanguage_Release
(
iML
);
IMultiLanguage_Release
(
iML
);
...
...
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