shell32/tests: Skip SHFileOperationW tests if the user doesn't have admin rights.

Hans Leidekker hans at codeweavers.com
Mon Dec 19 05:48:40 CST 2016


On Mon, 2016-12-19 at 14:38 +0300, Nikolay Sivov wrote:
> > diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c
> > index 0e502fc..776da98 100644
> > --- a/dlls/shell32/tests/shlfileop.c
> > +++ b/dlls/shell32/tests/shlfileop.c
> > @@ -819,7 +819,7 @@ static void test_rename(void)
> >         retval == DE_DIFFDIR || /* Vista */
> >         broken(retval == DE_OPCANCELLED) || /* Win9x */
> >         broken(retval == 65652), /* NT4 */
> > -       "Expected ERROR_CANCELLED or DE_DIFFDIR\n");
> > +       "Expected ERROR_CANCELLED or DE_DIFFDIR, got %u\n", retval);
> >      ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
> >  
> >      /* pFrom is empty */
> > @@ -2516,6 +2516,11 @@ static void test_unicode(void)
> >          skip("Unicode tests skipped on non-unicode system\n");
> >          return;
> >      }
> > +    if (GetLastError()==ERROR_ACCESS_DENIED)
> > +    {
> > +        skip("test needs admin rights\n");
> > +        return;
> > +    }
> >      CloseHandle(file);
> >  
> >      /* Try to delete a file with unicode filename */
> > @@ -2574,6 +2579,7 @@ static void test_unicode(void)
> >      ok(GetLastError() == ERROR_SUCCESS ||
> >         broken(GetLastError() == ERROR_INVALID_HANDLE), /* WinXp, win2k3 */
> >         "Expected ERROR_SUCCESS, got %d\n", GetLastError());
> > +    DeleteFileW(UNICODE_PATH_TO);
> >  
> >      /* Check last error after a failed file operation. */
> >      DeleteFileW(UNICODE_PATH);
> Will it work if user temp directory was used instead of current
> directory or C: root?

Yes, running it from a temporary directory instead of c: makes the
failure go away.





More information about the wine-devel mailing list