Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
18414266
Commit
18414266
authored
11 years ago
by
Jactry Zeng
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
riched20/tests: Add tests to check the content open by ITextDocument_fnOpen.
parent
7dc605ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/riched20/tests/richole.c
+50
-0
50 additions, 0 deletions
dlls/riched20/tests/richole.c
with
50 additions
and
0 deletions
dlls/riched20/tests/richole.c
+
50
−
0
View file @
18414266
...
...
@@ -159,6 +159,16 @@ static void test_ITextDocument_Open(void)
HANDLE
hFile
;
VARIANT
testfile
;
WCHAR
filename
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
int
result
;
DWORD
dw
;
static
const
CHAR
chACP
[]
=
"TestSomeText"
;
static
const
CHAR
chUTF8
[]
=
"
\xef\xbb\xbf
TextWithUTF8BOM"
;
static
const
WCHAR
chUTF16
[]
=
{
0xfeff
,
'T'
,
'e'
,
's'
,
't'
,
'S'
,
'o'
,
'm'
,
'e'
,
'T'
,
'e'
,
'x'
,
't'
,
0
};
#define MAX_BUF_LEN 1024
CHAR
bufACP
[
MAX_BUF_LEN
];
WCHAR
bufUnicode
[
MAX_BUF_LEN
];
static
const
int
tomConstantsSingle
[]
=
{
...
...
@@ -328,6 +338,46 @@ static void test_ITextDocument_Open(void)
CloseHandle
(
hFile
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
DeleteFileW
(
filename
);
/* tests to check the content */
hFile
=
CreateFileW
(
filename
,
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
WriteFile
(
hFile
,
chACP
,
sizeof
(
chACP
)
-
sizeof
(
CHAR
),
&
dw
,
NULL
);
CloseHandle
(
hFile
);
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
ITextDocument_Open
(
txtDoc
,
&
testfile
,
tomReadOnly
,
CP_ACP
);
result
=
SendMessageA
(
w
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
bufACP
);
todo_wine
ok
(
result
==
12
,
"ITextDocument_Open: Test ASCII returned %d, expected 12
\n
"
,
result
);
result
=
strcmp
(
bufACP
,
chACP
);
todo_wine
ok
(
result
==
0
,
"ITextDocument_Open: Test ASCII set wrong text: Result: %s
\n
"
,
bufACP
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
DeleteFileW
(
filename
);
hFile
=
CreateFileW
(
filename
,
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
WriteFile
(
hFile
,
chUTF8
,
sizeof
(
chUTF8
)
-
sizeof
(
CHAR
),
&
dw
,
NULL
);
CloseHandle
(
hFile
);
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
ITextDocument_Open
(
txtDoc
,
&
testfile
,
tomReadOnly
,
CP_UTF8
);
result
=
SendMessageA
(
w
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
bufACP
);
todo_wine
ok
(
result
==
15
,
"ITextDocument_Open: Test UTF-8 returned %d, expected 15
\n
"
,
result
);
result
=
strcmp
(
bufACP
,
&
chUTF8
[
3
]);
todo_wine
ok
(
result
==
0
,
"ITextDocument_Open: Test UTF-8 set wrong text: Result: %s
\n
"
,
bufACP
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
DeleteFileW
(
filename
);
hFile
=
CreateFileW
(
filename
,
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
WriteFile
(
hFile
,
chUTF16
,
sizeof
(
chUTF16
)
-
sizeof
(
WCHAR
),
&
dw
,
NULL
);
CloseHandle
(
hFile
);
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
ITextDocument_Open
(
txtDoc
,
&
testfile
,
tomReadOnly
,
1200
);
result
=
SendMessageW
(
w
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
bufUnicode
);
todo_wine
ok
(
result
==
12
,
"ITextDocument_Open: Test UTF-16 returned %d, expected 12
\n
"
,
result
);
result
=
lstrcmpW
(
bufUnicode
,
&
chUTF16
[
1
]);
todo_wine
ok
(
result
==
0
,
"ITextDocument_Open: Test UTF-16 set wrong text: Result: %s
\n
"
,
wine_dbgstr_w
(
bufUnicode
));
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
DeleteFileW
(
filename
);
}
START_TEST
(
richole
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment