Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9d43994e
Commit
9d43994e
authored
Oct 29, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Oct 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a bunch of tests for MsiEvaluateCondition and make them pass.
parent
4007d748
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
241 additions
and
0 deletions
+241
-0
cond.y
dlls/msi/cond.y
+0
-0
package.c
dlls/msi/tests/package.c
+241
-0
No files found.
dlls/msi/cond.y
View file @
9d43994e
This diff is collapsed.
Click to expand it.
dlls/msi/tests/package.c
View file @
9d43994e
...
...
@@ -326,6 +326,247 @@ static void test_gettargetpath_bad(void)
MsiCloseHandle
(
hpkg
);
}
void
test_condition
(
void
)
{
MSICONDITION
r
;
MSIHANDLE
hpkg
;
hpkg
=
package_from_db
(
create_package_db
());
ok
(
hpkg
,
"failed to create package
\n
"
);
r
=
MsiEvaluateCondition
(
0
,
NULL
);
ok
(
r
==
MSICONDITION_ERROR
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
NULL
);
ok
(
r
==
MSICONDITION_NONE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
""
);
ok
(
r
==
MSICONDITION_NONE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"1"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 = 0"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 <> 0"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 = 1"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 >= 1"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 >="
);
ok
(
r
==
MSICONDITION_ERROR
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
" "
);
ok
(
r
==
MSICONDITION_NONE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"LicView <>
\"
1
\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"LicView <>
\"
0
\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"LicView <> LicView"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"not 0"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"not LicView"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"not
\"
A
\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"~not
\"
A
\"
"
);
ok
(
r
==
MSICONDITION_ERROR
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
0
\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"1 and 2"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"not 0 and 3"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"not 0 and 0"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"not 0 or 1"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"(0)"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"(((((1))))))"
);
ok
(
r
==
MSICONDITION_ERROR
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"(((((1)))))"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
A
\"
<
\"
B
\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
A
\"
>
\"
B
\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
1
\"
>
\"
12
\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
100
\"
<
\"
21
\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 < > 0"
);
ok
(
r
==
MSICONDITION_ERROR
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"(1<<1) == 2"
);
ok
(
r
==
MSICONDITION_ERROR
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
A
\"
=
\"
a
\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
A
\"
~ =
\"
a
\"
"
);
ok
(
r
==
MSICONDITION_ERROR
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
A
\"
~=
\"
a
\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
A
\"
~= 1 "
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
A
\"
= 1 "
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
" 1 ~= 1 "
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
" 1 ~=
\"
1
\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
" 1 =
\"
1
\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
" 0 =
\"
1
\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
" 0 <
\"
100
\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
" 100 >
\"
0
\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"1 XOR 1"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"1 IMP 1"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"1 IMP 0"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 IMP 0"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 EQV 0"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 EQV 1"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"1 IMP 1 OR 0"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"1 IMPL 1"
);
ok
(
r
==
MSICONDITION_ERROR
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
ASFD
\"
><
\"
S
\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
ASFD
\"
~><
\"
s
\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
ASFD
\"
~><
\"\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"
\"
ASFD
\"
~><
\"
sss
\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
MsiSetProperty
(
hpkg
,
"mm"
,
"5"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"mm = 5"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"mm < 6"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"mm <= 5"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"mm > 4"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"mm < 12"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"mm =
\"
5
\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 =
\"\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 AND
\"\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"1 AND
\"\"
"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"1 AND
\"
1
\"
"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"3 >< 1"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"3 >< 4"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"NOT 0 AND 0"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"NOT 0 AND 1"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"NOT 1 OR 0"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 AND 1 OR 1"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"0 AND 0 OR 1"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"NOT 0 AND 1 OR 0"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"_1 = _1"
);
ok
(
r
==
MSICONDITION_TRUE
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"( 1 AND 1 ) = 2"
);
ok
(
r
==
MSICONDITION_ERROR
,
"wrong return val
\n
"
);
r
=
MsiEvaluateCondition
(
hpkg
,
"NOT ( 1 AND 1 )"
);
ok
(
r
==
MSICONDITION_FALSE
,
"wrong return val
\n
"
);
MsiCloseHandle
(
hpkg
);
}
START_TEST
(
package
)
{
test_createpackage
();
...
...
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