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
16d1b3b0
Commit
16d1b3b0
authored
Feb 13, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Added some SysFreeString tests.
parent
ed9d78d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
vartype.c
dlls/oleaut32/tests/vartype.c
+43
-0
No files found.
dlls/oleaut32/tests/vartype.c
View file @
16d1b3b0
...
...
@@ -6072,6 +6072,47 @@ static void test_ChangeType_keep_dst(void)
SysFreeString
(
bstr
);
}
/* This tests assumes an empty cache, so it needs to be ran early in the test. */
static
void
test_bstr_cache
(
void
)
{
BSTR
str
,
str2
,
strs
[
20
];
unsigned
i
;
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
str
=
SysAllocString
(
testW
);
/* This should put the string into cache */
SysFreeString
(
str
);
/* The string is in cache, this won't touch it */
SysFreeString
(
str
);
ok
(
SysStringLen
(
str
)
==
4
,
"unexpected len
\n
"
);
ok
(
!
lstrcmpW
(
str
,
testW
),
"string changed
\n
"
);
str2
=
SysAllocString
(
testW
);
ok
(
str
==
str2
,
"str != str2
\n
"
);
SysFreeString
(
str2
);
/* Fill the bucket with cached entries. */
for
(
i
=
0
;
i
<
sizeof
(
strs
)
/
sizeof
(
*
strs
);
i
++
)
strs
[
i
]
=
SysAllocStringLen
(
NULL
,
24
);
for
(
i
=
0
;
i
<
sizeof
(
strs
)
/
sizeof
(
*
strs
);
i
++
)
SysFreeString
(
strs
[
i
]);
/* Following allocation will be made from cache */
str
=
SysAllocStringLen
(
NULL
,
24
);
ok
(
str
==
strs
[
0
],
"str != strs[0]
\n
"
);
/* Smaller buffers may also use larget cached buffers */
str2
=
SysAllocStringLen
(
NULL
,
16
);
ok
(
str2
==
strs
[
1
],
"str2 != strs[1]
\n
"
);
SysFreeString
(
str
);
SysFreeString
(
str2
);
SysFreeString
(
str
);
SysFreeString
(
str2
);
}
START_TEST
(
vartype
)
{
hOleaut32
=
GetModuleHandleA
(
"oleaut32.dll"
);
...
...
@@ -6079,6 +6120,8 @@ START_TEST(vartype)
trace
(
"LCIDs: System=0x%08x, User=0x%08x
\n
"
,
GetSystemDefaultLCID
(),
GetUserDefaultLCID
());
test_bstr_cache
();
test_VarI1FromI2
();
test_VarI1FromI4
();
test_VarI1FromI8
();
...
...
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