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
c9ec69db
Commit
c9ec69db
authored
Oct 08, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Oct 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for converting record fields between strings and ints.
parent
b1870083
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
record.c
dlls/msi/tests/record.c
+56
-0
No files found.
dlls/msi/tests/record.c
View file @
c9ec69db
...
...
@@ -376,10 +376,66 @@ static void test_MsiRecordGetString(void)
ok
(
sz
==
0
,
"Expected 0, got %d
\n
"
,
sz
);
MsiCloseHandle
(
rec
);
rec
=
MsiCreateRecord
(
1
);
ok
(
rec
!=
0
,
"Expected a valid handle
\n
"
);
r
=
MsiRecordSetInteger
(
rec
,
1
,
5
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiRecordGetString
(
rec
,
1
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"5"
),
"Expected
\"
5
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
1
,
"Expectd 1, got %d
\n
"
,
sz
);
r
=
MsiRecordSetInteger
(
rec
,
1
,
-
5
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
sz
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
r
=
MsiRecordGetString
(
rec
,
1
,
buf
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"-5"
),
"Expected
\"
-5
\"
, got
\"
%s
\"\n
"
,
buf
);
ok
(
sz
==
2
,
"Expectd 2, got %d
\n
"
,
sz
);
MsiCloseHandle
(
rec
);
}
static
void
test_MsiRecordGetInteger
(
void
)
{
MSIHANDLE
rec
;
INT
val
;
UINT
r
;
rec
=
MsiCreateRecord
(
1
);
ok
(
rec
!=
0
,
"Expected a valid handle
\n
"
);
r
=
MsiRecordSetString
(
rec
,
1
,
"5"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
val
=
MsiRecordGetInteger
(
rec
,
1
);
ok
(
val
==
5
,
"Expected 5, got %d
\n
"
,
val
);
r
=
MsiRecordSetString
(
rec
,
1
,
"-5"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
val
=
MsiRecordGetInteger
(
rec
,
1
);
ok
(
val
==
-
5
,
"Expected -5, got %d
\n
"
,
val
);
r
=
MsiRecordSetString
(
rec
,
1
,
"5apple"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
val
=
MsiRecordGetInteger
(
rec
,
1
);
ok
(
val
==
MSI_NULL_INTEGER
,
"Expected MSI_NULL_INTEGER, got %d
\n
"
,
val
);
MsiCloseHandle
(
rec
);
}
START_TEST
(
record
)
{
test_msirecord
();
test_MsiRecordGetString
();
test_MsiRecordGetInteger
();
}
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