freerdp: fix compilation on Windows
This commit is contained in:
parent
af4a413287
commit
ae368549ad
@ -1,25 +1,27 @@
|
|||||||
|
|
||||||
set(MODULE_NAME "TestFreeRDPutils")
|
set(MODULE_NAME "TestFreeRDPUtils")
|
||||||
set(MODULE_PREFIX "TEST_FREERDP_UTILS")
|
set(MODULE_PREFIX "TEST_FREERDP_UTILS")
|
||||||
|
|
||||||
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
|
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
|
||||||
|
|
||||||
set(${MODULE_PREFIX}_TESTS
|
set(${MODULE_PREFIX}_TESTS
|
||||||
TestRingBuffer.c
|
TestRingBuffer.c)
|
||||||
)
|
|
||||||
|
|
||||||
create_test_sourcelist(${MODULE_PREFIX}_SRCS
|
create_test_sourcelist(${MODULE_PREFIX}_SRCS
|
||||||
${${MODULE_PREFIX}_DRIVER}
|
${${MODULE_PREFIX}_DRIVER}
|
||||||
${${MODULE_PREFIX}_TESTS}
|
${${MODULE_PREFIX}_TESTS})
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
|
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
|
||||||
|
|
||||||
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
|
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
|
||||||
MONOLITHIC ${MONOLITHIC_BUILD}
|
MONOLITHIC ${MONOLITHIC_BUILD}
|
||||||
MODULE winpr
|
MODULE winpr
|
||||||
MODULES winpr-thread winpr-synch winpr-file winpr-utils winpr-crt freerdp-utils
|
MODULES winpr-thread winpr-synch winpr-file winpr-utils winpr-crt)
|
||||||
)
|
|
||||||
|
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
|
||||||
|
MONOLITHIC ${MONOLITHIC_BUILD}
|
||||||
|
MODULE freerdp
|
||||||
|
MODULES freerdp-utils)
|
||||||
|
|
||||||
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ BOOL test_overlaps(void)
|
|||||||
|
|
||||||
for (i = 0, j = 2; i < nchunks; i++)
|
for (i = 0, j = 2; i < nchunks; i++)
|
||||||
{
|
{
|
||||||
for (k = 0; k < chunks[i].size; k++, j++)
|
for (k = 0; k < (int) chunks[i].size; k++, j++)
|
||||||
{
|
{
|
||||||
if (chunks[i].data[k] != (BYTE)j)
|
if (chunks[i].data[k] != (BYTE)j)
|
||||||
goto error;
|
goto error;
|
||||||
@ -123,7 +123,7 @@ int TestRingBuffer(int argc, char* argv[])
|
|||||||
ringbuffer_commit_read_bytes(&ringBuffer, chunks[0].size);
|
ringbuffer_commit_read_bytes(&ringBuffer, chunks[0].size);
|
||||||
|
|
||||||
/* check retrieved bytes */
|
/* check retrieved bytes */
|
||||||
for (i = 0; i < chunks[0].size; i++)
|
for (i = 0; i < (int) chunks[0].size; i++)
|
||||||
{
|
{
|
||||||
if (chunks[0].data[i] != i % 5)
|
if (chunks[0].data[i] != i % 5)
|
||||||
{
|
{
|
||||||
|
@ -212,14 +212,15 @@ static PVOID TestSynchCritical_Main(PVOID arg)
|
|||||||
|
|
||||||
/* the TestSynchCritical_Test1 threads shall run until bTest1Running is FALSE */
|
/* the TestSynchCritical_Test1 threads shall run until bTest1Running is FALSE */
|
||||||
bTest1Running = TRUE;
|
bTest1Running = TRUE;
|
||||||
for (i=0; i<dwThreadCount; i++) {
|
for (i = 0; i < (int) dwThreadCount; i++) {
|
||||||
hThreads[i] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) TestSynchCritical_Test1, &bTest1Running, 0, NULL);
|
hThreads[i] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) TestSynchCritical_Test1, &bTest1Running, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* let it run for TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS ... */
|
/* let it run for TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS ... */
|
||||||
Sleep(TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS);
|
Sleep(TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS);
|
||||||
bTest1Running = FALSE;
|
bTest1Running = FALSE;
|
||||||
|
|
||||||
for (i=0; i<dwThreadCount; i++)
|
for (i = 0; i < (int) dwThreadCount; i++)
|
||||||
{
|
{
|
||||||
if (WaitForSingleObject(hThreads[i], INFINITE) != WAIT_OBJECT_0)
|
if (WaitForSingleObject(hThreads[i], INFINITE) != WAIT_OBJECT_0)
|
||||||
{
|
{
|
||||||
@ -288,7 +289,7 @@ int TestSynchCritical(int argc, char* argv[])
|
|||||||
HANDLE hThread;
|
HANDLE hThread;
|
||||||
DWORD dwThreadExitCode;
|
DWORD dwThreadExitCode;
|
||||||
DWORD dwDeadLockDetectionTimeMs;
|
DWORD dwDeadLockDetectionTimeMs;
|
||||||
int i;
|
DWORD i;
|
||||||
|
|
||||||
dwDeadLockDetectionTimeMs = 2 * TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS * TEST_SYNC_CRITICAL_TEST1_RUNS;
|
dwDeadLockDetectionTimeMs = 2 * TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS * TEST_SYNC_CRITICAL_TEST1_RUNS;
|
||||||
|
|
||||||
@ -307,6 +308,7 @@ int TestSynchCritical(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
if (bThreadTerminated)
|
if (bThreadTerminated)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user