mirror of
https://github.com/acpica/acpica/
synced 2025-03-02 20:31:28 +03:00
Tests: Continue port of AAPITS to current ACPICA.
Some run-time changes for correct execution.
This commit is contained in:
parent
80d7951177
commit
4e813e709c
tests/aapits
@ -364,18 +364,18 @@ AtBuildLocalFADT1 (
|
||||
LocalFADT->Gpe1Base = 96;
|
||||
|
||||
LocalFADT->Pm1EventLength = 4;
|
||||
LocalFADT->Pm1ControlLength = 4;
|
||||
LocalFADT->Pm1ControlLength = 2;
|
||||
LocalFADT->Pm2ControlLength = 1; /* optional */
|
||||
LocalFADT->PmTimerLength = 8;
|
||||
LocalFADT->PmTimerLength = 4;
|
||||
|
||||
LocalFADT->Gpe0Block = 0x12340000;
|
||||
LocalFADT->Gpe1Block = 0x56780000;
|
||||
LocalFADT->Gpe0Block = 0x00001234;
|
||||
LocalFADT->Gpe1Block = 0x00005678;
|
||||
|
||||
LocalFADT->Pm1aEventBlock = 0x1aaa0000;
|
||||
LocalFADT->Pm1aEventBlock = 0x00001aaa;
|
||||
LocalFADT->Pm1bEventBlock = 0;
|
||||
LocalFADT->PmTimerBlock = 0xA0;
|
||||
LocalFADT->Pm1aControlBlock = 0xB0;
|
||||
LocalFADT->Pm2ControlBlock = 0xD0; /* optional */
|
||||
LocalFADT->PmTimerBlock = 0xA00;
|
||||
LocalFADT->Pm1aControlBlock = 0xB00;
|
||||
LocalFADT->Pm2ControlBlock = 0xD00; /* optional */
|
||||
|
||||
if (BldTask.ErrScale & BAD_LENGTH_HDR_FADT)
|
||||
{
|
||||
|
@ -183,45 +183,13 @@ static char TestName[33];
|
||||
|
||||
extern FILE *AcpiGbl_OutputFile;
|
||||
|
||||
int ACPI_SYSTEM_XFACE
|
||||
main(
|
||||
int argc,
|
||||
char **argv)
|
||||
int
|
||||
ExecuteTest (
|
||||
UINT32 test_case,
|
||||
UINT32 test_num)
|
||||
{
|
||||
long test_case = -1;
|
||||
long test_num = -1;
|
||||
int status;
|
||||
|
||||
signal (SIGINT, AtSigHandler);
|
||||
signal (SIGILL, AtSigHandler);
|
||||
signal (SIGFPE, AtSigHandler);
|
||||
// signal (SIGSEGV, AtSigHandler);
|
||||
#ifdef Linux
|
||||
signal (SIGALRM, AtSigHandler);
|
||||
(void) alarm(AT_ALARM_PERIOD);
|
||||
#endif
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
printf ("ACPICA API TS: <test case: 1 - 9 > <test number>"
|
||||
" should be specified\n");
|
||||
return AtRetBadParam;
|
||||
}
|
||||
|
||||
test_case = strtoul (argv[1], NULL, 0);
|
||||
if (test_case < 1 || test_case > AT_TEST_CASE_NUM)
|
||||
{
|
||||
printf ("ACPICA API TS err: test case %ld is out of range 1 - %d\n",
|
||||
test_case, AT_TEST_CASE_NUM);
|
||||
return AtRetBadParam;
|
||||
}
|
||||
|
||||
test_num = strtoul (argv[2], NULL, 0);
|
||||
if (test_num < 0 || test_num > (long)AtTestCase[test_case].TestsNum)
|
||||
{
|
||||
printf ("ACPICA API TS err: test num %ld is out of range 0 - %d\n",
|
||||
test_num, AtTestCase[test_case].TestsNum);
|
||||
return AtRetBadParam;
|
||||
}
|
||||
|
||||
AapiTestMode = AT_EMULATION_MODE;
|
||||
AapiErrors = 0;
|
||||
@ -232,11 +200,6 @@ main(
|
||||
AtAMLcodeFileDir = NULL;
|
||||
NullBldTask = ZeroBldTask;
|
||||
|
||||
if (argc > 3)
|
||||
{
|
||||
AtAMLcodeFileDir = argv[3];
|
||||
}
|
||||
|
||||
OsxfCtrlInit();
|
||||
|
||||
if (!AtTestCase[test_case].Tests[test_num])
|
||||
@ -282,31 +245,98 @@ main(
|
||||
printf ("both FAIL and TEST FAULT,"
|
||||
" %d API errors, %d TEST errors\n",
|
||||
AapiErrors, TestErrors);
|
||||
status = AtRetApiErr;
|
||||
}
|
||||
else if (AapiErrors)
|
||||
{
|
||||
printf ("FAIL, %d API errors\n", AapiErrors);
|
||||
return AtRetApiErr;
|
||||
status = AtRetApiErr;
|
||||
}
|
||||
else if (TestErrors)
|
||||
{
|
||||
printf ("TEST FAULT, %d TEST errors\n", TestErrors);
|
||||
return AtRetTestErr;
|
||||
status = AtRetTestErr;
|
||||
}
|
||||
else if (TestPass && TestSkipped)
|
||||
{
|
||||
printf ("PASS, Pass/Skip counters %d/%d\n",
|
||||
TestPass, TestSkipped);
|
||||
status = AtRetPass;
|
||||
}
|
||||
else if (TestSkipped)
|
||||
{
|
||||
printf ("SKIP, counter %d\n", TestSkipped);
|
||||
return AtRetSkip;
|
||||
status = AtRetSkip;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("PASS\n");
|
||||
status = AtRetPass;
|
||||
}
|
||||
|
||||
return AtRetPass;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
int ACPI_SYSTEM_XFACE
|
||||
main(
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
UINT32 test_case;
|
||||
UINT32 test_num;
|
||||
UINT32 i;
|
||||
UINT32 j;
|
||||
|
||||
|
||||
signal (SIGINT, AtSigHandler);
|
||||
signal (SIGILL, AtSigHandler);
|
||||
signal (SIGFPE, AtSigHandler);
|
||||
// signal (SIGSEGV, AtSigHandler);
|
||||
#ifdef Linux
|
||||
signal (SIGALRM, AtSigHandler);
|
||||
(void) alarm(AT_ALARM_PERIOD);
|
||||
#endif
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
/*
|
||||
printf ("ACPICA API TS: <test case: 1 - 9 > <test number>"
|
||||
" should be specified\n");
|
||||
return AtRetBadParam;
|
||||
*/
|
||||
for (i = 7; i < 8 /*AT_TEST_CASE_NUM */; i++)
|
||||
{
|
||||
for (j = 0; j < 3 /* AtTestCase[i].TestsNum */; j++)
|
||||
{
|
||||
ExecuteTest (7, 0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
test_case = strtoul (argv[1], NULL, 0);
|
||||
if (test_case < 1 || test_case > AT_TEST_CASE_NUM)
|
||||
{
|
||||
printf ("ACPICA API TS err: test case %ld is out of range 1 - %d\n",
|
||||
test_case, AT_TEST_CASE_NUM);
|
||||
return AtRetBadParam;
|
||||
}
|
||||
|
||||
test_num = strtoul (argv[2], NULL, 0);
|
||||
if (test_num < 0 || test_num > AtTestCase[test_case].TestsNum)
|
||||
{
|
||||
printf ("ACPICA API TS err: test num %ld is out of range 0 - %d\n",
|
||||
test_num, AtTestCase[test_case].TestsNum);
|
||||
return AtRetBadParam;
|
||||
}
|
||||
|
||||
if (argc > 3)
|
||||
{
|
||||
AtAMLcodeFileDir = argv[3];
|
||||
}
|
||||
|
||||
ExecuteTest (test_case, test_num);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
@ -817,12 +817,12 @@ OsxfCtrlRegService(UINT32 ServiceFlag)
|
||||
}
|
||||
#if ACPI_MACHINE_WIDTH == 64
|
||||
#ifdef _MSC_VER
|
||||
printf("%d (%s Address 0x%I64x: Width 0x%x) r/w %d/%d\n",
|
||||
printf("%.2u (%s Address 0x%I64x: Width %.2u) r/w counts: %u/%u\n",
|
||||
#else
|
||||
printf("%d (%s Address 0x%llx: Width 0x%x) r/w %d/%d\n",
|
||||
printf("%.2u (%s Address 0x%llx: Width %.2u) r/w counts: %u/%u\n",
|
||||
#endif
|
||||
#else
|
||||
printf("%d (%s Address 0x%x: Width 0x%x) r/w %d/%d\n",
|
||||
printf("%.2u (%s Address 0x%.4x: Width %.2u) r/w counts: %u/%u\n",
|
||||
#endif
|
||||
i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO",
|
||||
Reg->Address, Reg->Width, Reg->ReadCount, Reg->WriteCount);
|
||||
|
@ -32,7 +32,7 @@ AcpiOsInitialize (void)
|
||||
}
|
||||
if (Calls)
|
||||
{
|
||||
printf("AcpiOsInitialize: there were %d OSL interfaces calls"
|
||||
printf("AcpiOsInitialize: there were %u OSL interfaces calls"
|
||||
" done ahead of OsInitialize\n", (UINT32)Calls);
|
||||
return AE_ERROR;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user