Commit 37895faa authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: MsiViewGetError returns MSIDBERROR, not UINT.

parent 76275bea
...@@ -698,6 +698,7 @@ static void test_viewmodify(void) ...@@ -698,6 +698,7 @@ static void test_viewmodify(void)
{ {
MSIHANDLE hdb = 0, hview = 0, hrec = 0; MSIHANDLE hdb = 0, hview = 0, hrec = 0;
UINT r; UINT r;
MSIDBERROR err;
const char *query; const char *query;
char buffer[0x100]; char buffer[0x100];
DWORD sz; DWORD sz;
...@@ -717,8 +718,8 @@ static void test_viewmodify(void) ...@@ -717,8 +718,8 @@ static void test_viewmodify(void)
/* check what the error function reports without doing anything */ /* check what the error function reports without doing anything */
sz = 0; sz = 0;
/* passing NULL as the 3rd param make function to crash on older platforms */ /* passing NULL as the 3rd param make function to crash on older platforms */
r = MsiViewGetError( 0, NULL, &sz ); err = MsiViewGetError( 0, NULL, &sz );
ok(r == MSIDBERROR_INVALIDARG, "MsiViewGetError return\n"); ok(err == MSIDBERROR_INVALIDARG, "MsiViewGetError return\n");
/* open a view */ /* open a view */
query = "SELECT * FROM `phone`"; query = "SELECT * FROM `phone`";
...@@ -726,31 +727,31 @@ static void test_viewmodify(void) ...@@ -726,31 +727,31 @@ static void test_viewmodify(void)
ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
/* see what happens with a good hview and bad args */ /* see what happens with a good hview and bad args */
r = MsiViewGetError( hview, NULL, NULL ); err = MsiViewGetError( hview, NULL, NULL );
ok(r == MSIDBERROR_INVALIDARG || r == MSIDBERROR_NOERROR, ok(err == MSIDBERROR_INVALIDARG || err == MSIDBERROR_NOERROR,
"MsiViewGetError returns %u (expected -3)\n", r); "MsiViewGetError returns %u (expected -3)\n", err);
r = MsiViewGetError( hview, buffer, NULL ); err = MsiViewGetError( hview, buffer, NULL );
ok(r == MSIDBERROR_INVALIDARG, "MsiViewGetError return\n"); ok(err == MSIDBERROR_INVALIDARG, "MsiViewGetError return\n");
/* see what happens with a zero length buffer */ /* see what happens with a zero length buffer */
sz = 0; sz = 0;
buffer[0] = 'x'; buffer[0] = 'x';
r = MsiViewGetError( hview, buffer, &sz ); err = MsiViewGetError( hview, buffer, &sz );
ok(r == MSIDBERROR_MOREDATA, "MsiViewGetError return\n"); ok(err == MSIDBERROR_MOREDATA, "MsiViewGetError return\n");
ok(buffer[0] == 'x', "buffer cleared\n"); ok(buffer[0] == 'x', "buffer cleared\n");
ok(sz == 0, "size not zero\n"); ok(sz == 0, "size not zero\n");
/* ok this one is strange */ /* ok this one is strange */
sz = 0; sz = 0;
r = MsiViewGetError( hview, NULL, &sz ); err = MsiViewGetError( hview, NULL, &sz );
ok(r == MSIDBERROR_NOERROR, "MsiViewGetError return\n"); ok(err == MSIDBERROR_NOERROR, "MsiViewGetError return\n");
ok(sz == 0, "size not zero\n"); ok(sz == 0, "size not zero\n");
/* see if it really has an error */ /* see if it really has an error */
sz = sizeof buffer; sz = sizeof buffer;
buffer[0] = 'x'; buffer[0] = 'x';
r = MsiViewGetError( hview, buffer, &sz ); err = MsiViewGetError( hview, buffer, &sz );
ok(r == MSIDBERROR_NOERROR, "MsiViewGetError return\n"); ok(err == MSIDBERROR_NOERROR, "MsiViewGetError return\n");
ok(buffer[0] == 0, "buffer not cleared\n"); ok(buffer[0] == 0, "buffer not cleared\n");
ok(sz == 0, "size not zero\n"); ok(sz == 0, "size not zero\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment