msi: Add tests for MsiEvaluateCondition's substring operators.

This commit is contained in:
James Hawkins 2006-08-21 16:27:17 -07:00 committed by Alexandre Julliard
parent 73137390b0
commit 762a13eb34
1 changed files with 185 additions and 0 deletions

View File

@ -1005,6 +1005,191 @@ static void test_condition(void)
r = MsiEvaluateCondition(hpkg, "bandalmael<>0"); r = MsiEvaluateCondition(hpkg, "bandalmael<>0");
ok( r == MSICONDITION_TRUE, "wrong return val\n"); ok( r == MSICONDITION_TRUE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "hi");
MsiSetProperty(hpkg, "two", "hithere");
r = MsiEvaluateCondition(hpkg, "one >< two");
ok( r == MSICONDITION_FALSE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "hithere");
MsiSetProperty(hpkg, "two", "hi");
r = MsiEvaluateCondition(hpkg, "one >< two");
ok( r == MSICONDITION_TRUE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "hello");
MsiSetProperty(hpkg, "two", "hi");
r = MsiEvaluateCondition(hpkg, "one >< two");
ok( r == MSICONDITION_FALSE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "hellohithere");
MsiSetProperty(hpkg, "two", "hi");
r = MsiEvaluateCondition(hpkg, "one >< two");
ok( r == MSICONDITION_TRUE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "");
MsiSetProperty(hpkg, "two", "hi");
r = MsiEvaluateCondition(hpkg, "one >< two");
ok( r == MSICONDITION_FALSE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "hi");
MsiSetProperty(hpkg, "two", "");
r = MsiEvaluateCondition(hpkg, "one >< two");
ok( r == MSICONDITION_TRUE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "");
MsiSetProperty(hpkg, "two", "");
r = MsiEvaluateCondition(hpkg, "one >< two");
ok( r == MSICONDITION_FALSE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "1234");
MsiSetProperty(hpkg, "two", "1");
r = MsiEvaluateCondition(hpkg, "one >< two");
todo_wine
{
ok( r == MSICONDITION_FALSE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "one 1234");
MsiSetProperty(hpkg, "two", "1");
r = MsiEvaluateCondition(hpkg, "one >< two");
ok( r == MSICONDITION_TRUE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "hithere");
MsiSetProperty(hpkg, "two", "hi");
r = MsiEvaluateCondition(hpkg, "one << two");
todo_wine
{
ok( r == MSICONDITION_TRUE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "hi");
MsiSetProperty(hpkg, "two", "hithere");
r = MsiEvaluateCondition(hpkg, "one << two");
ok( r == MSICONDITION_FALSE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "hi");
MsiSetProperty(hpkg, "two", "hi");
r = MsiEvaluateCondition(hpkg, "one << two");
todo_wine
{
ok( r == MSICONDITION_TRUE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "abcdhithere");
MsiSetProperty(hpkg, "two", "hi");
r = MsiEvaluateCondition(hpkg, "one << two");
ok( r == MSICONDITION_FALSE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "");
MsiSetProperty(hpkg, "two", "hi");
r = MsiEvaluateCondition(hpkg, "one << two");
ok( r == MSICONDITION_FALSE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "hithere");
MsiSetProperty(hpkg, "two", "");
r = MsiEvaluateCondition(hpkg, "one << two");
todo_wine
{
ok( r == MSICONDITION_TRUE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "");
MsiSetProperty(hpkg, "two", "");
r = MsiEvaluateCondition(hpkg, "one << two");
ok( r == MSICONDITION_FALSE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "1234");
MsiSetProperty(hpkg, "two", "1");
r = MsiEvaluateCondition(hpkg, "one << two");
ok( r == MSICONDITION_FALSE, "wrong return val\n");
MsiSetProperty(hpkg, "one", "1234 one");
MsiSetProperty(hpkg, "two", "1");
r = MsiEvaluateCondition(hpkg, "one << two");
todo_wine
{
ok( r == MSICONDITION_TRUE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "hithere");
MsiSetProperty(hpkg, "two", "there");
r = MsiEvaluateCondition(hpkg, "one >> two");
todo_wine
{
ok( r == MSICONDITION_TRUE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "hithere");
MsiSetProperty(hpkg, "two", "hi");
r = MsiEvaluateCondition(hpkg, "one >> two");
todo_wine
{
ok( r == MSICONDITION_FALSE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "there");
MsiSetProperty(hpkg, "two", "hithere");
r = MsiEvaluateCondition(hpkg, "one >> two");
todo_wine
{
ok( r == MSICONDITION_FALSE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "there");
MsiSetProperty(hpkg, "two", "there");
r = MsiEvaluateCondition(hpkg, "one >> two");
todo_wine
{
ok( r == MSICONDITION_TRUE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "abcdhithere");
MsiSetProperty(hpkg, "two", "hi");
r = MsiEvaluateCondition(hpkg, "one >> two");
todo_wine
{
ok( r == MSICONDITION_FALSE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "");
MsiSetProperty(hpkg, "two", "there");
r = MsiEvaluateCondition(hpkg, "one >> two");
todo_wine
{
ok( r == MSICONDITION_FALSE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "there");
MsiSetProperty(hpkg, "two", "");
r = MsiEvaluateCondition(hpkg, "one >> two");
todo_wine
{
ok( r == MSICONDITION_TRUE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "");
MsiSetProperty(hpkg, "two", "");
r = MsiEvaluateCondition(hpkg, "one >> two");
todo_wine
{
ok( r == MSICONDITION_FALSE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "1234");
MsiSetProperty(hpkg, "two", "4");
r = MsiEvaluateCondition(hpkg, "one >> two");
todo_wine
{
ok( r == MSICONDITION_FALSE, "wrong return val\n");
}
MsiSetProperty(hpkg, "one", "one 1234");
MsiSetProperty(hpkg, "two", "4");
r = MsiEvaluateCondition(hpkg, "one >> two");
todo_wine
{
ok( r == MSICONDITION_TRUE, "wrong return val\n");
}
MsiCloseHandle( hpkg ); MsiCloseHandle( hpkg );
DeleteFile(msifile); DeleteFile(msifile);
} }