remove trailing whitespace at end of lines

svn path=/trunk/; revision=15091
This commit is contained in:
Steven Edwards
2005-05-07 21:24:31 +00:00
parent 1c29a40c45
commit 456be5d16b
385 changed files with 5481 additions and 5481 deletions

View File

@@ -24,34 +24,34 @@ VOID RunTests(VOID)
{
int i, nTests;
static HANDLE hEvent;
hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if(hEvent == NULL)
{
_tprintf(_T("Unable to create event!"));
return;
}
nTests = sizeof(Tests) / sizeof(TEST);
for(i = 0; i < nTests; i++)
{
Tests[i].id = i + 1;
if(Tests[i].Routine == NULL)
{
continue;
}
_tprintf(_T("+++ TEST %d: %s\n"), Tests[i].id, Tests[i].description);
Tests[i].Routine(&Tests[i], hEvent);
WaitForSingleObject(hEvent, INFINITE);
_tprintf(_T("\n\n"));
}
CloseHandle(hEvent);
}
@@ -59,9 +59,9 @@ VOID PrintTestResults(VOID)
{
int i, nTests, nsuccess = 0, nfailed = 0;
TCHAR *status;
nTests = sizeof(Tests) / sizeof(TEST);
for(i = 0; i < nTests; i++)
{
if(Tests[i].Routine == NULL)
@@ -78,10 +78,10 @@ VOID PrintTestResults(VOID)
status = _T("FAILED ");
nfailed++;
}
_tprintf(_T("Test %d: %s %s\n"), i, status, Tests[i].description);
}
_tprintf(_T("\nTests succeeded: %d, failed: %d\n"), nsuccess, nfailed);
if(nfailed == 0)
{
@@ -106,7 +106,7 @@ typedef struct _TESTINFO
} Test1;
struct
{
HANDLE hWaitEvent;
HANDLE hWaitEvent;
} Test2;
struct
{
@@ -119,13 +119,13 @@ typedef struct _TESTINFO
VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
{
PTESTINFO Info = (PTESTINFO)Param;
_tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
if(Info->secsleft == 0)
{
BOOL stat;
_tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Info->Test->id);
stat = DeleteTimerQueueTimer(NULL, Info->hTimer, NULL);
if(stat)
@@ -133,7 +133,7 @@ VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
else
{
int error = GetLastError();
switch(error)
{
case ERROR_IO_PENDING:
@@ -146,7 +146,7 @@ VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
break;
}
}
/* set the event to continue tests */
SetEvent(Info->hEvent);
}
@@ -155,11 +155,11 @@ VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
VOID Test1(PTEST Test, HANDLE hEvent)
{
static TESTINFO Info;
Info.Test = Test;
Info.hEvent = hEvent;
Info.secsleft = N_TIMEOUT;
if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback1, &Info, 1000, 1000, 0))
{
_tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
@@ -167,7 +167,7 @@ VOID Test1(PTEST Test, HANDLE hEvent)
SetEvent(hEvent);
return;
}
_tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Info.Test->id, (int)Info.hTimer, (int)Info.secsleft);
}
@@ -176,16 +176,16 @@ VOID Test1(PTEST Test, HANDLE hEvent)
VOID CALLBACK TimerCallback2(PVOID Param, BOOLEAN Fired)
{
PTESTINFO Info = (PTESTINFO)Param;
_tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
if(Info->secsleft == 0)
{
/* set the event to continue tests */
SetEvent(Info->Test2.hWaitEvent);
/* sleep a bit */
Sleep(1500);
Sleep(1500);
}
}
@@ -193,32 +193,32 @@ VOID Test2(PTEST Test, HANDLE hEvent)
{
static TESTINFO Info;
BOOL stat;
Info.Test = Test;
Info.hEvent = hEvent;
Info.secsleft = N_TIMEOUT;
Info.Test2.hWaitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if(Info.Test2.hWaitEvent == NULL)
{
_tprintf(_T("[%d]Unable to create event!\n"), (int)Info.Test->id);
return;
}
if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback2, &Info, 1000, 1000, 0))
{
_tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
CloseHandle(Info.Test2.hWaitEvent);
/* we failed, set the event to continue tests */
SetEvent(hEvent);
return;
}
_tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Test->id, (int)Info.hTimer, (int)Info.secsleft);
WaitForSingleObject(Info.Test2.hWaitEvent, INFINITE);
_tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Test->id);
stat = DeleteTimerQueueTimer(NULL, Info.hTimer, INVALID_HANDLE_VALUE);
if(stat)
@@ -230,7 +230,7 @@ VOID Test2(PTEST Test, HANDLE hEvent)
else
{
int error = GetLastError();
switch(error)
{
case ERROR_IO_PENDING:
@@ -241,7 +241,7 @@ VOID Test2(PTEST Test, HANDLE hEvent)
break;
}
}
SetEvent(Info.hEvent);
}
@@ -250,16 +250,16 @@ VOID Test2(PTEST Test, HANDLE hEvent)
VOID CALLBACK TimerCallback3(PVOID Param, BOOLEAN Fired)
{
PTESTINFO Info = (PTESTINFO)Param;
_tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
if(Info->secsleft == 0)
{
/* set the event to continue tests */
SetEvent(Info->Test3.hWaitEvent);
/* sleep a bit */
Sleep(1500);
Sleep(1500);
}
}
@@ -267,40 +267,40 @@ VOID Test3(PTEST Test, HANDLE hEvent)
{
static TESTINFO Info;
BOOL stat;
Info.Test = Test;
Info.hEvent = hEvent;
Info.secsleft = N_TIMEOUT;
Info.Test3.hWaitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if(Info.Test3.hWaitEvent == NULL)
{
_tprintf(_T("[%d]Unable to create event!\n"), (int)Info.Test->id);
return;
}
Info.Test3.hNotification = CreateEvent(NULL, FALSE, FALSE, NULL);
if(Info.Test3.hNotification == NULL)
{
_tprintf(_T("[%d]Unable to create notification event!\n"), (int)Info.Test->id);
return;
}
if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback3, &Info, 1000, 1000, 0))
{
_tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
CloseHandle(Info.Test3.hWaitEvent);
CloseHandle(Info.Test3.hNotification);
/* we failed, set the event to continue tests */
SetEvent(hEvent);
return;
}
_tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Test->id, (int)Info.hTimer, (int)Info.secsleft);
WaitForSingleObject(Info.Test3.hWaitEvent, INFINITE);
_tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Test->id);
stat = DeleteTimerQueueTimer(NULL, Info.hTimer, Info.Test3.hNotification);
if(stat)
@@ -310,7 +310,7 @@ VOID Test3(PTEST Test, HANDLE hEvent)
else
{
int error = GetLastError();
switch(error)
{
case ERROR_IO_PENDING:
@@ -323,12 +323,12 @@ VOID Test3(PTEST Test, HANDLE hEvent)
break;
}
}
WaitForSingleObject(Info.Test3.hNotification, INFINITE);
CloseHandle(Info.Test3.hWaitEvent);
CloseHandle(Info.Test3.hNotification);
SetEvent(Info.hEvent);
}
@@ -338,13 +338,13 @@ VOID
InitTests(VOID)
{
ZeroMemory(Tests, sizeof(Tests));
Tests[0].description = _T("non-blocking DeleteTimerQueueTimer() call from callback");
Tests[0].Routine = Test1;
Tests[1].description = _T("blocking DeleteTimerQueueTimer() call");
Tests[1].Routine = Test2;
Tests[2].description = _T("blocking DeleteTimerQueueTimer() call with specified event");
Tests[2].Routine = Test3;
}
@@ -352,14 +352,14 @@ InitTests(VOID)
int main(int argc, char* argv[])
{
_tprintf(_T("+++ TimerQueue test running +++\n\n"));
InitTests();
RunTests();
RunTests();
_tprintf(_T("\n+++ RESULTS +++\n"));
PrintTestResults();
return 0;
}