Fixed warnings for comm tests.
This commit is contained in:
parent
66b8905ac6
commit
2436e41e63
@ -78,7 +78,7 @@ int TestCommConfig(int argc, char* argv[])
|
||||
|
||||
if (!hComm || (hComm == INVALID_HANDLE_VALUE))
|
||||
{
|
||||
fprintf(stderr, "CreateFileA failure: %s GetLastError() = 0x%0.8x\n", lpFileName, GetLastError());
|
||||
fprintf(stderr, "CreateFileA failure: %s GetLastError() = 0x%08x\n", lpFileName, GetLastError());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ int TestCommConfig(int argc, char* argv[])
|
||||
ZeroMemory(&commProp, sizeof(COMMPROP));
|
||||
if (!GetCommProperties(hComm, &commProp))
|
||||
{
|
||||
fprintf(stderr, "GetCommProperties failure: GetLastError(): 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "GetCommProperties failure: GetLastError(): 0x%08x\n", GetLastError());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ int TestControlSettings(int argc, char* argv[])
|
||||
dcb.DCBlength = sizeof(DCB);
|
||||
if (!GetCommState(hComm, &dcb))
|
||||
{
|
||||
fprintf(stderr, "GetCommState failure; GetLastError(): %0.8x\n", GetLastError());
|
||||
fprintf(stderr, "GetCommState failure; GetLastError(): %08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ int TestControlSettings(int argc, char* argv[])
|
||||
|
||||
if (!SetCommState(hComm, &dcb))
|
||||
{
|
||||
fprintf(stderr, "SetCommState failure; GetLastError(): %0.8x\n", GetLastError());
|
||||
fprintf(stderr, "SetCommState failure; GetLastError(): %08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ int TestControlSettings(int argc, char* argv[])
|
||||
dcb.DCBlength = sizeof(DCB);
|
||||
if (!GetCommState(hComm, &dcb))
|
||||
{
|
||||
fprintf(stderr, "GetCommState failure; GetLastError(): %0.8x\n", GetLastError());
|
||||
fprintf(stderr, "GetCommState failure; GetLastError(): %08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ int TestControlSettings(int argc, char* argv[])
|
||||
|
||||
if (!SetCommState(hComm, &dcb))
|
||||
{
|
||||
fprintf(stderr, "SetCommState failure; GetLastError(): %0.8x\n", GetLastError());
|
||||
fprintf(stderr, "SetCommState failure; GetLastError(): %08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ int TestControlSettings(int argc, char* argv[])
|
||||
dcb.DCBlength = sizeof(DCB);
|
||||
if (!GetCommState(hComm, &dcb))
|
||||
{
|
||||
fprintf(stderr, "GetCommState failure; GetLastError(): %0.8x\n", GetLastError());
|
||||
fprintf(stderr, "GetCommState failure; GetLastError(): %08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ int TestControlSettings(int argc, char* argv[])
|
||||
|
||||
if (!CloseHandle(hComm))
|
||||
{
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ int TestGetCommState(int argc, char* argv[])
|
||||
|
||||
if (!CloseHandle(hComm))
|
||||
{
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ int TestHandflow(int argc, char* argv[])
|
||||
|
||||
if (!CloseHandle(hComm))
|
||||
{
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ static BOOL test_SerCxSys(HANDLE hComm)
|
||||
dcb.DCBlength = sizeof(DCB);
|
||||
if (!GetCommState(hComm, &dcb))
|
||||
{
|
||||
fprintf(stderr, "GetCommState failure, GetLastError(): 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "GetCommState failure, GetLastError(): 0x%08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ static BOOL test_SerCxSys(HANDLE hComm)
|
||||
dcb.XoffChar = XonChar;
|
||||
if (!SetCommState(hComm, &dcb))
|
||||
{
|
||||
fprintf(stderr, "SetCommState failure, GetLastError(): 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "SetCommState failure, GetLastError(): 0x%08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ static BOOL test_SerCxSys(HANDLE hComm)
|
||||
dcb.DCBlength = sizeof(DCB);
|
||||
if (!GetCommState(hComm, &dcb))
|
||||
{
|
||||
fprintf(stderr, "GetCommState failure, GetLastError(): 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "GetCommState failure, GetLastError(): 0x%08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ static BOOL test_SerCx2Sys(HANDLE hComm)
|
||||
dcb.DCBlength = sizeof(DCB);
|
||||
if (!GetCommState(hComm, &dcb))
|
||||
{
|
||||
fprintf(stderr, "GetCommState failure; GetLastError(): %0.8x\n", GetLastError());
|
||||
fprintf(stderr, "GetCommState failure; GetLastError(): %08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ int TestSerialChars(int argc, char* argv[])
|
||||
|
||||
if (!CloseHandle(hComm))
|
||||
{
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ static BOOL test_SerialSys(HANDLE hComm)
|
||||
result = SetCommState(hComm, &dcb);
|
||||
if (!result)
|
||||
{
|
||||
fprintf(stderr, "SetCommState failure: 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "SetCommState failure: 0x%08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ static BOOL test_SerCxSys(HANDLE hComm)
|
||||
result = SetCommState(hComm, &dcb);
|
||||
if (!result)
|
||||
{
|
||||
fprintf(stderr, "SetCommState failure: 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "SetCommState failure: 0x%08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -284,7 +284,7 @@ static BOOL test_generic(HANDLE hComm)
|
||||
result = SetCommState(hComm, &dcb);
|
||||
if (!result)
|
||||
{
|
||||
fprintf(stderr, "SetCommState failure: 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "SetCommState failure: 0x%08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -389,7 +389,7 @@ int TestSetCommState(int argc, char* argv[])
|
||||
|
||||
if (!CloseHandle(hComm))
|
||||
{
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -41,14 +41,14 @@ static BOOL test_generic(HANDLE hComm)
|
||||
|
||||
if (!SetCommTimeouts(hComm, &timeouts))
|
||||
{
|
||||
fprintf(stderr, "SetCommTimeouts failure, GetLastError: 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "SetCommTimeouts failure, GetLastError: 0x%08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ZeroMemory(&timeouts2, sizeof(COMMTIMEOUTS));
|
||||
if (!GetCommTimeouts(hComm, &timeouts2))
|
||||
{
|
||||
fprintf(stderr, "GetCommTimeouts failure, GetLastError: 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "GetCommTimeouts failure, GetLastError: 0x%08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -63,13 +63,13 @@ static BOOL test_generic(HANDLE hComm)
|
||||
timeouts.ReadTotalTimeoutConstant = MAXULONG;
|
||||
if (SetCommTimeouts(hComm, &timeouts))
|
||||
{
|
||||
fprintf(stderr, "SetCommTimeouts succeeded with ReadIntervalTimeout and ReadTotalTimeoutConstant set to MAXULONG. GetLastError: 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "SetCommTimeouts succeeded with ReadIntervalTimeout and ReadTotalTimeoutConstant set to MAXULONG. GetLastError: 0x%08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (GetLastError() != ERROR_INVALID_PARAMETER)
|
||||
{
|
||||
fprintf(stderr, "SetCommTimeouts failure, expected GetLastError to return ERROR_INVALID_PARAMETER and got: 0x%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "SetCommTimeouts failure, expected GetLastError to return ERROR_INVALID_PARAMETER and got: 0x%08x\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ int TestTimeouts(int argc, char* argv[])
|
||||
|
||||
if (!CloseHandle(hComm))
|
||||
{
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%0.8x\n", GetLastError());
|
||||
fprintf(stderr, "CloseHandle failure, GetLastError()=%08x\n", GetLastError());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user