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
7f64332d
Commit
7f64332d
authored
Jun 12, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Jun 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add some more MsiFormatRecord tests.
parent
bef879cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
112 additions
and
3 deletions
+112
-3
format.c
dlls/msi/tests/format.c
+112
-3
No files found.
dlls/msi/tests/format.c
View file @
7f64332d
...
...
@@ -1060,18 +1060,127 @@ static void test_formatrecord(void)
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
13
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"{[1{{bo}o}}]}"
),
"wrong output
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"{[1{{bo}o}}]}"
),
"wrong output
%s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"{[1{{b{o}o}}]}"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
14
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"{[1{{b{o}o}}]}"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"{ {[1]}"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"hoo"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
5
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
" {hoo"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
/* {} inside a substitution does strange things... */
r
=
MsiRecordSetString
(
hrec
,
0
,
"[[1]{}]"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"2"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
5
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"[[1]]"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"[[1]{}[1]]"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"2"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
6
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"[[1]2]"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"[a[1]b[1]c{}d[1]e]"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"2"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
14
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"
{[1{{b{o}o}}]}"
),
"wrong output
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"
[a[1]b[1]cd2e]"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
MsiCloseHandle
(
hrec
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"[a[1]b"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"2"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
6
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"[a[1]b"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"a[1]b]"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"2"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
4
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"a2b]"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"]a[1]b"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"2"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
4
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"]a2b"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"]a[1]b"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"2"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
4
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"]a2b"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"
\\
[1]"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"2"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
2
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"
\\
2"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"
\\
{[1]}"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"2"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
2
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"
\\
2"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"a{b[1]c}d"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
NULL
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
2
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"ad"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"{a[0]b}"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"foo"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
9
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"a{a[0]b}b"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"[foo]"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
5
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"[foo]"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
r
=
MsiRecordSetString
(
hrec
,
0
,
"{[1][-1][1]}"
);
r
=
MsiRecordSetString
(
hrec
,
1
,
"foo"
);
sz
=
sizeof
buffer
;
r
=
MsiFormatRecord
(
0
,
hrec
,
buffer
,
&
sz
);
ok
(
sz
==
12
,
"size wrong
\n
"
);
ok
(
0
==
strcmp
(
buffer
,
"{foo[-1]foo}"
),
"wrong output %s
\n
"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"format failed
\n
"
);
}
static
void
test_formatrecord_package
(
void
)
...
...
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