mirror of https://github.com/FreeRDP/FreeRDP
WINPR_UNUSED argc, argv for unit tests
This commit is contained in:
parent
f515bd4560
commit
5eea7fc12d
|
@ -67,6 +67,10 @@ static BOOL test_add16s_speed(void)
|
|||
|
||||
int TestPrimitivesAdd(int argc, char* argv[])
|
||||
{
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
prim_test_setup(FALSE);
|
||||
if (!test_add16s_func())
|
||||
return -1;
|
||||
|
|
|
@ -860,6 +860,8 @@ int TestPrimitivesYUV(int argc, char* argv[])
|
|||
BOOL large = (argc > 1);
|
||||
UINT32 x;
|
||||
int rc = -1;
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
prim_test_setup(FALSE);
|
||||
primitives_t* prims = primitives_get();
|
||||
|
||||
|
|
|
@ -89,6 +89,9 @@ int TestRingBuffer(int argc, char* argv[])
|
|||
int i /*, chunkNb, counter*/;
|
||||
DataChunk chunks[2];
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
if (!ringbuffer_init(&ringBuffer, 10))
|
||||
{
|
||||
fprintf(stderr, "unable to initialize ringbuffer\n");
|
||||
|
|
|
@ -58,6 +58,9 @@ int main(int argc, char** argv)
|
|||
XPixmapFormatValues* pf;
|
||||
XPixmapFormatValues* pfs;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
display = XOpenDisplay(NULL);
|
||||
|
||||
if (!display)
|
||||
|
|
|
@ -12,6 +12,9 @@ int TestClipboardFormats(int argc, char* argv[])
|
|||
wClipboard* clipboard;
|
||||
UINT32 utf8StringFormatId;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
clipboard = ClipboardCreate();
|
||||
if (!clipboard)
|
||||
return -1;
|
||||
|
|
|
@ -12,12 +12,13 @@ int TestCredUICmdLinePromptForCredentials(int argc, char* argv[])
|
|||
BOOL fSave;
|
||||
DWORD status;
|
||||
DWORD dwFlags;
|
||||
TCHAR UserName[CREDUI_MAX_USERNAME_LENGTH];
|
||||
TCHAR Password[CREDUI_MAX_PASSWORD_LENGTH];
|
||||
TCHAR UserName[CREDUI_MAX_USERNAME_LENGTH] = { 0 };
|
||||
TCHAR Password[CREDUI_MAX_PASSWORD_LENGTH] = { 0 };
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
fSave = FALSE;
|
||||
ZeroMemory(UserName, sizeof(UserName));
|
||||
ZeroMemory(Password, sizeof(Password));
|
||||
dwFlags = CREDUI_FLAGS_DO_NOT_PERSIST | CREDUI_FLAGS_EXCLUDE_CERTIFICATES;
|
||||
|
||||
status = CredUICmdLinePromptForCredentials(testTargetName, NULL, 0, UserName,
|
||||
|
|
|
@ -11,14 +11,14 @@ static const TCHAR testUserName2[] = _T("JohnDoe@LAB1");
|
|||
int TestCredUIParseUserName(int argc, char* argv[])
|
||||
{
|
||||
DWORD status;
|
||||
TCHAR User[CREDUI_MAX_USERNAME_LENGTH + 1];
|
||||
TCHAR Domain[CREDUI_MAX_DOMAIN_TARGET_LENGTH + 1];
|
||||
TCHAR User[CREDUI_MAX_USERNAME_LENGTH + 1] = { 0 };
|
||||
TCHAR Domain[CREDUI_MAX_DOMAIN_TARGET_LENGTH + 1] = { 0 };
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/* Test LAB1\JohnDoe */
|
||||
|
||||
ZeroMemory(User, sizeof(User));
|
||||
ZeroMemory(Domain, sizeof(Domain));
|
||||
|
||||
status = CredUIParseUserName(testUserName1, User, sizeof(User) / sizeof(TCHAR), Domain,
|
||||
sizeof(Domain) / sizeof(TCHAR));
|
||||
|
||||
|
|
|
@ -15,12 +15,13 @@ int TestCredUIPromptForCredentials(int argc, char* argv[])
|
|||
BOOL fSave;
|
||||
DWORD status;
|
||||
DWORD dwFlags;
|
||||
TCHAR UserName[CREDUI_MAX_USERNAME_LENGTH];
|
||||
TCHAR Password[CREDUI_MAX_PASSWORD_LENGTH];
|
||||
TCHAR UserName[CREDUI_MAX_USERNAME_LENGTH] = { 0 };
|
||||
TCHAR Password[CREDUI_MAX_PASSWORD_LENGTH] = { 0 };
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
fSave = FALSE;
|
||||
ZeroMemory(UserName, sizeof(UserName));
|
||||
ZeroMemory(Password, sizeof(Password));
|
||||
dwFlags = CREDUI_FLAGS_DO_NOT_PERSIST | CREDUI_FLAGS_EXCLUDE_CERTIFICATES;
|
||||
|
||||
status = CredUIPromptForCredentials(&testUiInfo, testTargetName, NULL, 0, UserName,
|
||||
|
|
|
@ -9,6 +9,9 @@ int TestAlignment(int argc, char* argv[])
|
|||
size_t alignment;
|
||||
size_t offset;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/* Alignment should be 2^N where N is a positive integer */
|
||||
|
||||
alignment = 16;
|
||||
|
|
|
@ -8,6 +8,9 @@ int TestFormatSpecifiers(int argc, char* argv[])
|
|||
|
||||
char fmt[4096];
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/* size_t */
|
||||
{
|
||||
size_t arg = 0xabcd;
|
||||
|
|
|
@ -34,6 +34,9 @@ int TestString(int argc, char* argv[])
|
|||
size_t length;
|
||||
WCHAR* context;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
#ifdef __BIG_ENDIAN__
|
||||
/* Be sure that we always use LE encoded string */
|
||||
ByteSwapUnicode(testStringW, testStringW_Length);
|
||||
|
|
|
@ -55,6 +55,9 @@ int TestTypes(int argc, char* argv[])
|
|||
{
|
||||
int status = 0;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
TEST_SIZEOF_TYPE(INT8)
|
||||
TEST_SIZEOF_TYPE(UINT8)
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ int TestCryptoCertEnumCertificatesInStore(int argc, char* argv[])
|
|||
HCERTSTORE hCertStore = NULL;
|
||||
PCCERT_CONTEXT pCertContext = NULL;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/**
|
||||
* System Store Locations:
|
||||
* http://msdn.microsoft.com/en-us/library/windows/desktop/aa388136/
|
||||
|
|
|
@ -219,6 +219,10 @@ static BOOL test_crypto_cipher_key()
|
|||
|
||||
int TestCryptoCipher(int argc, char* argv[])
|
||||
{
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT);
|
||||
|
||||
if (!test_crypto_cipher_aes_128_cbc())
|
||||
|
|
|
@ -6,9 +6,10 @@
|
|||
int TestCryptoRand(int argc, char* argv[])
|
||||
{
|
||||
char* str;
|
||||
BYTE rnd[16];
|
||||
BYTE rnd[16] = { 0 };
|
||||
|
||||
ZeroMemory(rnd, sizeof(rnd));
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
winpr_RAND(rnd, sizeof(rnd));
|
||||
|
||||
|
|
|
@ -16,6 +16,10 @@ int TestDsMakeSpn(int argc, char* argv[])
|
|||
DWORD status;
|
||||
DWORD SpnLength;
|
||||
SpnLength = -1;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
status = DsMakeSpn(testServiceClass, testServiceName, NULL, 0, NULL, &SpnLength, NULL);
|
||||
|
||||
if (status != ERROR_INVALID_PARAMETER)
|
||||
|
|
|
@ -13,6 +13,10 @@ int TestEnvironmentGetSetEB(int argc, char* argv[])
|
|||
DWORD length;
|
||||
LPTCH lpszEnvironmentBlock = "SHELL=123\0test=1\0test1=2\0DISPLAY=WINPR_TEST_VALUE\0\0";
|
||||
LPTCH lpszEnvironmentBlockNew = NULL;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
rc = -1;
|
||||
/* Get length of an variable */
|
||||
length = GetEnvironmentVariableEBA(lpszEnvironmentBlock, "DISPLAY", NULL, 0);
|
||||
|
|
|
@ -12,6 +12,10 @@ int TestEnvironmentMergeEnvironmentStrings(int argc, char* argv[])
|
|||
LPTCH lpszEnvironmentBlock;
|
||||
LPTCH lpsz2Merge = "SHELL=123\0test=1\0test1=2\0DISPLAY=:77\0\0";
|
||||
LPTCH lpszMergedEnvironmentBlock;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
lpszEnvironmentBlock = GetEnvironmentStrings();
|
||||
lpszMergedEnvironmentBlock = MergeEnvironmentStrings(lpszEnvironmentBlock, lpsz2Merge);
|
||||
p = (TCHAR*)lpszMergedEnvironmentBlock;
|
||||
|
|
|
@ -13,6 +13,10 @@ int TestEnvironmentSetEnvironmentVariable(int argc, char* argv[])
|
|||
DWORD nSize;
|
||||
LPSTR lpBuffer = NULL;
|
||||
DWORD error = 0;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
SetEnvironmentVariableA(TEST_NAME, TEST_VALUE);
|
||||
nSize = GetEnvironmentVariableA(TEST_NAME, NULL, 0);
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ int TestFileCreateFile(int argc, char* argv[])
|
|||
LPSTR name;
|
||||
int rc = 0;
|
||||
SYSTEMTIME systemTime;
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
GetSystemTime(&systemTime);
|
||||
sprintf_s(sname, sizeof(sname),
|
||||
"CreateFile-%04" PRIu16 "%02" PRIu16 "%02" PRIu16 "%02" PRIu16 "%02" PRIu16
|
||||
|
|
|
@ -16,6 +16,8 @@ int TestFileFindFirstFile(int argc, char* argv[])
|
|||
LPTSTR BasePath;
|
||||
WIN32_FIND_DATA FindData;
|
||||
TCHAR FilePath[PATHCCH_MAX_CCH];
|
||||
WINPR_UNUSED(argc);
|
||||
|
||||
str = argv[1];
|
||||
#ifdef UNICODE
|
||||
length = MultiByteToWideChar(CP_UTF8, 0, str, strlen(str), NULL, 0);
|
||||
|
|
|
@ -18,6 +18,7 @@ int TestFileFindNextFile(int argc, char* argv[])
|
|||
LPTSTR BasePath;
|
||||
WIN32_FIND_DATA FindData;
|
||||
TCHAR FilePath[PATHCCH_MAX_CCH];
|
||||
WINPR_UNUSED(argc);
|
||||
str = argv[1];
|
||||
#ifdef UNICODE
|
||||
length = MultiByteToWideChar(CP_UTF8, 0, str, strlen(str), NULL, 0);
|
||||
|
|
|
@ -29,7 +29,8 @@ int TestFileGetStdHandle(int argc, char* argv[])
|
|||
HANDLE so;
|
||||
const char buf[] = "happy happy";
|
||||
DWORD bytesWritten;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
so = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (so == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
int TestFilePatternMatch(int argc, char* argv[])
|
||||
{
|
||||
/* '*' expression */
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
if (!FilePatternMatchA("document.txt", "*"))
|
||||
{
|
||||
printf("FilePatternMatchA error: FileName: %s Pattern: %s\n", "document.txt", "*");
|
||||
|
|
|
@ -12,7 +12,8 @@ int TestInterlockedAccess(int argc, char* argv[])
|
|||
LONG* Destination;
|
||||
LONGLONG oldValue64;
|
||||
LONGLONG* Destination64;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
/* InterlockedIncrement */
|
||||
|
||||
Addend = _aligned_malloc(sizeof(LONG), sizeof(LONG));
|
||||
|
|
|
@ -16,7 +16,8 @@ int TestInterlockedDList(int argc, char* argv[])
|
|||
PLIST_ITEM pListItem;
|
||||
WINPR_PLIST_ENTRY pListHead;
|
||||
WINPR_PLIST_ENTRY pListEntry;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
pListHead =
|
||||
(WINPR_PLIST_ENTRY)_aligned_malloc(sizeof(WINPR_LIST_ENTRY), MEMORY_ALLOCATION_ALIGNMENT);
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@ int TestInterlockedSList(int argc, char* argv[])
|
|||
ULONG Count;
|
||||
WINPR_PSLIST_ENTRY pFirstEntry;
|
||||
WINPR_PSLIST_HEADER pListHead;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
/* Initialize the list header to a MEMORY_ALLOCATION_ALIGNMENT boundary. */
|
||||
pListHead = (WINPR_PSLIST_HEADER)_aligned_malloc(sizeof(WINPR_SLIST_HEADER),
|
||||
MEMORY_ALLOCATION_ALIGNMENT);
|
||||
|
|
|
@ -12,6 +12,9 @@ int TestIoDevice(int argc, char* argv[])
|
|||
UNICODE_STRING uString;
|
||||
PDEVICE_OBJECT_EX pDeviceObject = NULL;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
_RtlInitAnsiString(&aString, "\\Device\\Example");
|
||||
_RtlAnsiStringToUnicodeString(&uString, &aString, TRUE);
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@ int TestLibraryGetModuleFileName(int argc, char* argv[])
|
|||
{
|
||||
char ModuleFileName[4096];
|
||||
DWORD len;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
/* Test insufficient buffer size behaviour */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
len = GetModuleFileNameA(NULL, ModuleFileName, 2);
|
||||
|
|
|
@ -17,7 +17,8 @@ int TestLibraryGetProcAddress(int argc, char* argv[])
|
|||
LPCSTR SharedLibraryExtension;
|
||||
CHAR LibraryPath[PATHCCH_MAX_CCH];
|
||||
PCHAR p;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
if (!GetModuleFileNameA(NULL, LibraryPath, PATHCCH_MAX_CCH))
|
||||
{
|
||||
printf("%s: GetModuleFilenameA failed: 0x%08" PRIX32 "\n", __FUNCTION__, GetLastError());
|
||||
|
|
|
@ -12,7 +12,8 @@ int TestLibraryLoadLibrary(int argc, char* argv[])
|
|||
LPCSTR SharedLibraryExtension;
|
||||
CHAR LibraryPath[PATHCCH_MAX_CCH];
|
||||
PCHAR p;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
if (!GetModuleFileNameA(NULL, LibraryPath, PATHCCH_MAX_CCH))
|
||||
{
|
||||
printf("%s: GetModuleFilenameA failed: 0x%08" PRIX32 "\n", __FUNCTION__, GetLastError());
|
||||
|
|
|
@ -21,6 +21,10 @@ int TestNtCreateFile(int argc, char* argv[])
|
|||
OBJECT_ATTRIBUTES attributes;
|
||||
IO_STATUS_BLOCK ioStatusBlock;
|
||||
int result = -1;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
_RtlInitAnsiString(&aString, TESTFILE);
|
||||
ntstatus = _RtlAnsiStringToUnicodeString(&uString, &aString, TRUE);
|
||||
|
||||
|
|
|
@ -16,5 +16,9 @@ int TestNtCurrentTeb(int argc, char* argv[])
|
|||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@ int TestPathAllocCombine(int argc, char* argv[])
|
|||
HRESULT status;
|
||||
LPTSTR PathOut;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/* Base Path: Backslash, More Path: No Backslash */
|
||||
|
||||
status = PathAllocCombine(testBasePathBackslash, testMorePathNoBackslash, 0, &PathOut);
|
||||
|
|
|
@ -13,6 +13,9 @@ int TestPathCchAddBackslash(int argc, char* argv[])
|
|||
HRESULT status;
|
||||
TCHAR Path[PATHCCH_MAX_CCH];
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/**
|
||||
* PathCchAddBackslash returns S_OK if the function was successful,
|
||||
* S_FALSE if the path string already ends in a backslash,
|
||||
|
|
|
@ -15,6 +15,9 @@ int TestPathCchAddBackslashEx(int argc, char* argv[])
|
|||
size_t cchRemaining;
|
||||
TCHAR Path[PATHCCH_MAX_CCH];
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/**
|
||||
* PathCchAddBackslashEx returns S_OK if the function was successful,
|
||||
* S_FALSE if the path string already ends in a backslash,
|
||||
|
|
|
@ -15,6 +15,9 @@ int TestPathCchAddExtension(int argc, char* argv[])
|
|||
HRESULT status;
|
||||
TCHAR Path[PATHCCH_MAX_CCH];
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/* Path: no extension, Extension: dot */
|
||||
|
||||
_tcscpy(Path, testPathNoExtension);
|
||||
|
|
|
@ -17,6 +17,9 @@ int TestPathCchAppend(int argc, char* argv[])
|
|||
TCHAR Path[PATHCCH_MAX_CCH];
|
||||
size_t i;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/* Base Path: Backslash, More Path: No Backslash */
|
||||
|
||||
_tcscpy(Path, testBasePathBackslash);
|
||||
|
|
|
@ -12,6 +12,9 @@ int TestPathCchFindExtension(int argc, char* argv[])
|
|||
PCSTR pszTmp;
|
||||
HRESULT hr;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/* Test invalid args */
|
||||
|
||||
hr = PathCchFindExtensionA(NULL, sizeof(testPathExtension), &pszExt);
|
||||
|
|
|
@ -23,6 +23,9 @@ int TestPathCchStripPrefix(int argc, char* argv[])
|
|||
TCHAR Path[PATHCCH_MAX_CCH];
|
||||
int i;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/**
|
||||
* PathCchStripPrefix returns S_OK if the prefix was removed, S_FALSE if
|
||||
* the path did not have a prefix to remove, or an HRESULT failure code.
|
||||
|
|
|
@ -15,6 +15,9 @@ int TestPathIsUNCEx(int argc, char* argv[])
|
|||
LPTSTR Server;
|
||||
TCHAR Path[PATHCCH_MAX_CCH];
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/* Path is UNC */
|
||||
|
||||
_tcscpy(Path, testPathUNC);
|
||||
|
|
|
@ -17,6 +17,9 @@ int TestPathMakePath(int argc, char* argv[])
|
|||
char delim = PathGetSeparatorA(0);
|
||||
char* base = GetKnownPath(KNOWN_PATH_TEMP);
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
if (!base)
|
||||
{
|
||||
fprintf(stderr, "Failed to get temporary directory!\n");
|
||||
|
|
|
@ -18,6 +18,9 @@ int TestPathShell(int argc, char* argv[])
|
|||
int rc = 0;
|
||||
size_t x;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
for (x = 0; x < sizeof(paths) / sizeof(paths[0]); x++)
|
||||
{
|
||||
const int id = paths[x];
|
||||
|
|
|
@ -453,7 +453,8 @@ int TestPipeCreateNamedPipe(int argc, char* argv[])
|
|||
HANDLE ClientThread;
|
||||
HANDLE ServerThread;
|
||||
HANDLE hPipe;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
/* Verify that CreateNamedPipe returns INVALID_HANDLE_VALUE on failure */
|
||||
hPipe = CreateNamedPipeA(NULL, 0, 0, 0, 0, 0, 0, NULL);
|
||||
if (hPipe != INVALID_HANDLE_VALUE)
|
||||
|
|
|
@ -335,7 +335,8 @@ int TestPipeCreateNamedPipeOverlapped(int argc, char* argv[])
|
|||
HANDLE ClientThread;
|
||||
HANDLE ServerThread;
|
||||
int result = -1;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
FillMemory(SERVER_MESSAGE, PIPE_BUFFER_SIZE, 0xAA);
|
||||
FillMemory(CLIENT_MESSAGE, PIPE_BUFFER_SIZE, 0xBB);
|
||||
|
||||
|
|
|
@ -16,7 +16,8 @@ int TestPipeCreatePipe(int argc, char* argv[])
|
|||
HANDLE hWritePipe;
|
||||
BYTE readBuffer[BUFFER_SIZE];
|
||||
BYTE writeBuffer[BUFFER_SIZE];
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
status = CreatePipe(&hReadPipe, &hWritePipe, NULL, BUFFER_SIZE * 2);
|
||||
|
||||
if (!status)
|
||||
|
|
|
@ -18,6 +18,9 @@ int TestPoolThread(int argc, char* argv[])
|
|||
{
|
||||
TP_POOL* pool;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
if (!(pool = CreateThreadpool(NULL)))
|
||||
{
|
||||
printf("CreateThreadpool failed\n");
|
||||
|
|
|
@ -125,6 +125,10 @@ fail:
|
|||
|
||||
int TestPoolWork(int argc, char* argv[])
|
||||
{
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
if (!test1())
|
||||
return -1;
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@ int TestAcquireCredentialsHandle(int argc, char* argv[])
|
|||
SEC_WINNT_AUTH_IDENTITY identity;
|
||||
SecurityFunctionTable* table;
|
||||
SecPkgCredentials_Names credential_names;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
sspi_GlobalInit();
|
||||
table = InitSecurityInterface();
|
||||
identity.User = (UINT16*)_strdup(test_User);
|
||||
|
|
|
@ -12,6 +12,9 @@ int TestEnumerateSecurityPackages(int argc, char* argv[])
|
|||
SECURITY_STATUS status;
|
||||
SecPkgInfo* pPackageInfo;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
sspi_GlobalInit();
|
||||
|
||||
status = EnumerateSecurityPackages(&cPackages, &pPackageInfo);
|
||||
|
|
|
@ -25,6 +25,10 @@ int TestInitializeSecurityContext(int argc, char* argv[])
|
|||
PSecBuffer p_SecBuffer;
|
||||
SecBuffer output_SecBuffer;
|
||||
SecBufferDesc output_SecBuffer_desc;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
sspi_GlobalInit();
|
||||
table = InitSecurityInterface();
|
||||
status = QuerySecurityPackageInfo(NTLM_SSP_NAME, &pPackageInfo);
|
||||
|
|
|
@ -9,6 +9,10 @@ int TestQuerySecurityPackageInfo(int argc, char* argv[])
|
|||
int rc;
|
||||
SECURITY_STATUS status;
|
||||
SecPkgInfo* pPackageInfo;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
sspi_GlobalInit();
|
||||
status = QuerySecurityPackageInfo(NTLM_SSP_NAME, &pPackageInfo);
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@ int TestSynchEvent(int argc, char* argv[])
|
|||
{
|
||||
HANDLE event;
|
||||
int i;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
if (ResetEvent(NULL))
|
||||
{
|
||||
printf("ResetEvent(NULL) unexpectedly succeeded\n");
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
int TestSynchSemaphore(int argc, char* argv[])
|
||||
{
|
||||
HANDLE semaphore;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
semaphore = CreateSemaphore(NULL, 0, 1, NULL);
|
||||
|
||||
if (!semaphore)
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
printf("\t" #feature ": %s\n", IsProcessorFeaturePresentEx(feature) ? "yes" : "no")
|
||||
int TestCPUFeatures(int argc, char* argv[])
|
||||
{
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
printf("Base CPU Flags:\n");
|
||||
#ifdef _M_IX86_AMD64
|
||||
TEST_FEATURE(PF_MMX_INSTRUCTIONS_AVAILABLE);
|
||||
|
|
|
@ -331,6 +331,10 @@ static BOOL Test_GetComputerNameEx_Format(COMPUTER_NAME_FORMAT format)
|
|||
|
||||
int TestGetComputerName(int argc, char* argv[])
|
||||
{
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
if (!Test_GetComputerName())
|
||||
return -1;
|
||||
|
||||
|
|
|
@ -6,6 +6,9 @@ int TestGetNativeSystemInfo(int argc, char* argv[])
|
|||
{
|
||||
SYSTEM_INFO sysinfo;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
GetNativeSystemInfo(&sysinfo);
|
||||
|
||||
printf("SystemInfo:\n");
|
||||
|
|
|
@ -6,6 +6,9 @@ int TestLocalTime(int argc, char* argv[])
|
|||
{
|
||||
SYSTEMTIME lTime;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
GetLocalTime(&lTime);
|
||||
|
||||
printf("GetLocalTime: wYear: %" PRIu16 " wMonth: %" PRIu16 " wDayOfWeek: %" PRIu16
|
||||
|
|
|
@ -6,6 +6,9 @@ int TestSystemTime(int argc, char* argv[])
|
|||
{
|
||||
SYSTEMTIME sTime;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
GetSystemTime(&sTime);
|
||||
|
||||
printf("GetSystemTime: wYear: %" PRIu16 " wMonth: %" PRIu16 " wDayOfWeek: %" PRIu16
|
||||
|
|
|
@ -59,6 +59,10 @@ static int test_command_line_parsing_case(const char* line, const char** list)
|
|||
|
||||
int TestThreadCommandLineToArgv(int argc, char* argv[])
|
||||
{
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
test_command_line_parsing_case(test_args_line_1, test_args_list_1);
|
||||
test_command_line_parsing_case(test_args_line_2, test_args_list_2);
|
||||
test_command_line_parsing_case(test_args_line_3, test_args_list_3);
|
||||
|
|
|
@ -32,6 +32,9 @@ int TestThreadCreateProcess(int argc, char* argv[])
|
|||
int ret = 0;
|
||||
SECURITY_ATTRIBUTES saAttr;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
lpszEnvironmentBlock = GetEnvironmentStrings();
|
||||
|
||||
lpApplicationName = NULL;
|
||||
|
|
|
@ -12,6 +12,9 @@ int TestArrayList(int argc, char* argv[])
|
|||
wArrayList* arrayList;
|
||||
const size_t elemsToInsert = 10;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
arrayList = ArrayList_New(TRUE);
|
||||
if (!arrayList)
|
||||
return -1;
|
||||
|
|
|
@ -8,6 +8,9 @@ int TestBacktrace(int argc, char* argv[])
|
|||
char** msg;
|
||||
void* stack = winpr_backtrace(20);
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
if (!stack)
|
||||
{
|
||||
fprintf(stderr, "winpr_backtrace failed!\n");
|
||||
|
|
|
@ -7,6 +7,10 @@ int TestBipBuffer(int argc, char* argv[])
|
|||
BYTE* data;
|
||||
int rc = -1;
|
||||
wBipBuffer* bb;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
bb = BipBuffer_New(1024);
|
||||
|
||||
if (!bb)
|
||||
|
|
|
@ -53,8 +53,11 @@ static void BitStrGen(void)
|
|||
int TestBitStream(int argc, char* argv[])
|
||||
{
|
||||
wBitStream* bs;
|
||||
BYTE buffer[1024];
|
||||
ZeroMemory(buffer, sizeof(buffer));
|
||||
BYTE buffer[1024] = { 0 };
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
bs = BitStream_New();
|
||||
if (!bs)
|
||||
return 1;
|
||||
|
|
|
@ -11,6 +11,9 @@ int TestBufferPool(int argc, char* argv[])
|
|||
BYTE* Buffers[10];
|
||||
int DefaultSize = 1234;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
pool = BufferPool_New(TRUE, -1, 16);
|
||||
if (!pool)
|
||||
return -1;
|
||||
|
|
|
@ -85,6 +85,9 @@ int TestCmdLine(int argc, char* argv[])
|
|||
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
|
||||
};
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
flags = COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_SIGIL_PLUS_MINUS;
|
||||
testArgc = string_list_length(testArgv);
|
||||
command_line = string_list_copy(testArgv);
|
||||
|
|
|
@ -296,5 +296,9 @@ static int test_image_png_to_bmp(void)
|
|||
int TestImage(int argc, char* argv[])
|
||||
{
|
||||
int rc = test_image_png_to_bmp();
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,10 @@ int TestIni(int argc, char* argv[])
|
|||
const char* sValue;
|
||||
char** keyNames = NULL;
|
||||
char** sectionNames = NULL;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/* First Sample */
|
||||
ini = IniFile_New();
|
||||
if (!ini)
|
||||
|
|
|
@ -17,6 +17,9 @@ int TestListDictionary(int argc, char* argv[])
|
|||
char* value;
|
||||
wListDictionary* list;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
list = ListDictionary_New(TRUE);
|
||||
if (!list)
|
||||
return -1;
|
||||
|
|
|
@ -67,6 +67,9 @@ int TestMessagePipe(int argc, char* argv[])
|
|||
wMessagePipe* EchoPipe = NULL;
|
||||
int ret = 1;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
if (!(EchoPipe = MessagePipe_New()))
|
||||
{
|
||||
printf("failed to create message pipe\n");
|
||||
|
|
|
@ -29,6 +29,9 @@ int TestMessageQueue(int argc, char* argv[])
|
|||
HANDLE thread;
|
||||
wMessageQueue* queue;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
if (!(queue = MessageQueue_New(NULL)))
|
||||
{
|
||||
printf("failed to create message queue\n");
|
||||
|
|
|
@ -309,6 +309,9 @@ int TestPrint(int argc, char* argv[])
|
|||
int a, b;
|
||||
float c, d;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
/**
|
||||
* 7
|
||||
* 7
|
||||
|
|
|
@ -34,6 +34,9 @@ int TestPubSub(int argc, char* argv[])
|
|||
{
|
||||
wPubSub* node;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
node = PubSub_New(TRUE);
|
||||
if (!node)
|
||||
return -1;
|
||||
|
|
|
@ -11,6 +11,9 @@ int TestStreamPool(int argc, char* argv[])
|
|||
wStreamPool* pool;
|
||||
char buffer[8192];
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
pool = StreamPool_New(TRUE, BUFFER_SIZE);
|
||||
|
||||
s[0] = StreamPool_Take(pool, 0);
|
||||
|
|
|
@ -47,12 +47,14 @@ int TestWndCreateWindowEx(int argc, char* argv[])
|
|||
HWND hWnd;
|
||||
HMODULE hModule;
|
||||
HINSTANCE hInstance;
|
||||
WNDCLASSEX wndClassEx;
|
||||
WNDCLASSEX wndClassEx = { 0 };
|
||||
WTSSESSION_NOTIFICATION wtsSessionNotification;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
hModule = GetModuleHandle(NULL);
|
||||
|
||||
ZeroMemory(&wndClassEx, sizeof(WNDCLASSEX));
|
||||
wndClassEx.cbSize = sizeof(WNDCLASSEX);
|
||||
wndClassEx.style = 0;
|
||||
wndClassEx.lpfnWndProc = TestWndProc;
|
||||
|
|
|
@ -40,11 +40,13 @@ int TestWndWmCopyData(int argc, char* argv[])
|
|||
HWND hWnd;
|
||||
HMODULE hModule;
|
||||
HINSTANCE hInstance;
|
||||
WNDCLASSEX wndClassEx;
|
||||
WNDCLASSEX wndClassEx = { 0 };
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
hModule = GetModuleHandle(NULL);
|
||||
|
||||
ZeroMemory(&wndClassEx, sizeof(WNDCLASSEX));
|
||||
wndClassEx.cbSize = sizeof(WNDCLASSEX);
|
||||
wndClassEx.style = 0;
|
||||
wndClassEx.lpfnWndProc = TestWndProc;
|
||||
|
|
|
@ -11,6 +11,9 @@ int TestWtsApiEnumerateProcesses(int argc, char* argv[])
|
|||
HANDLE hServer;
|
||||
PWTS_PROCESS_INFOA pProcessInfo;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
#ifndef _WIN32
|
||||
if (!GetEnvironmentVariableA("WTSAPI_LIBRARY", NULL, 0))
|
||||
{
|
||||
|
|
|
@ -12,6 +12,9 @@ int TestWtsApiEnumerateSessions(int argc, char* argv[])
|
|||
HANDLE hServer;
|
||||
PWTS_SESSION_INFOA pSessionInfo;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
#ifndef _WIN32
|
||||
if (!GetEnvironmentVariableA("WTSAPI_LIBRARY", NULL, 0))
|
||||
{
|
||||
|
|
|
@ -15,6 +15,9 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[])
|
|||
DWORD bytesReturned;
|
||||
PWTS_SESSION_INFOA pSessionInfo;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
#ifndef _WIN32
|
||||
if (!GetEnvironmentVariableA("WTSAPI_LIBRARY", NULL, 0))
|
||||
{
|
||||
|
|
|
@ -10,6 +10,9 @@ int TestWtsApiSessionNotification(int argc, char* argv[])
|
|||
BOOL bSuccess;
|
||||
DWORD dwFlags;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
#ifndef _WIN32
|
||||
if (!GetEnvironmentVariableA("WTSAPI_LIBRARY", NULL, 0))
|
||||
{
|
||||
|
|
|
@ -9,6 +9,9 @@ int TestWtsApiShutdownSystem(int argc, char* argv[])
|
|||
HANDLE hServer;
|
||||
DWORD ShutdownFlag;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
#ifndef _WIN32
|
||||
if (!GetEnvironmentVariableA("WTSAPI_LIBRARY", NULL, 0))
|
||||
{
|
||||
|
|
|
@ -11,6 +11,9 @@ int TestWtsApiWaitSystemEvent(int argc, char* argv[])
|
|||
DWORD eventMask;
|
||||
DWORD eventFlags;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
#ifndef _WIN32
|
||||
if (!GetEnvironmentVariableA("WTSAPI_LIBRARY", NULL, 0))
|
||||
{
|
||||
|
|
|
@ -108,6 +108,10 @@ static int test_lzcnt16(void)
|
|||
|
||||
int TestIntrinsics(int argc, char* argv[])
|
||||
{
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
g_LZCNT = IsProcessorFeaturePresentEx(PF_EX_LZCNT);
|
||||
|
||||
printf("LZCNT available: %" PRId32 "\n", g_LZCNT);
|
||||
|
|
|
@ -53,6 +53,9 @@ int TestTypes(int argc, char* argv[])
|
|||
BOOL ok = TRUE;
|
||||
HRESULT hr;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
if (S_OK != (HRESULT)0L)
|
||||
{
|
||||
printf("Error: S_OK should be 0\n");
|
||||
|
|
Loading…
Reference in New Issue