mirror of https://github.com/FreeRDP/FreeRDP
libwinpr-crt: cleanup unicode conversion test
This commit is contained in:
parent
a23e658add
commit
8fffb17933
|
@ -35,6 +35,11 @@ add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT"
|
|||
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib")
|
||||
|
||||
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
|
||||
MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL
|
||||
MODULE winpr
|
||||
MODULES winpr-error)
|
||||
|
||||
if(MONOLITHIC_BUILD)
|
||||
|
||||
else()
|
||||
|
|
|
@ -7,8 +7,7 @@ set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
|
|||
set(${MODULE_PREFIX}_TESTS
|
||||
TestAlignment.c
|
||||
TestString.c
|
||||
TestMultiByteToWideChar.c
|
||||
TestWideCharToMultiByte.c)
|
||||
TestUnicodeConversion.c)
|
||||
|
||||
create_test_sourcelist(${MODULE_PREFIX}_SRCS
|
||||
${${MODULE_PREFIX}_DRIVER}
|
||||
|
@ -19,7 +18,7 @@ add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
|
|||
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
|
||||
MONOLITHIC ${MONOLITHIC_BUILD}
|
||||
MODULE winpr
|
||||
MODULES winpr-crt)
|
||||
MODULES winpr-crt winpr-error)
|
||||
|
||||
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
||||
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/error.h>
|
||||
#include <winpr/windows.h>
|
||||
|
||||
/*
|
||||
* Conversion *to* Unicode
|
||||
* MultiByteToWideChar: http://msdn.microsoft.com/en-us/library/windows/desktop/dd319072/
|
||||
*/
|
||||
|
||||
/* Letters */
|
||||
|
||||
static BYTE c_cedilla_UTF8[] = "\xC3\xA7\x00";
|
||||
|
@ -155,7 +151,7 @@ int convert_utf8_to_utf16(BYTE* lpMultiByteStr, BYTE* expected_lpWideCharStr, in
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (wcscmp(lpWideCharStr, (WCHAR*) expected_lpWideCharStr) != 0)
|
||||
if (_wcscmp(lpWideCharStr, (WCHAR*) expected_lpWideCharStr) != 0)
|
||||
{
|
||||
printf("MultiByteToWideChar unexpected string:\n");
|
||||
|
||||
|
@ -183,7 +179,7 @@ int convert_utf16_to_utf8(BYTE* lpWideCharStr, BYTE* expected_lpMultiByteStr, in
|
|||
int cbMultiByte;
|
||||
LPSTR lpMultiByteStr;
|
||||
|
||||
cchWideChar = wcslen((WCHAR*) lpWideCharStr);
|
||||
cchWideChar = _wcslen((WCHAR*) lpWideCharStr);
|
||||
cbMultiByte = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR) lpWideCharStr, -1, NULL, 0, NULL, NULL);
|
||||
|
||||
printf("WideCharToMultiByte Input UTF16 String:\n");
|
||||
|
@ -238,7 +234,7 @@ int convert_utf16_to_utf8(BYTE* lpWideCharStr, BYTE* expected_lpMultiByteStr, in
|
|||
return length;
|
||||
}
|
||||
|
||||
int TestMultiByteToWideChar(int argc, char* argv[])
|
||||
int TestUnicodeConversion(int argc, char* argv[])
|
||||
{
|
||||
/* Letters */
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/windows.h>
|
||||
|
||||
/*
|
||||
* Conversion *from* Unicode
|
||||
* WideCharToMultiByte: http://msdn.microsoft.com/en-us/library/windows/desktop/dd374130/
|
||||
*/
|
||||
|
||||
int TestWideCharToMultiByte(int argc, char* argv[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue