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
e618c6d1
Commit
e618c6d1
authored
Feb 04, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add more tests for MsiFormatRecord.
parent
1ceef1e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
0 deletions
+108
-0
format.c
dlls/msi/tests/format.c
+108
-0
No files found.
dlls/msi/tests/format.c
View file @
e618c6d1
...
...
@@ -1794,6 +1794,101 @@ static void test_formatrecord_package(void)
ok
(
sz
==
0
,
"size wrong: %d
\n
"
,
sz
);
ok
(
0
==
strcmp
(
buffer
,
""
),
"wrong output: %s
\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"
\\
x"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"
\\
x"
),
"Expected
\"\\
x
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[
\\
["
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
3
,
"Expected 3, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"[
\\
["
),
"Expected
\"
[
\\
[
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[
\\
[]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
1
,
"Expected 1, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"["
),
"Expected
\"
[
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[[]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
3
,
"Expected 3, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"[[]"
),
"Expected
\"
[]
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[
\\
[]]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
2
,
"Expected 2, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"[]"
),
"Expected
\"
[]
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[
\\
[a]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
1
,
"Expected 1, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"["
),
"Expected
\"
[
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[
\\
a[]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
sz
==
1
,
"Expected 1, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"a"
),
"Expected
\"
a
\"
, got
\"
%s
\"\n
"
,
buffer
);
}
MsiRecordSetString
(
hrec
,
0
,
"[prop]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
3
,
"Expected 3, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"val"
),
"Expected
\"
val
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[prop] [pro
\\
pblah] [prop]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
8
,
"Expected 8, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"val val"
),
"Expected
\"
val val
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiSetPropertyA
(
package
,
"b"
,
"ball"
);
MsiRecordSetString
(
hrec
,
0
,
"[
\\
b]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
1
,
"Expected 1, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"b"
),
"Expected
\"
b
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[
\\
c]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
1
,
"Expected 1, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"c"
),
"Expected
\"
c
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[
\\
[]prop]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
6
,
"Expected 6, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"[prop]"
),
"Expected
\"
[prop]
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[
\\
a]prop]"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
sz
==
6
,
"Expected 6, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"aprop]"
),
"Expected
\"
aprop]
\"
, got
\"
%s
\"\n
"
,
buffer
);
MsiRecordSetString
(
hrec
,
0
,
"[
\\
[]Bracket Text[
\\
]]"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
...
...
@@ -1812,6 +1907,19 @@ static void test_formatrecord_package(void)
ok
(
sz
==
9
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"boo "
),
"wrong output
\n
"
);
MsiRecordSetString
(
hrec
,
0
,
"[1] [~abc] [2]"
);
MsiRecordSetString
(
hrec
,
1
,
"boo"
);
MsiRecordSetString
(
hrec
,
2
,
"hoo"
);
sz
=
sizeof
(
buffer
);
r
=
MsiFormatRecord
(
package
,
hrec
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
sz
==
8
,
"Expected 8, got %d
\n
"
,
sz
);
ok
(
!
lstrcmpA
(
buffer
,
"boo hoo"
),
"Expected
\"
boo hoo
\"
, got
\"
%s
\"\n
"
,
buffer
);
}
/* properties */
r
=
MsiSetProperty
(
package
,
"dummy"
,
"Bork"
);
ok
(
r
==
ERROR_SUCCESS
,
"set property failed
\n
"
);
...
...
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