Fix QFile autotest not to require elevated privilege to pass
authorShane Kearns <ext-shane.2.kearns@nokia.com>
Wed, 1 Feb 2012 13:57:24 +0000 (13:57 +0000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 7 Feb 2012 19:03:43 +0000 (20:03 +0100)
commitdeea48ef6a545ba0c198efcc8db3c5ba7b0b432b
treed179e1bc29ccc3892b106398cc85cd8ac937827e
parent1de30075a2cb398df89806ed5655105c60a9f85c
Fix QFile autotest not to require elevated privilege to pass

The open test case tests opening a device path on windows.
As this requires privilege elevation, the test fails when running
nmake check from a console.
As the CI machines appear to run tests with admin privileges, first
check opening the device using the windows API. If that succeeds, then
opening using QFile should succeed. If that fails, the opening using
QFile should fail.
(Since Windows vista, members of the "administrators" group do not run
at elevated privilege all the time. The user needs to opt in via a
UAC prompt or "run as administrator". This is similar to using the
sudo command on unix)

Ran the test as administrator and normally. Now passes in both cases.

Change-Id: Ibd7682eceb61e35d4912fa0392df536f4331f6ed
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
tests/auto/corelib/io/qfile/tst_qfile.cpp