[POWRPROF_APITEST]

- Fix warnings - there is no DischargePolicy[4]
- Disable tests that fail on Windows 2003 (576 failures?!)
- Add missing file header

svn path=/trunk/; revision=56506
This commit is contained in:
Thomas Faber 2012-05-05 10:21:19 +00:00
parent 6443144a2b
commit 8faff057db

View file

@ -1,3 +1,12 @@
/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Tests for powrprof.dll
* PROGRAMMER: Alex Wurzinger
* Johannes Anderwald
* Martin Rottensteiner
*/
#include <stdarg.h> #include <stdarg.h>
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
@ -1200,7 +1209,6 @@ void test_ValidatePowerPolicies_Old(void)
gpp.user.DischargePolicy[1].Enable=FALSE; gpp.user.DischargePolicy[1].Enable=FALSE;
gpp.user.DischargePolicy[2].Enable=FALSE; gpp.user.DischargePolicy[2].Enable=FALSE;
gpp.user.DischargePolicy[3].Enable=FALSE; gpp.user.DischargePolicy[3].Enable=FALSE;
gpp.user.DischargePolicy[4].Enable=FALSE;
ret = ValidatePowerPolicies(&gpp,0); ret = ValidatePowerPolicies(&gpp,0);
ok(ret, "function was expected to succeed return %i\n",(UINT)GetLastError()); ok(ret, "function was expected to succeed return %i\n",(UINT)GetLastError());
if (!ret) if (!ret)
@ -1458,17 +1466,6 @@ void test_ValidatePowerPolicies(void)
gpp_compare.user.DischargePolicy[3].PowerPolicy.EventCode = 196608; gpp_compare.user.DischargePolicy[3].PowerPolicy.EventCode = 196608;
ok(globalcompare(gpp,gpp_compare),"Difference Found\n"); ok(globalcompare(gpp,gpp_compare),"Difference Found\n");
gpp_original.user.DischargePolicy[4].Enable=FALSE;
memcpy(&gpp, &gpp_original, sizeof(GLOBAL_POWER_POLICY));
memcpy(&gpp_compare, &gpp_original, sizeof(GLOBAL_POWER_POLICY));
ret = ValidatePowerPolicies(&gpp,0);
ok(ret, "function was expected to succeed return %i\n",(UINT)GetLastError());
gpp_compare.mach.BroadcastCapacityResolution=100;
gpp_compare.user.DischargePolicy[1].PowerPolicy.EventCode = 65536;
gpp_compare.user.DischargePolicy[2].PowerPolicy.EventCode = 131072;
gpp_compare.user.DischargePolicy[3].PowerPolicy.EventCode = 196608;
ok(globalcompare(gpp,gpp_compare),"Difference Found\n");
pp_original.user.Revision = 1; pp_original.user.Revision = 1;
memcpy(&pp, &pp_original, sizeof(POWER_POLICY)); memcpy(&pp, &pp_original, sizeof(POWER_POLICY));
memcpy(&pp_compare, &pp_original, sizeof(POWER_POLICY)); memcpy(&pp_compare, &pp_original, sizeof(POWER_POLICY));
@ -4862,6 +4859,9 @@ void test_WritePwrScheme(void)
void func_power(void) void func_power(void)
{ {
if (1)
skip("CallNtPowerInformation test is broken and fails on Windows\n");
else
test_CallNtPowerInformation(); test_CallNtPowerInformation();
test_CanUserWritePwrScheme(); test_CanUserWritePwrScheme();
test_EnumPwrSchemes(); test_EnumPwrSchemes();
@ -4881,8 +4881,13 @@ void func_power(void)
test_ReadGlobalPwrPolicy(); test_ReadGlobalPwrPolicy();
test_ReadProcessorPwrScheme(); test_ReadProcessorPwrScheme();
test_SetSuspendState(); test_SetSuspendState();
if (1)
skip("ValidatePowerPolicies tests are broken and fail on Windows\n");
else
{
test_ValidatePowerPolicies_Old(); test_ValidatePowerPolicies_Old();
test_ValidatePowerPolicies(); test_ValidatePowerPolicies();
}
test_WriteGlobalPwrPolicy(); test_WriteGlobalPwrPolicy();
test_WriteProcessorPwrScheme(); test_WriteProcessorPwrScheme();