From: Jan Vorlicek Date: Sat, 5 Nov 2016 04:05:51 +0000 (-0700) Subject: Remove more PAL functions (dotnet/coreclr#8009) X-Git-Tag: submit/tizen/20210909.063632~11030^2~8963 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d1bdb709f9be4a38ee29289272709752517458d;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Remove more PAL functions (dotnet/coreclr#8009) This change removes the following PAL functions and their related PAL tests: _i64tow _itow lstrcatW lstrcpyW wsprintfA wsprintfW lstrcpynW The lstrcpynW was actually used in two functions in palrt and I have replaced it with StringCchCopyNW. The _i64tow and _itow were used as an implementation of the _i64tow_s and _itow_s. Since these _s versions were also implemented in PAL for its internal purposes, I have exposed them and got rid of the unsafe versions. Commit migrated from https://github.com/dotnet/coreclr/commit/e1189d69095320cfb4b11cecde2184793c9b822d --- diff --git a/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src b/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src index 466a1bf..f213497 100644 --- a/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src +++ b/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src @@ -52,8 +52,8 @@ _stricmp _snprintf _snwprintf _vsnwprintf -_itow -_i64tow +_itow_s +_i64tow_s memcpy_s CoCreateGuid diff --git a/src/coreclr/src/inc/winwrap.h b/src/coreclr/src/inc/winwrap.h index 91a71b7..4a012d3 100644 --- a/src/coreclr/src/inc/winwrap.h +++ b/src/coreclr/src/inc/winwrap.h @@ -86,8 +86,6 @@ #undef lstrcmp #undef lstrcmpi #undef lstrcpyn -#undef lstrcpy -#undef lstrcat #undef lstrlen #undef CreateMutex #undef OpenMutex @@ -222,7 +220,6 @@ // winuser.h #undef MAKEINTRESOURCE #undef wvsprintf -#undef wsprintf #undef LoadKeyboardLayout #undef GetKeyboardLayoutName #undef CreateDesktop @@ -395,8 +392,6 @@ #define WszQueryRecoveryAgents QueryRecoveryAgentsW #define Wszlstrcmp lstrcmpW #define Wszlstrcmpi lstrcmpiW -#define Wszlstrcpy lstrcpyW -#define Wszlstrcat lstrcatW #define WszCreateMutex CreateMutexW #define WszOpenMutex OpenMutexW #define WszCreateEvent CreateEventW @@ -684,8 +679,6 @@ // on win98 and higher #define Wszlstrlen lstrlenW -#define Wszlstrcpy lstrcpyW -#define Wszlstrcat lstrcatW //File and Directory Functions which need special handling for LongFile Names //Note only the functions which are currently used are defined diff --git a/src/coreclr/src/pal/inc/pal.h b/src/coreclr/src/pal/inc/pal.h index 89e4dd8..7da8114 100644 --- a/src/coreclr/src/pal/inc/pal.h +++ b/src/coreclr/src/pal/inc/pal.h @@ -671,28 +671,6 @@ CharNextExA( #endif -PALIMPORT -int -PALAPIV -wsprintfA( - OUT LPSTR, - IN LPCSTR, - ...); - -PALIMPORT -int -PALAPIV -wsprintfW( - OUT LPWSTR, - IN LPCWSTR, - ...); - -#ifdef UNICODE -#define wsprintf wsprintfW -#else -#define wsprintf wsprintfA -#endif - #define MB_OK 0x00000000L #define MB_OKCANCEL 0x00000001L #define MB_ABORTRETRYIGNORE 0x00000002L @@ -4801,28 +4779,6 @@ DebugBreak( VOID); PALIMPORT -LPWSTR -PALAPI -lstrcatW( - IN OUT LPWSTR lpString1, - IN LPCWSTR lpString2); - -#ifdef UNICODE -#define lstrcat lstrcatW -#endif - -PALIMPORT -LPWSTR -PALAPI -lstrcpyW( - OUT LPWSTR lpString1, - IN LPCWSTR lpString2); - -#ifdef UNICODE -#define lstrcpy lstrcpyW -#endif - -PALIMPORT int PALAPI lstrlenA( @@ -4841,19 +4797,6 @@ lstrlenW( #endif PALIMPORT -LPWSTR -PALAPI -lstrcpynW( - OUT LPWSTR lpString1, - IN LPCWSTR lpString2, - IN int iMaxLength); - -#ifdef UNICODE -#define lstrcpyn lstrcpynW -#endif - - -PALIMPORT DWORD PALAPI GetEnvironmentVariableW( @@ -5922,7 +5865,7 @@ PALIMPORT int __cdecl _wcsicmp(const WCHAR *, const WCHAR*); PALIMPORT int __cdecl _wcsnicmp(const WCHAR *, const WCHAR *, size_t); PALIMPORT int __cdecl _vsnprintf(char *, size_t, const char *, va_list); PALIMPORT int __cdecl _vsnwprintf(WCHAR *, size_t, const WCHAR *, va_list); -PALIMPORT WCHAR * __cdecl _itow(int, WCHAR *, int); +PALIMPORT errno_t __cdecl _itow_s(int, WCHAR *, size_t, int); PALIMPORT size_t __cdecl PAL_wcslen(const WCHAR *); PALIMPORT int __cdecl PAL_wcscmp(const WCHAR*, const WCHAR*); @@ -5957,7 +5900,7 @@ PALIMPORT WCHAR __cdecl PAL_towupper(WCHAR); PALIMPORT WCHAR * __cdecl _wcslwr(WCHAR *); PALIMPORT ULONGLONG _wcstoui64(const WCHAR *, WCHAR **, int); -PALIMPORT WCHAR * __cdecl _i64tow(__int64, WCHAR *, int); +PALIMPORT errno_t __cdecl _i64tow_s(long long, WCHAR *, size_t, int); PALIMPORT int __cdecl _wtoi(const WCHAR *); #ifdef __cplusplus diff --git a/src/coreclr/src/pal/inc/rt/palrt.h b/src/coreclr/src/pal/inc/rt/palrt.h index 3b16ff9..be16289 100644 --- a/src/coreclr/src/pal/inc/rt/palrt.h +++ b/src/coreclr/src/pal/inc/rt/palrt.h @@ -834,7 +834,6 @@ enum tagMIMECONTF { // note: diff in NULL handing and calling convetion #define StrCpyW PAL_wcscpy -#define StrCpyNW lstrcpynW // note: can't be wcsncpy! #define StrCatW PAL_wcscat #define StrChrW (WCHAR*)PAL_wcschr #define StrCmpW PAL_wcscmp @@ -855,7 +854,6 @@ STDAPI_(LPWSTR) StrCatBuffW(LPWSTR pszDest, LPCWSTR pszSrc, int cchDestBuffSize) #ifdef UNICODE #define StrCpy StrCpyW -#define StrCpyN StrCpyNW #define StrCat StrCatW #define StrNCat StrNCatW #define StrChr StrChrW @@ -1071,64 +1069,6 @@ inline errno_t __cdecl _fopen_unsafe(PAL_FILE * *ff, const char *fileName, const } } -/* _itow_s */ -_SAFECRT__EXTERN_C -errno_t __cdecl _itow_s(int _Value, WCHAR *_Dst, size_t _SizeInWords, int _Radix); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -extern "C++" -template -inline -errno_t __cdecl _itow_s(int _Value, WCHAR (&_Dst)[_SizeInWords], int _Radix) -{ - return _itow_s(_Value, _Dst, _SizeInWords, _Radix); -} -#endif - -#if _SAFECRT_USE_INLINES - -__inline -errno_t __cdecl _itow_s(int _Value, WCHAR *_Dst, size_t _SizeInWords, int _Radix) -{ - /* validation section */ - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInWords); - - /* TODO: do not write past buffer size */ - _itow(_Value, _Dst, _Radix); - return 0; -} - -#endif - -/* _i64tow_s */ -_SAFECRT__EXTERN_C -errno_t __cdecl _i64tow_s(__int64 _Value, WCHAR *_Dst, size_t _SizeInWords, int _Radix); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -extern "C++" -template -inline -errno_t __cdecl _i64tow_s(__int64 _Value, WCHAR (&_Dst)[_SizeInWords], int _Radix) -{ - return _i64tow_s(_Value, _Dst, _SizeInWords, _Radix); -} -#endif - -#if _SAFECRT_USE_INLINES - -__inline -errno_t __cdecl _i64tow_s(__int64 _Value, WCHAR *_Dst, size_t _SizeInWords, int _Radix) -{ - /* validation section */ - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInWords); - - /* TODO: do not write past buffer size */ - _i64tow(_Value, _Dst, _Radix); - return 0; -} - -#endif - } #endif /* __cplusplus */ diff --git a/src/coreclr/src/pal/src/cruntime/lstr.cpp b/src/coreclr/src/pal/src/cruntime/lstr.cpp index 2267d84..4502b02 100644 --- a/src/coreclr/src/pal/src/cruntime/lstr.cpp +++ b/src/coreclr/src/pal/src/cruntime/lstr.cpp @@ -24,141 +24,6 @@ Abstract: SET_DEFAULT_DEBUG_CHANNEL(CRT); - -/*++ -Function: - lstrcatW - -The lstrcat function appends one string to another. - -Parameters - -lpString1 [in/out] Pointer to a null-terminated string. The buffer must be large - enough to contain both strings. -lpString2 [in] Pointer to the null-terminated string to be appended to the - string specified in the lpString1 parameter. - -Return Values - -If the function succeeds, the return value is a pointer to the buffer. -If the function fails, the return value is NULL. - ---*/ -LPWSTR -PALAPI -lstrcatW( - IN OUT LPWSTR lpString1, - IN LPCWSTR lpString2) -{ - LPWSTR lpStart = lpString1; - - PERF_ENTRY(lstrcatW); - ENTRY("lstrcatW (lpString1=%p (%S), lpString2=%p (%S))\n", - lpString1?lpString1:W16_NULLSTRING, - lpString1?lpString1:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING); - - if (lpString1 == NULL) - { - ERROR("invalid lpString1 argument\n"); - LOGEXIT("lstrcatW returning LPWSTR NULL\n"); - PERF_EXIT(lstrcatW); - return NULL; - } - - if (lpString2 == NULL) - { - ERROR("invalid lpString2 argument\n"); - LOGEXIT("lstrcatW returning LPWSTR NULL\n"); - PERF_EXIT(lstrcatW); - return NULL; - } - - /* find end of source string */ - while (*lpString1) - { - lpString1++; - } - - /* concatenate new string */ - while(*lpString2) - { - *lpString1++ = *lpString2++; - } - - /* add terminating null */ - *lpString1 = '\0'; - - LOGEXIT("lstrcatW returning LPWSTR %p (%S)\n", lpStart, lpStart); - PERF_EXIT(lstrcatW); - return lpStart; -} - - -/*++ -Function: - lstrcpyW - -The lstrcpy function copies a string to a buffer. - -To copy a specified number of characters, use the lstrcpyn function. - -Parameters - -lpString1 [out] Pointer to a buffer to receive the contents of the string pointed - to by the lpString2 parameter. The buffer must be large enough to - contain the string, including the terminating null character. - -lpString2 [in] Pointer to the null-terminated string to be copied. - -Return Values - -If the function succeeds, the return value is a pointer to the buffer. -If the function fails, the return value is NULL. - ---*/ -LPWSTR -PALAPI -lstrcpyW( - OUT LPWSTR lpString1, - IN LPCWSTR lpString2) -{ - LPWSTR lpStart = lpString1; - - PERF_ENTRY(lstrcpyW); - ENTRY("lstrcpyW (lpString1=%p, lpString2=%p (%S))\n", - lpString1?lpString1:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING); - - if (lpString1 == NULL) - { - ERROR("invalid lpString1 argument\n"); - LOGEXIT("lstrcpyW returning LPWSTR NULL\n"); - PERF_EXIT(lstrcpyW); - return NULL; - } - - if (lpString2 == NULL) - { - ERROR("invalid lpString2 argument\n"); - LOGEXIT("lstrcpyW returning LPWSTR NULL\n"); - PERF_EXIT(lstrcpyW); - return NULL; - } - - /* copy source string to destination string */ - while(*lpString2) - { - *lpString1++ = *lpString2++; - } - - /* add terminating null */ - *lpString1 = '\0'; - - LOGEXIT("lstrcpyW returning LPWSTR %p (%S)\n", lpStart, lpStart); - PERF_EXIT(lstrcpyW); - return lpStart; -} - - /*++ Function: lstrlenA @@ -239,78 +104,3 @@ lstrlenW( PERF_EXIT(lstrlenW); return nChar; } - - -/*++ -Function: - lstrcpynW - -The lstrcpyn function copies a specified number of characters from a -source string into a buffer. - -Parameters - -lpString1 [out] Pointer to a buffer into which the function copies characters. - The buffer must be large enough to contain the number of TCHARs - specified by iMaxLength, including room for a terminating null character. -lpString2 [in] Pointer to a null-terminated string from which the function copies - characters. -iMaxLength [in] Specifies the number of TCHARs to be copied from the string pointed - to by lpString2 into the buffer pointed to by lpString1, including a - terminating null character. - -Return Values - -If the function succeeds, the return value is a pointer to the buffer. -If the function fails, the return value is NULL. - ---*/ -LPWSTR -PALAPI -lstrcpynW( - OUT LPWSTR lpString1, - IN LPCWSTR lpString2, - IN int iMaxLength) -{ - LPWSTR lpStart = lpString1; - - PERF_ENTRY(lstrcpynW); - ENTRY("lstrcpynW (lpString1=%p, lpString2=%p (%S), iMaxLength=%d)\n", - lpString1?lpString1:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING, iMaxLength); - - if (lpString1 == NULL) - { - ERROR("invalid lpString1 argument\n"); - LOGEXIT("lstrcpynW returning LPWSTR NULL\n"); - PERF_EXIT(lstrcpynW); - return NULL; - } - - if (lpString2 == NULL) - { - ERROR("invalid lpString2 argument\n"); - LOGEXIT("lstrcpynW returning LPWSTR NULL\n"); - PERF_EXIT(lstrcpynW); - return NULL; - } - - /* copy source string to destination string */ - while(iMaxLength > 1 && *lpString2) - { - *lpString1++ = *lpString2++; - iMaxLength--; - } - - /* add terminating null */ - if (iMaxLength > 0) - { - *lpString1 = '\0'; - } - - LOGEXIT("lstrcpynW returning LPWSTR %p (%S)\n", lpStart, lpStart); - PERF_EXIT(lstrcpynW); - return lpStart; - -} - - diff --git a/src/coreclr/src/pal/src/cruntime/printf.cpp b/src/coreclr/src/pal/src/cruntime/printf.cpp index 2d9d6e4..dab0478 100644 --- a/src/coreclr/src/pal/src/cruntime/printf.cpp +++ b/src/coreclr/src/pal/src/cruntime/printf.cpp @@ -277,63 +277,6 @@ PAL_vprintf( /*++ Function: - wsprintfA - -See MSDN doc. ---*/ -int -PALAPIV -wsprintfA( - OUT LPSTR buffer, - IN LPCSTR format, - ...) -{ - LONG Length; - va_list ap; - - PERF_ENTRY(wsprintfA); - ENTRY("wsprintfA (buffer=%p, format=%p (%s))\n", buffer, format, format); - - va_start(ap, format); - Length = InternalVsnprintf(CorUnix::InternalGetCurrentThread(), buffer, 1024, format, ap); - va_end(ap); - - LOGEXIT("wsprintfA returns int %d\n", Length); - PERF_EXIT(wsprintfA); - return Length; -} - -/*++ -Function: - wsprintfW - -See MSDN doc. ---*/ -int -PALAPIV -wsprintfW( - OUT LPWSTR buffer, - IN LPCWSTR format, - ...) -{ - LONG Length; - va_list ap; - - PERF_ENTRY(wsprintfW); - ENTRY("wsprintfW (buffer=%p, format=%p (%S))\n", buffer, format, format); - - va_start(ap, format); - Length = PAL__wvsnprintf(buffer, 1024, format, ap); - va_end(ap); - - LOGEXIT("wsprintfW returns int %d\n", Length); - PERF_EXIT(wsprintfW); - return Length; -} - - -/*++ -Function: _snprintf See MSDN doc. diff --git a/src/coreclr/src/pal/src/cruntime/wchar.cpp b/src/coreclr/src/pal/src/cruntime/wchar.cpp index dca877c..3de065e 100644 --- a/src/coreclr/src/pal/src/cruntime/wchar.cpp +++ b/src/coreclr/src/pal/src/cruntime/wchar.cpp @@ -73,146 +73,6 @@ wtolower(wchar_16 c) } -/******************************************************************************* -Function: - Internal_i64tow - -Parameters: - value - - INT64 value to be converted to a string - string - - out buffer to place interger string - radix - - numeric base to convert to - isI64 - - TRUE if value is INT64, FALSE if value is a long - -Note: - - only a radix of ten (and value < 0) will result in a negative - sign in the output buffer -*******************************************************************************/ -LPWSTR Internal_i64tow(INT64 value, LPWSTR string, int radix, BOOL isI64) -{ - int length = 0; - int n; - int r; - UINT64 uval = value; - LPWSTR stringPtr = string; - int start = 0; - int end; - WCHAR tempCh; - - if (radix < 2 || radix > 36) - { - ASSERT( "Invalid radix, radix must be between 2 and 36\n" ); - SetLastError(ERROR_INVALID_PARAMETER); - return string; - } - if (FALSE == isI64) - { - uval = (ULONG) uval; - } - if (10 == radix && value < 0) - { - uval = value * -1; - } - if(0 == uval) - { - ++length; - *stringPtr++ = '0'; - } - else while (uval > 0) - { - ++length; - n = uval / radix; - r = uval - (n * radix); - uval /= radix; - if (r > 9) - { - *stringPtr++ = r + 87; - } - else - { - *stringPtr++ = r + 48; - } - } - if (10 == radix && value < 0) - { - *stringPtr++ = '-'; - ++length; - } - *stringPtr = 0; /* end the string */ - - /* reverse the string */ - end = length - 1; - while (start < end) - { - tempCh = string[start]; - string[start] = string[end]; - string[end] = tempCh; - ++start; - --end; - } - - return string; -} - -/*-- -Function: - _itow - -16-bit wide character version of the ANSI tolower() function. - - --*/ -wchar_16 * -__cdecl -_itow( - int value, - wchar_16 *string, - int radix) -{ - wchar_16 *ret; - - PERF_ENTRY(_itow); - ENTRY("_itow (value=%d, string=%p, radix=%d)\n", - value, string, radix); - - ret = Internal_i64tow(value, string, radix, FALSE); - - LOGEXIT("_itow returns wchar_t* %p\n", ret); - PERF_EXIT(_itow); - - return ret; -} - -/*-- -Function: - _i64tow - -See MSDN doc ---*/ -wchar_16 * - __cdecl -_i64tow( - __int64 value, - wchar_16 *string, - int radix) -{ - wchar_16 *ret; - - PERF_ENTRY(_i64tow); - ENTRY("_i64tow (value=%ld, string=%p, radix=%d)\n", - value, string, radix); - - ret = Internal_i64tow(value, string, radix, TRUE); - - LOGEXIT("_i64tow returns wchar_t* %p\n", ret); - PERF_EXIT(_i64tow); - - return ret; -} - - /*-- Function: _wtoi diff --git a/src/coreclr/src/pal/src/include/pal/palinternal.h b/src/coreclr/src/pal/src/include/pal/palinternal.h index 53d5203..218d40d 100644 --- a/src/coreclr/src/pal/src/include/pal/palinternal.h +++ b/src/coreclr/src/pal/src/include/pal/palinternal.h @@ -525,7 +525,6 @@ function_name() to call the system's implementation #undef wcsncmp #undef wcschr #undef wcsrchr -#undef wsprintf #undef swscanf #undef wcspbrk #undef wcsstr diff --git a/src/coreclr/src/pal/src/safecrt/xtox_s.inl b/src/coreclr/src/pal/src/safecrt/xtox_s.inl index 502340e..7c8b2f2 100644 --- a/src/coreclr/src/pal/src/safecrt/xtox_s.inl +++ b/src/coreclr/src/pal/src/safecrt/xtox_s.inl @@ -21,11 +21,9 @@ #define _i64tox_s _i64tow_s #define _ui64tox_s _ui64tow_s #define xtox xtow -#define _itox _itow #define _ltox _ltow #define _ultox _ultow #define x64tox x64tow -#define _i64tox _i64tow #else /* _UNICODE */ #define xtox_s xtoa_s #define _itox_s _itoa_s @@ -35,11 +33,9 @@ #define _i64tox_s _i64toa_s #define _ui64tox_s _ui64toa_s #define xtox xtoa -#define _itox _itoa #define _ltox _ltoa #define _ultox _ultoa #define x64tox x64toa -#define _i64tox _i64toa #endif /* _UNICODE */ /*** @@ -222,19 +218,6 @@ errno_t __cdecl _ultox_s ( /* Actual functions just call conversion helper with neg flag set correctly, and return pointer to buffer. */ -TCHAR * __cdecl _itox ( - int val, - TCHAR *buf, - int radix - ) -{ - if (radix == 10 && val < 0) - xtox((unsigned long)val, buf, radix, 1); - else - xtox((unsigned long)(unsigned int)val, buf, radix, 0); - return buf; -} - TCHAR * __cdecl _ltox ( long val, TCHAR *buf, @@ -423,16 +406,6 @@ errno_t __cdecl _ui64tox_s ( /* Actual functions just call conversion helper with neg flag set correctly, and return pointer to buffer. */ -TCHAR * __cdecl _i64tox ( - __int64 val, - TCHAR *buf, - int radix - ) -{ - x64tox((unsigned __int64)val, buf, radix, (radix == 10 && val < 0)); - return buf; -} - TCHAR * __cdecl _ui64tox ( unsigned __int64 val, TCHAR *buf, diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp index 745ce4a..01f32f2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp @@ -6,7 +6,7 @@ ** ** Source: test1.c ** -** Purpose: Tests the PAL implementation of the _itow function. +** Purpose: Tests the PAL implementation of the _itow_s function. ** Test a number of ints with different radix on each, ** to ensure that the string returned is correct. ** @@ -65,19 +65,18 @@ int __cdecl main(int argc, char **argv) for(i = 0; i < sizeof(testCases) / sizeof(struct testCase); i++) { - pResult = _itow(testCases[i].value,result,testCases[i].radix); + errno_t err = _itow_s(testCases[i].value, result, sizeof(result) / sizeof(result[0]), testCases[i].radix); - if(pResult != &result[0]) + if(err != 0) { - Fail("ERROR: _itow didn't return a correct pointer to the " - "newly formed string.\n"); + Fail("ERROR: _itow_s didn't return success, error code %d.\n", err); } - if (0 != wcscmp(testCases[i].CorrectResult,pResult)) + if (0 != wcscmp(testCases[i].CorrectResult, result)) { PrintResult = convertC(pResult); PrintCorrectResult = convertC(testCases[i].CorrectResult); - Fail("ERROR: _itow was called on %i, returning the string %s " + Fail("ERROR: _itow_s was called on %i, returning the string %s " "when it should have returned the string %s.\n" , testCases[i].value, PrintResult, PrintCorrectResult); } diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat index 394c34d..91f0e62 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat @@ -4,12 +4,12 @@ Version = 1.0 Section = C Runtime -Function = _itow -Name = Positive Test for _itow +Function = _itow_s +Name = Positive Test for _itow_s TYPE = DEFAULT EXE1 = test1 Description -= Tests the PAL implementation of the _itow function. += Tests the PAL implementation of the _itow_s function. = Test a number of ints with different radix on each, to ensure that the = string returned is correct. diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp index 257d016..e10f2ea 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp @@ -52,7 +52,7 @@ BOOL GetCurrentDir(WCHAR* szwCurrentDir) // now strip the file name from the full path to get the current path nCount = lstrlenW(szwReturnedPath) - lstrlenW(szwFileName); memset(szwCurrentDir, 0, sizeof(WCHAR)*(_MAX_DIR+1)); - lstrcpynW(szwCurrentDir, szwReturnedPath, nCount); + wcsncpy(szwCurrentDir, szwReturnedPath, nCount - 1); free(szwFileName); return(TRUE); diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt index d7bb762..0fd4df8 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt @@ -27,9 +27,6 @@ add_subdirectory(InterLockedExchangeAdd) add_subdirectory(InterlockedExchangePointer) add_subdirectory(InterlockedIncrement) add_subdirectory(InterlockedIncrement64) -add_subdirectory(lstrcatW) -add_subdirectory(lstrcpynW) -add_subdirectory(lstrcpyW) add_subdirectory(lstrlenA) add_subdirectory(lstrlenW) add_subdirectory(queryperformancecounter) @@ -37,7 +34,5 @@ add_subdirectory(queryperformancefrequency) add_subdirectory(SetEnvironmentVariableA) add_subdirectory(SetEnvironmentVariableW) add_subdirectory(SetLastError) -add_subdirectory(wsprintfA) -add_subdirectory(wsprintfW) add_subdirectory(_i64tow) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp index 9a87328..9a8ae07 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp @@ -6,7 +6,7 @@ ** ** Source: test1.c ** -** Purpose: Tests _i64tow with normal values and different radices, negative +** Purpose: Tests _i64tow_s with normal values and different radices, negative ** values, as well as the highest and lowest values. ** ** @@ -54,17 +54,17 @@ int __cdecl main(int argc, char *argv[]) for (i=0; i - -int __cdecl main(int argc, char *argv[]) { - - WCHAR FirstString[10] = {'T','E','S','T','\0'}; - const WCHAR SecondString[] = {'P','A','L','!','\0'}; - WCHAR CorrectString[] = {'T','E','S','T','P','A','L','!','\0'}; - WCHAR* ReturnedPointer = NULL; - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - ReturnedPointer = lstrcat(FirstString,SecondString); - - /* Check to see if the pointer returned points to the concat string */ - if(ReturnedPointer != &FirstString[0]) - { - Fail("ERROR: The function was supposed to return a pointer to " - "the concatentated string, but it did not.\n"); - } - - /* Check to make sure the Concat string is the same as the predetermined - 'CorrectString' */ - if(memcmp(FirstString,CorrectString, - wcslen(FirstString)*sizeof(WCHAR)) != 0) - { - Fail("ERROR: The concatenated string should be %s but %s was the " - "result.\n", - convertC(CorrectString), - convertC(FirstString)); - } - - PAL_Terminate(); - return PASS; -} - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/testinfo.dat deleted file mode 100644 index 006e83b..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = lstrcatW -Name = Positive test of lstrcatW -TYPE = DEFAULT -EXE1 = test -Description -= Test to see that concatenating two strings works, -= and also check return values in successful and failing situations. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/CMakeLists.txt deleted file mode 100644 index 899b903..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test2.cpp -) - -add_executable(paltest_lstrcatw_test2 - ${SOURCES} -) - -add_dependencies(paltest_lstrcatw_test2 coreclrpal) - -target_link_libraries(paltest_lstrcatw_test2 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/test2.cpp deleted file mode 100644 index 6c66bc8..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/test2.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test2.c -** -** Purpose: Negative test for lstrcatW() function -** -** -**=========================================================*/ - -#define UNICODE - -#include - -int __cdecl main(int argc, char *argv[]) { - - WCHAR FirstString[10] = {'T','E','S','T','\0'}; - const WCHAR SecondString[] = {'P','A','L','!','\0'}; - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - /* If either of these is NULL, function should fail and return NULL. */ - if(lstrcat(NULL,SecondString) != NULL) - { - Fail("ERROR: When NULL was passed to the first parameter of the " - "function, it should have returned " - "NULL as a result, but did not.\n"); - } - - if(lstrcat(FirstString,NULL) != NULL) - { - Fail("ERROR: When NULL was passed to the second parameter of the " - "function, it should have returned " - "NULL as a result, but did not.\n"); - } - - - PAL_Terminate(); - return PASS; -} - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/testinfo.dat deleted file mode 100644 index cc1ee64..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = lstrcatW -Name = Negtive test of lstrcatW -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to see lstrcat reports error with failing situations. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/CMakeLists.txt deleted file mode 100644 index 23b966c..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test3.cpp -) - -add_executable(paltest_lstrcatw_test3 - ${SOURCES} -) - -add_dependencies(paltest_lstrcatw_test3 coreclrpal) - -target_link_libraries(paltest_lstrcatw_test3 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/test3.cpp deleted file mode 100644 index 49a9c57..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/test3.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test3.c -** -** Purpose: Testing lstrcatw with two NULL strings passed on -** -** -**=========================================================*/ - -#define UNICODE - -#include - -int __cdecl main(int argc, char *argv[]) -{ - - - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - - /* testing the behaviour of lstrcatW with two NULL strings */ - if( lstrcat(NULL,NULL) != NULL) - { - - Fail("lstrcat:ERROR: the function should returned NULL\n"); - - } - - PAL_Terminate(); - return PASS; -} - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/testinfo.dat deleted file mode 100644 index 794bcdb..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/testinfo.dat +++ /dev/null @@ -1,26 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 - -Section = Miscellaneous - -Function = lstrcatW - -Name = Negative testing for lstrcatW - -TYPE = DEFAULT - -EXE1 = test3 - -Description - -= Testing the behaviour after sending two strings contained NULL - - - - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/CMakeLists.txt deleted file mode 100644 index c3d6568..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test4.cpp -) - -add_executable(paltest_lstrcatw_test4 - ${SOURCES} -) - -add_dependencies(paltest_lstrcatw_test4 coreclrpal) - -target_link_libraries(paltest_lstrcatw_test4 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/test4.cpp deleted file mode 100644 index abc9021..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/test4.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test4.c -** -** Purpose: Testing the behaviour of lstrcatw when string2 contains -** special characters, this test case depends on: -** memcmp -** wcslen -** lstrcpyn -** -** -**=========================================================*/ - -#define UNICODE - -#include - -struct testCase -{ - WCHAR SecondString[5]; - WCHAR CorrectString[10]; -}; - -int __cdecl main(int argc, char *argv[]) -{ - - WCHAR FirstString[10] = {'T','E','S','T','\0'}; - WCHAR TestString[10] = {'T','E','S','T','\0'}; - int i = 0; - - /* - * this structure includes several strings to be tested with - * lstrcatW function and the expected results - */ - - struct testCase testCases[]= - { - {{'\t','T','A','B','\0'}, - {'T','E','S','T','\t','T','A','B','\0'}}, - {{'2','T','\?','B','\0'}, - {'T','E','S','T','2','T','\?','B','\0'}}, - {{'\v','T','E','\v','\0'}, - {'T','E','S','T','\v','T','E','\v','\0'}}, - {{'T','\a','E','\a','\0'}, - {'T','E','S','T','T','\a','E','\a','\0'}}, - {{'0','\f','Z','\f','\0'}, - {'T','E','S','T','0','\f','Z','\f','\0'}}, - {{'\r','H','I','\r','\0'}, - {'T','E','S','T','\r','H','I','\r','\0'}}, - {{'H','I','\"','\"','\0'}, - {'T','E','S','T','H','I','\"','\"','\0'}}, - {{'H','\b','I','\b','\0'}, - {'T','E','S','T','H','\b','I','\b','\0'}}, - {{'H','\n','I','\n','\0'}, - {'T','E','S','T','H','\n','I','\n','\0'}} - }; - - - - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - - /* Loop through the struct and validate the resulted string */ - for( i = 0; i < sizeof(testCases)/sizeof(struct testCase); i++) - { - - lstrcat(FirstString, testCases[i].SecondString); - - if(memcmp(FirstString,testCases[i].CorrectString, - wcslen(FirstString)*sizeof(WCHAR))) - { - - Fail("ERROR: the function failed with a special character.\n"); - } - - /* reinitialize the first string */ - lstrcpyn(FirstString,TestString,10); - - } - - - - - PAL_Terminate(); - return PASS; -} - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/testinfo.dat deleted file mode 100644 index 96235fb..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/testinfo.dat +++ /dev/null @@ -1,28 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 - -Section = Miscellaneous - -Function = lstrcatW - -Name = Positive testing for lstrcatW - -TYPE = DEFAULT - -EXE1 = test4 - -Description - -= Testing the behaviour of lstrcatw when string2 contains - -= special characters and validate the resulted string - - - - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/CMakeLists.txt deleted file mode 100644 index f6aa0cb..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/CMakeLists.txt deleted file mode 100644 index a758686..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_lstrcpyw_test1 - ${SOURCES} -) - -add_dependencies(paltest_lstrcpyw_test1 coreclrpal) - -target_link_libraries(paltest_lstrcpyw_test1 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/test.cpp deleted file mode 100644 index 881ba03..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/test.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for lstrcpyW() function -** -** -**=========================================================*/ - -#define UNICODE - -#include - -int __cdecl main(int argc, char *argv[]) -{ - WCHAR FirstString[5] = {'T','E','S','T','\0'}; - WCHAR ResultBuffer[5]; - WCHAR* ResultPointer = NULL; - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - ResultPointer = lstrcpy(ResultBuffer,FirstString); - - /* Check the return value */ - if(ResultPointer != &ResultBuffer[0]) - { - Fail("ERROR: The function did not return a pointer to the Result " - "Buffer after being called.\n"); - } - - /* A straight copy, the values should be equal. */ - if(memcmp(ResultBuffer,FirstString,wcslen(ResultBuffer)*2+2) != 0) - { - Fail("ERROR: The result of the copy was '%s' when it should have " - "been '%s'.\n",convertC(ResultBuffer),convertC(FirstString)); - } - - /* If either param is NULL, it should return NULL. */ - if(lstrcpy(ResultBuffer,NULL) != NULL) - { - Fail("ERROR: The second parameter was NULL, so the function should " - "fail and return NULL.\n"); - } - if(lstrcpy(NULL,FirstString) != NULL) - { - Fail("ERROR: The first parameter was NULL, so the function should " - "fail and return NULL.\n"); - } - - - PAL_Terminate(); - return PASS; -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/testinfo.dat deleted file mode 100644 index 37c9835..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = lstrcpyW -Name = Positive test of lstrcpyW -TYPE = DEFAULT -EXE1 = test -Description -= Ensure that a copy of a string works, and that the return values -= are correct for success and failure. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/CMakeLists.txt deleted file mode 100644 index f6aa0cb..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/CMakeLists.txt deleted file mode 100644 index e3a0b00..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_lstrcpynw_test1 - ${SOURCES} -) - -add_dependencies(paltest_lstrcpynw_test1 coreclrpal) - -target_link_libraries(paltest_lstrcpynw_test1 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/test.cpp deleted file mode 100644 index 1ae0c51..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/test.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for lstrcpynW() function -** -** -**=========================================================*/ - -#define UNICODE - -#include - -int __cdecl main(int argc, char *argv[]) { - - WCHAR FirstString[5] = {'T','E','S','T','\0'}; - WCHAR CorrectBuffer[3] = {'T','E','\0'}; - WCHAR ResultBuffer[5]; - WCHAR* ResultPointer = NULL; - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - /* A straight copy, the values should be equal. */ - ResultPointer = lstrcpyn(ResultBuffer,FirstString,3); - - /* Make sure the returned pointer is to the result buffer */ - if(ResultPointer != &ResultBuffer[0]) - { - Fail("ERROR: The function didn't return a pointer which points to the " - "location of the buffer which was copied into.\n"); - } - - /* Check to see that values are equal */ - if(memcmp(ResultBuffer, - CorrectBuffer, - wcslen(ResultBuffer)*sizeof(WCHAR)) != 0) - { - Fail("ERROR: '%s' was the result and it should have been '%s' when " - "this copy was performed.\n", - convertC(ResultBuffer),convertC(CorrectBuffer)); - } - - /* Null values should get Null results */ - if(lstrcpyn(ResultBuffer,NULL,3) != NULL) - { - Fail("ERROR: When the second parameter was set to NULL, the return " - "value should have been NULL, but it was not.\n"); - } - - if(lstrcpyn(NULL,FirstString,3) != NULL) - { - Fail("ERROR: When the first parameter was set to NULL, the return " - "value should have been NULL, but it was not.\n"); - } - - - PAL_Terminate(); - return PASS; -} - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/testinfo.dat deleted file mode 100644 index 111a579..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = lstrcpynW -Name = Positive test of lstrcpynW -TYPE = DEFAULT -EXE1 = test -Description -= Ensure that a copy of a string works, and that the return values -= are correct for success and failure. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/CMakeLists.txt deleted file mode 100644 index f40d415..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -add_subdirectory(test1) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/CMakeLists.txt deleted file mode 100644 index 9818961..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfa_test1 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfa_test1 coreclrpal) - -target_link_libraries(paltest_wsprintfa_test1 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/test.cpp deleted file mode 100644 index 7222709..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/test.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfA() function -** -** -**=========================================================*/ - -#include - - char * ErrorMessage; - char buf[256]; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -int test1() -{ - char checkstr[] = "hello world"; - - wsprintf(buf, "hello world"); - - /* Error message */ - ErrorMessage = "ERROR: (Test 1) Failed on 'hello world' test. The " - "correct string is 'hello world' and the result returned was "; - - return (memcmp(checkstr, buf, strlen(checkstr)+1) != 0); -} - -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,buf); - } - - PAL_Terminate(); - return PASS; - -} - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/testinfo.dat deleted file mode 100644 index c06f4c0..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfA -Name = Positive test of wsprintfA -TYPE = DEFAULT -EXE1 = test -Description -= Test the very basic functionality of wsprintf. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/CMakeLists.txt deleted file mode 100644 index b7a4610..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfa_test11 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfa_test11 coreclrpal) - -target_link_libraries(paltest_wsprintfa_test11 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/test.cpp deleted file mode 100644 index b43299a..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/test.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfA() function -** -** -**=========================================================*/ - -#include - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -char * ErrorMessage; -char buf[256]; - -BOOL test1() -{ - int pos = 42; - - - /* Test 1 */ - wsprintf(buf, "foo %u", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - /* Test 2 */ - wsprintf(buf, "foo %lu", 0xFFFF); - if (memcmp(buf, "foo 65535", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is " - "'foo 65535' and the result returned was "; - return FAIL; - } - - /* Test 3 */ - wsprintf(buf, "foo %hu", 0xFFFF); - if (memcmp(buf, "foo 65535", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is " - "'foo 65535' and the result returned was "; - return FAIL; - } - - /* Test 4 */ - wsprintf(buf, "foo %3u", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - /* Test 5 */ - wsprintf(buf, "foo %-3u", pos); - if (memcmp(buf, "foo 42 ", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - /* Test 6 */ - wsprintf(buf, "foo %.1u", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - /* Test 7 */ - wsprintf(buf, "foo %.3u", pos); - if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is " - "'foo 042' and the result returned was "; - return FAIL; - } - - /* Test 8 */ - wsprintf(buf, "foo %03u", pos); - if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is " - "'foo 042' and the result returned was "; - return FAIL; - } - - /* Test 9 */ - wsprintf(buf, "foo %#u", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 9) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - return PASS; -} - - -int __cdecl main(int argc, char *argv[]) -{ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s'%s'\n",ErrorMessage,buf); - } - - PAL_Terminate(); - return PASS; -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/testinfo.dat deleted file mode 100644 index c5f1ec1..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfA -Name = Positive test of wsprintfA -TYPE = DEFAULT -EXE1 = test -Description -= Test the %u formatter. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/CMakeLists.txt deleted file mode 100644 index 757cb6f..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfa_test12 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfa_test12 coreclrpal) - -target_link_libraries(paltest_wsprintfa_test12 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/test.cpp deleted file mode 100644 index dcc6101..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/test.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfA() function -** -** -**=========================================================*/ - -#include - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -char * ErrorMessage; -char buf[256]; - -BOOL test1() -{ - int pos = 0x1234ab; - - /* Test 1 */ - wsprintf(buf, "foo %x", pos); - if (memcmp(buf, "foo 1234ab", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct " - "string is 'foo 1234ab' and the result returned was "; - return FAIL; - } - - /* Test 2 */ - wsprintf(buf, "foo %lx", pos); - if (memcmp(buf, "foo 1234ab", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct " - "string is 'foo 1234ab' and the result returned was "; - return FAIL; - } - - - /* Test 3 */ - wsprintf(buf, "foo %7x", pos); - if (memcmp(buf, "foo 1234ab", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is " - "'foo 1234ab' and the result returned was "; - return FAIL; - } - - /* Test 4 */ - wsprintf(buf, "foo %-7x", pos); - if (memcmp(buf, "foo 1234ab ", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is " - "'foo 1234ab' and the result returned was "; - return FAIL; - } - - /* Test 5 */ - wsprintf(buf, "foo %.1x", pos); - if (memcmp(buf, "foo 1234ab", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is " - "'foo 1234ab' and the result returned was "; - return FAIL; - } - - /* Test 6 */ - wsprintf(buf, "foo %.7x", pos); - if (memcmp(buf, "foo 01234ab", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is " - "'foo 01234ab' and the result returned was "; - return FAIL; - } - - /* Test 7 */ - wsprintf(buf, "foo %07x", pos); - if (memcmp(buf, "foo 01234ab", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is " - "'foo 01234ab' and the result returned was "; - return FAIL; - } - - /* Test 8 */ - wsprintf(buf, "foo %#x", pos); - if (memcmp(buf, "foo 0x1234ab", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is " - "'foo 0x1234ab' and the result returned was "; - return FAIL; - } - - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,buf); - } - - PAL_Terminate(); - return PASS; -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/testinfo.dat deleted file mode 100644 index 71c8386..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfA -Name = Positive test of wsprintfA -TYPE = DEFAULT -EXE1 = test -Description -= Test the %x formatter. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/CMakeLists.txt deleted file mode 100644 index 5d3550a..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfa_test13 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfa_test13 coreclrpal) - -target_link_libraries(paltest_wsprintfa_test13 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/test.cpp deleted file mode 100644 index e1f7d80..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/test.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfA() function -** -** -**=========================================================*/ - -#include - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -char * ErrorMessage; -char buf[256]; - -BOOL test1() -{ - int pos = 0x1234ab; - - /* Test 1 */ - wsprintf(buf, "foo %X", pos); - if (memcmp(buf, "foo 1234AB", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is " - " 'foo 1234AB' and the result returned was "; - return FAIL; - } - - /* Test 2 */ - wsprintf(buf, "foo %lX", pos); - if (memcmp(buf, "foo 1234AB", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is " - "'foo 1234AB' and the result returned was "; - return FAIL; - } - - - /* Test 3 */ - wsprintf(buf, "foo %7X", pos); - if (memcmp(buf, "foo 1234AB", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is " - "'foo 1234AB' and the result returned was "; - return FAIL; - } - - /* Test 4 */ - wsprintf(buf, "foo %-7X", pos); - if (memcmp(buf, "foo 1234AB ", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is " - "'foo 1234AB' and the result returned was "; - return FAIL; - } - - /* Test 5 */ - wsprintf(buf, "foo %.1X", pos); - if (memcmp(buf, "foo 1234AB", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is " - "'foo 1234AB' and the result returned was "; - return FAIL; - } - - /* Test 6 */ - wsprintf(buf, "foo %.7X", pos); - if (memcmp(buf, "foo 01234AB", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is " - "'foo 01234AB' and the result returned was "; - return FAIL; - } - - /* Test 7 */ - wsprintf(buf, "foo %07X", pos); - if (memcmp(buf, "foo 01234AB", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is " - "'foo 01234AB' and the result returned was "; - return FAIL; - } - - /* Test 8 */ - wsprintf(buf, "foo %#X", pos); - if (memcmp(buf, "foo 0X1234AB", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is " - "'foo 0X1234AB' and the result returned was "; - return FAIL; - } - - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,buf); - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/testinfo.dat deleted file mode 100644 index 0e0d1b4..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfA -Name = Positive test of wsprintfA -TYPE = DEFAULT -EXE1 = test -Description -= Test the %X formatter. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/CMakeLists.txt deleted file mode 100644 index 4129e9a..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfa_test2 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfa_test2 coreclrpal) - -target_link_libraries(paltest_wsprintfa_test2 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/test.cpp deleted file mode 100644 index b879e54..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/test.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfA() function -** -** -**=========================================================*/ - -#include - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -char * ErrorMessage; -char * BadResult; -char buf[256]; - -BOOL test1() -{ - - - /* Test 1 */ - wsprintf(buf, "foo %s", "bar"); - if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is " - "'foo bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - - /* Test 2 */ - wsprintf(buf, "foo %hs", "bar"); - if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is " - "'foo bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - - - /* Test 3 */ - wsprintf(buf, "foo %5s", "bar"); - if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is " - "'foo bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - - /* Test 4 */ - wsprintf(buf, "foo %.2s", "bar"); - if (memcmp(buf, "foo ba", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is " - "'foo ba' and the result returned was "; - BadResult = buf; - return FAIL; - } - - /* Test 5 */ - wsprintf(buf, "foo %5.2s", "bar"); - if (memcmp(buf, "foo ba", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is " - "'foo ba' and the result returned was "; - BadResult = buf; - return FAIL; - } - - /* Test 6 */ - wsprintf(buf, "foo %-5s", "bar"); - if (memcmp(buf, "foo bar ", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is " - "'foo bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - - /* Test 7 */ - wsprintf(buf, "foo %05s", "bar"); - if (memcmp(buf, "foo 00bar", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is " - "'foo 00bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - return PASS; -} - - -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,BadResult); - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/testinfo.dat deleted file mode 100644 index 32e51df..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfA -Name = Positive test of wsprintfA -TYPE = DEFAULT -EXE1 = test -Description -= Test the %s and %ls formatters with various flags. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/CMakeLists.txt deleted file mode 100644 index 1b6b76f..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfa_test3 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfa_test3 coreclrpal) - -target_link_libraries(paltest_wsprintfa_test3 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/test.cpp deleted file mode 100644 index bb598d9..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/test.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfA() function -** -** -**=========================================================*/ - -#include - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -char * ErrorMessage; -char buf[256]; - -BOOL test1() -{ - - /* Test 1 */ - wsprintf(buf, "foo %S", convert("bar")); - if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is " - "'foo bar' and the result returned was "; - return FAIL; - } - - /* Test 2 */ - wsprintf(buf, "foo %hS", "bar"); - if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is " - "'foo bar' and the result returned was "; - return FAIL; - } - - /* Test 3 */ - wsprintf(buf, "foo %lS", convert("bar")); - if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is '" - "foo bar' and the result returned was "; - return FAIL; - } - - - /* Test 4 */ - wsprintf(buf, "foo %5S", convert("bar")); - if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is " - "'foo bar' and the result returned was "; - return FAIL; - } - - /* Test 5 */ - wsprintf(buf, "foo %.2S", convert("bar")); - if (memcmp(buf, "foo ba", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is " - "'foo ba' and the result returned was "; - return FAIL; - } - - /* Test 6 */ - wsprintf(buf, "foo %5.2S", convert("bar")); - if (memcmp(buf, "foo ba", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is " - "'foo ba' and the result returned was "; - return FAIL; - } - - /* Test 7 */ - wsprintf(buf, "foo %-5S", convert("bar")); - if (memcmp(buf, "foo bar ", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is " - "'foo bar ' and the result returned was "; - return FAIL; - } - - /* Test 8 */ - wsprintf(buf, "foo %05S", convert("bar")); - if (memcmp(buf, "foo 00bar", strlen(buf) + 1) != 0) { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is " - "'foo 00bar' and the result returned was "; - return FAIL; - } - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) { - Fail("%s '%s'\n",ErrorMessage,buf); - - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/testinfo.dat deleted file mode 100644 index 0660aa1..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfA -Name = Positive test of wsprintfA -TYPE = DEFAULT -EXE1 = test -Description -= Test the %S and wide characters in general. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/CMakeLists.txt deleted file mode 100644 index 2262e37..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfa_test6 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfa_test6 coreclrpal) - -target_link_libraries(paltest_wsprintfa_test6 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/test.cpp deleted file mode 100644 index 08d97f4..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/test.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfA() function -** -** -**=========================================================*/ - -#include - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -char * ErrorMessage; -char buf[256]; - -BOOL test1() -{ - WCHAR wc = 'c'; - - /* Test 1 */ - wsprintf(buf, "foo %c", 'b'); - if (memcmp(buf, "foo b", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is " - "'foo b' and the result returned was "; - return FAIL; - } - - /* Test 2 */ - wsprintf(buf, "foo %hc", 'b'); - if (memcmp(buf, "foo b", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is " - "'foo b' and the result returned was "; - return FAIL; - } - - /* Test 3 */ - wsprintf(buf, "foo %lc", wc); - if (memcmp(buf, "foo c", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is " - "'foo c' and the result returned was "; - return FAIL; - } - - - /* Test 4 */ - wsprintf(buf, "foo %5c", 'b'); - if (memcmp(buf, "foo b", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is " - "'foo bar' and the result returned was "; - return FAIL; - } - - /* Test 5 */ - wsprintf(buf, "foo %-5c", 'b'); - if (memcmp(buf, "foo b ", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is " - "'foo b ' and the result returned was "; - return FAIL; - } - - /* Test 6 */ - wsprintf(buf, "foo %05c", 'b'); - if (memcmp(buf, "foo 0000b", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is " - "'foo 0000b' and the result returned was "; - return FAIL; - } - - /* Test 7 */ - wsprintf(buf, "foo %#c", 'b'); - if (memcmp(buf, "foo b", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is " - "'foo b' and the result returned was "; - return FAIL; - } - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,buf); - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/testinfo.dat deleted file mode 100644 index 31b0f66..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfA -Name = Positive test of wsprintfA -TYPE = DEFAULT -EXE1 = test -Description -= Test the %c formatter. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/CMakeLists.txt deleted file mode 100644 index f554088..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfa_test7 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfa_test7 coreclrpal) - -target_link_libraries(paltest_wsprintfa_test7 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/test.cpp deleted file mode 100644 index 6d380ef..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/test.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfA() function -** -** -**=========================================================*/ - -#include - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -char * ErrorMessage; -char buf[256]; - -BOOL test1() -{ - WCHAR wb = 'b'; - - /* Test 1 */ - wsprintf(buf, "foo %C", wb); - if (memcmp(buf, "foo b", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is " - "'foo b' and the result returned was "; - return FAIL; - } - - /* Test 2 */ - wsprintf(buf, "foo %hC", wb); - if (memcmp(buf, "foo b", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is " - "'foo b' and the result returned was "; - return FAIL; - } - - /* Test 3 */ - wsprintf(buf, "foo %lC", 'c'); - if (memcmp(buf, "foo c", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is " - "'foo c' and the result returned was "; - return FAIL; - } - - - /* Test 4 */ - wsprintf(buf, "foo %5C", wb); - if (memcmp(buf, "foo b", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is " - "'foo b' and the result returned was "; - return FAIL; - } - - /* Test 5 */ - wsprintf(buf, "foo %-5C", wb); - if (memcmp(buf, "foo b ", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is " - "'foo b ' and the result returned was "; - return FAIL; - } - - /* Test 6 */ - wsprintf(buf, "foo %05C", wb); - if (memcmp(buf, "foo 0000b", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is " - "'foo 0000b' and the result returned was "; - return FAIL; - } - - /* Test 7 */ - wsprintf(buf, "foo %#C", wb); - if (memcmp(buf, "foo b", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is " - "'foo b' and the result returned was "; - return FAIL; - } - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,buf); - - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/testinfo.dat deleted file mode 100644 index 31b0f66..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfA -Name = Positive test of wsprintfA -TYPE = DEFAULT -EXE1 = test -Description -= Test the %c formatter. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/CMakeLists.txt deleted file mode 100644 index 9b522c4..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfa_test8 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfa_test8 coreclrpal) - -target_link_libraries(paltest_wsprintfa_test8 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/test.cpp deleted file mode 100644 index 7367461..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/test.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfA() function -** -** -**=========================================================*/ - -#include - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -char * ErrorMessage; -char buf[256]; - -BOOL test1() -{ - int pos = 42; - - /* Test 1 */ - wsprintf(buf, "foo %d", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - /* Test 2 */ - wsprintf(buf, "foo %ld", 0xFFFF); - if (memcmp(buf, "foo 65535", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is " - "'foo 65535' and the result returned was "; - return FAIL; - } - - /* Test 3 */ - wsprintf(buf, "foo %3d", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - /* Test 4 */ - wsprintf(buf, "foo %-3d", pos); - if (memcmp(buf, "foo 42 ", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is " - "'foo 42 ' and the result returned was "; - return FAIL; - } - - /* Test 5 */ - wsprintf(buf, "foo %.1d", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - /* Test 6 */ - wsprintf(buf, "foo %.3d", pos); - if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is " - "'foo 042' and the result returned was "; - return FAIL; - } - - /* Test 7 */ - wsprintf(buf, "foo %03d", pos); - if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is " - "'foo 042' and the result returned was "; - return FAIL; - } - - /* Test 8 */ - wsprintf(buf, "foo %#d", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,buf); - } - - PAL_Terminate(); - return PASS; - -} - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/testinfo.dat deleted file mode 100644 index 75f4fbf..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfA -Name = Positive test of wsprintfA -TYPE = DEFAULT -EXE1 = test -Description -= Test the %d formatter. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/CMakeLists.txt deleted file mode 100644 index c26eb59..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfa_test9 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfa_test9 coreclrpal) - -target_link_libraries(paltest_wsprintfa_test9 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/test.cpp deleted file mode 100644 index 9f123bc..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/test.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfA() function -** -** -**=========================================================*/ - -#include - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -char * ErrorMessage; -char buf[256]; - -BOOL test1() -{ - - int pos = 42; - - - /* Test 1 */ - wsprintf(buf, "foo %i", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - /* Test 2 */ - wsprintf(buf, "foo %li", 0xFFFF); - if (memcmp(buf, "foo 65535", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is " - "'foo 65535' and the result returned was "; - return FAIL; - } - - - /* Test 3 */ - wsprintf(buf, "foo %3i", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - /* Test 4 */ - wsprintf(buf, "foo %-3i", pos); - if (memcmp(buf, "foo 42 ", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is " - "'foo 42 ' and the result returned was "; - return FAIL; - } - - /* Test 5 */ - wsprintf(buf, "foo %.1i", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - /* Test 6 */ - wsprintf(buf, "foo %.3i", pos); - if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is " - "'foo 042' and the result returned was "; - return FAIL; - } - - /* Test 7 */ - wsprintf(buf, "foo %03i", pos); - if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is " - "'foo 042' and the result returned was "; - return FAIL; - } - - /* Test 8 */ - wsprintf(buf, "foo %#i", pos); - if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is " - "'foo 42' and the result returned was "; - return FAIL; - } - - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,buf); - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/testinfo.dat deleted file mode 100644 index 2a3689e..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfA -Name = Positive test of wsprintfA -TYPE = DEFAULT -EXE1 = test -Description -= Test the %i formatter. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/CMakeLists.txt deleted file mode 100644 index f40d415..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -add_subdirectory(test1) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/CMakeLists.txt deleted file mode 100644 index c5d1e40..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfw_test1 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfw_test1 coreclrpal) - -target_link_libraries(paltest_wsprintfw_test1 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/test.cpp deleted file mode 100644 index 700cb13..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/test.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfW() function -** -** -**=========================================================*/ - -#define UNICODE -#include - - -char * ErrorMessage = NULL; -WCHAR * BadResult = NULL; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - - -BOOL test1() -{ - char checkstr[] = "hello world"; - - WCHAR buf[256]; - - /* Test a simple string */ - wsprintf(buf, convert("hello world")); - - /* Error message */ - ErrorMessage = "ERROR: (Test 1) Failed on 'hello world' test. " - "The correct string is 'hello world' and the result returned was "; - BadResult = buf; - - return (memcmp(convert(checkstr), buf, wcslen(buf)*2+2) != 0); -} - -int __cdecl main(int argc, char *argv[]) { - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) { - Fail("%s '%s'\n",ErrorMessage,convertC(BadResult)); - - } - - PAL_Terminate(); - return PASS; - -} - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/testinfo.dat deleted file mode 100644 index f36aced..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfW -Name = Positive test of wsprintfW -TYPE = DEFAULT -EXE1 = test -Description -= Test the very basic functionality of wsprintfW. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/CMakeLists.txt deleted file mode 100644 index 37a79ed..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfw_test11 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfw_test11 coreclrpal) - -target_link_libraries(paltest_wsprintfw_test11 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/test.cpp deleted file mode 100644 index dc1e7a7..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/test.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfW() function -** -** -**=========================================================*/ - -#define UNICODE -#include - - - -char * ErrorMessage = NULL; -WCHAR * BadResult = NULL; -WCHAR buf[256]; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - - -BOOL test1() -{ - - int pos = 42; - - wsprintf(buf, convert("foo %u"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %lu"), 0xFFFF); - if (memcmp(buf, convert("foo 65535"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is" - " 'foo 65535' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %hu"), 0xFFFF); - if (memcmp(buf, convert("foo 65535"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is" - " 'foo 65535' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %3u"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %-3u"), pos); - if (memcmp(buf, convert("foo 42 "), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is" - " 'foo 42 ' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.1u"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.3u"), pos); - if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is" - " 'foo 042' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %03u"), pos); - if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is" - " 'foo 042' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %#u"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 9) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,convertC(BadResult)); - - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/testinfo.dat deleted file mode 100644 index bb85d63..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfW -Name = Positive test of wsprintfW -TYPE = DEFAULT -EXE1 = test -Description -= Test %u formatter with wsprintfW. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/CMakeLists.txt deleted file mode 100644 index 5797166..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfw_test12 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfw_test12 coreclrpal) - -target_link_libraries(paltest_wsprintfw_test12 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/test.cpp deleted file mode 100644 index 6ba456b..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/test.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfW() function -** -** -**=========================================================*/ - -#define UNICODE -#include - - -char * ErrorMessage = NULL; -WCHAR * BadResult = NULL; -WCHAR buf[256]; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -BOOL test1() -{ - int pos = 0x1234ab; - - wsprintf(buf, convert("foo %x"), pos); - if (memcmp(buf, convert("foo 1234ab"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is" - " 'foo 1234ab' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %lx"), pos); - if (memcmp(buf, convert("foo 1234ab"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is" - " 'foo 1234ab' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %7x"), pos); - if (memcmp(buf, convert("foo 1234ab"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is" - " 'foo 1234ab' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %-7x"), pos); - if (memcmp(buf, convert("foo 1234ab "), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is" - " 'foo 1234ab ' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.1x"), pos); - if (memcmp(buf, convert("foo 1234ab"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is" - " 'foo 1234ab' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.7x"), pos); - if (memcmp(buf, convert("foo 01234ab"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is" - " 'foo 01234ab' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %07x"), pos); - if (memcmp(buf, convert("foo 01234ab"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is" - " 'foo 01234ab' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %#x"), pos); - if (memcmp(buf, convert("foo 0x1234ab"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is" - " 'foo 0x1234ab' and the result returned was "; - BadResult = buf; - return FAIL; - } - - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,convertC(BadResult)); - - } - - PAL_Terminate(); - return PASS; - -} - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/testinfo.dat deleted file mode 100644 index 0d38a20..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfW -Name = Positive test of wsprintfW -TYPE = DEFAULT -EXE1 = test -Description -= Test %x formatter with wsprintfW. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/CMakeLists.txt deleted file mode 100644 index 73a08b6..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfw_test13 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfw_test13 coreclrpal) - -target_link_libraries(paltest_wsprintfw_test13 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/test.cpp deleted file mode 100644 index dd0daae..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/test.cpp +++ /dev/null @@ -1,126 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfW() function -** -** -**=========================================================*/ - -#define UNICODE -#include - -char * ErrorMessage = NULL; -WCHAR * BadResult = NULL; -WCHAR buf[256]; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -BOOL test1() -{ - int pos = 0x1234ab; - - wsprintf(buf, convert("foo %X"), pos); - if (memcmp(buf, convert("foo 1234AB"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is" - " 'foo 1234AB' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %lX"), pos); - if (memcmp(buf, convert("foo 1234AB"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is" - " 'foo 1234AB' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %7X"), pos); - if (memcmp(buf, convert("foo 1234AB"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is" - " 'foo 1234AB' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %-7X"), pos); - if (memcmp(buf, convert("foo 1234AB "), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is" - " 'foo 1234AB ' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.1X"), pos); - if (memcmp(buf, convert("foo 1234AB"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is" - " 'foo 1234AB' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.7X"), pos); - if (memcmp(buf, convert("foo 01234AB"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is" - " 'foo 01234AB' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %07X"), pos); - if (memcmp(buf, convert("foo 01234AB"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is" - " 'foo 01234AB' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %#X"), pos); - if (memcmp(buf, convert("foo 0X1234AB"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is" - " 'foo 0X1234AB' and the result returned was "; - BadResult = buf; - return FAIL; - } - - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,convertC(BadResult)); - - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/testinfo.dat deleted file mode 100644 index c16a43f..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfW -Name = Positive test of wsprintfW -TYPE = DEFAULT -EXE1 = test -Description -= Test %X formatter with wsprintfW. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/CMakeLists.txt deleted file mode 100644 index 6412871..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfw_test2 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfw_test2 coreclrpal) - -target_link_libraries(paltest_wsprintfw_test2 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/test.cpp deleted file mode 100644 index f25ab6c..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/test.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfW() function -** -** -**=========================================================*/ -#define UNICODE -#include - - -char * ErrorMessage = NULL; -WCHAR * BadResult = NULL; -WCHAR buf[256]; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - - -BOOL test1() -{ - - wsprintf(buf, convert("foo %s"), convert("bar")); - if (memcmp(buf, convert("foo bar"), wcslen(buf)*2+2) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is 'foo bar'" - " and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %ls"), convert("bar")); - if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0){ - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is 'foo bar'" - " and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %5s"), convert("bar")); - if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is" - " 'foo bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - wsprintf(buf, convert("foo %.2s"), convert("bar")); - if (memcmp(buf, convert("foo ba"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is 'foo ba'" - " and the result returned was "; - BadResult = buf; - return FAIL; - } - wsprintf(buf, convert("foo %5.2s"), convert("bar")); - if (memcmp(buf, convert("foo ba"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is" - " 'foo ba' and the result returned was "; - BadResult = buf; - return FAIL; - } - wsprintf(buf, convert("foo %-5s"), convert("bar")); - if (memcmp(buf, convert("foo bar "), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is" - " 'foo bar ' and the result returned was "; - BadResult = buf; - return FAIL; - } - wsprintf(buf, convert("foo %05s"), convert("bar")); - if (memcmp(buf, convert("foo 00bar"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is" - " 'foo 00bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,convertC(BadResult)); - } - - PAL_Terminate(); - return PASS; - -} diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/testinfo.dat deleted file mode 100644 index a2a7bb2..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfW -Name = Positive test of wsprintfW -TYPE = DEFAULT -EXE1 = test -Description -= Test %s formatter with wsprintfW. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/CMakeLists.txt deleted file mode 100644 index f7ea0d4..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfw_test3 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfw_test3 coreclrpal) - -target_link_libraries(paltest_wsprintfw_test3 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/test.cpp deleted file mode 100644 index a52d617..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/test.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfW() function -** -** -**=========================================================*/ -#define UNICODE -#include - - - -char * ErrorMessage = NULL; -WCHAR * BadResult = NULL; -WCHAR buf[256]; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - - -BOOL test1() -{ - - wsprintf(buf, convert("foo %S"), "bar"); - if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is" - " 'foo bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %hS"), "bar"); - if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is" - " 'foo bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %lS"), convert("bar")); - if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is" - " 'foo bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %5S"), "bar"); - if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is" - " 'foo bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.2S"), "bar"); - if (memcmp(buf, convert("foo ba"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is" - " 'foo ba' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %5.2S"), "bar"); - if (memcmp(buf, convert("foo ba"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is" - " 'foo ba' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %-5S"), "bar"); - if (memcmp(buf, convert("foo bar "), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is" - " 'foo bar ' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %05S"), "bar"); - if (memcmp(buf, convert("foo 00bar"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is" - " 'foo 00bar' and the result returned was "; - BadResult = buf; - return FAIL; - } - - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,convertC(BadResult)); - - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/testinfo.dat deleted file mode 100644 index 46b7b74..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfW -Name = Positive test of wsprintfW -TYPE = DEFAULT -EXE1 = test -Description -= Test %S formatter with wsprintfW. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/CMakeLists.txt deleted file mode 100644 index f0df7a3..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfw_test6 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfw_test6 coreclrpal) - -target_link_libraries(paltest_wsprintfw_test6 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/test.cpp deleted file mode 100644 index 513f1f7..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/test.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfW() function -** -** -**=========================================================*/ -#define UNICODE -#include - - -char * ErrorMessage = NULL; -WCHAR * BadResult = NULL; -WCHAR buf[256]; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - -BOOL test1() -{ - WCHAR wc = 'b'; - - wsprintf(buf, convert("foo %c"), wc); - if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is" - " 'foo b' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %hc"), wc); - if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is 'foo b'" - " and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %lc"), wc); - if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is 'foo b'" - " and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %5c"), wc); - if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is" - " 'foo b' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %-5c"), wc); - if (memcmp(buf, convert("foo b "), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is" - " 'foo b ' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %05c"), wc); - if (memcmp(buf, convert("foo 0000b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is" - " 'foo 0000b' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %#c"), wc); - if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is 'foo b'" - " and the result returned was "; - BadResult = buf; - return FAIL; - } - return PASS; -} -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,convertC(BadResult)); - - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/testinfo.dat deleted file mode 100644 index 627b76f..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfW -Name = Positive test of wsprintfW -TYPE = DEFAULT -EXE1 = test -Description -= Test %c formatter with wsprintfW. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/CMakeLists.txt deleted file mode 100644 index 0a97aa7..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfw_test7 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfw_test7 coreclrpal) - -target_link_libraries(paltest_wsprintfw_test7 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/test.cpp deleted file mode 100644 index 99e73b1..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/test.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfW() function -** -** -**=========================================================*/ -#define UNICODE -#include - - - -char * ErrorMessage = NULL; -WCHAR * BadResult = NULL; -WCHAR buf[256]; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - - -BOOL test1() -{ - WCHAR wb = 'b'; - - wsprintf(buf, convert("foo %C"), 'b'); - if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is" - " 'foo b' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %hC"), 'b'); - if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is" - " 'foo b' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %lC"), wb); - if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is" - " 'foo b' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %5C"), 'b'); - if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is" - " 'foo b' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %-5C"), 'b'); - if (memcmp(buf, convert("foo b "), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is" - " 'foo b ' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %05C"), 'b'); - if (memcmp(buf, convert("foo 0000b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is" - " 'foo 0000b' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %#C"), 'b'); - if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is" - " 'foo b' and the result returned was "; - BadResult = buf; - return FAIL; - } - return PASS; -} -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,convertC(BadResult)); - - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/testinfo.dat deleted file mode 100644 index ffcb47a..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfW -Name = Positive test of wsprintfW -TYPE = DEFAULT -EXE1 = test -Description -= Test %C formatter with wsprintfW. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/CMakeLists.txt deleted file mode 100644 index dfabec4..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfw_test8 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfw_test8 coreclrpal) - -target_link_libraries(paltest_wsprintfw_test8 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/test.cpp deleted file mode 100644 index 63c296e..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/test.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfW() function -** -** -**=========================================================*/ -#define UNICODE -#include - - - -char * ErrorMessage = NULL; -WCHAR * BadResult = NULL; -WCHAR buf[256]; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - - -BOOL test1() -{ - int pos = 42; - - wsprintf(buf, convert("foo %d"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %ld"), 0xFFFF); - if (memcmp(buf, convert("foo 65535"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is" - " 'foo 65535' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %3d"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %-3d"), pos); - if (memcmp(buf, convert("foo 42 "), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is" - " 'foo 42 ' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.1d"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.3d"), pos); - if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is" - " 'foo 042' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %03d"), pos); - if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is" - " 'foo 042' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %#d"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - return PASS; -} -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,convertC(BadResult)); - - } - - PAL_Terminate(); - return PASS; - -} - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/testinfo.dat deleted file mode 100644 index 4238671..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfW -Name = Positive test of wsprintfW -TYPE = DEFAULT -EXE1 = test -Description -= Test %d formatter with wsprintfW. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/CMakeLists.txt deleted file mode 100644 index 9a573b0..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_wsprintfw_test9 - ${SOURCES} -) - -add_dependencies(paltest_wsprintfw_test9 coreclrpal) - -target_link_libraries(paltest_wsprintfw_test9 - pthread - m - coreclrpal -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/test.cpp deleted file mode 100644 index 0a49d9c..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/test.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for wsprintfW() function -** -** -**=========================================================*/ - -#define UNICODE -#include - - -char * ErrorMessage = NULL; -WCHAR * BadResult = NULL; -WCHAR buf[256]; - -/* memcmp is used to verify the results, so this test is dependent on it. */ -/* ditto with strlen */ - - -BOOL test1() -{ - int pos = 42; - - wsprintf(buf, convert("foo %i"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 1) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %li"), 0xFFFF); - if (memcmp(buf, convert("foo 65535"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 2) Failed. The correct string is" - " 'foo 65535' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %3i"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 3) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %-3i"), pos); - if (memcmp(buf, convert("foo 42 "), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 4) Failed. The correct string is" - " 'foo 42 ' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.1i"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 5) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %.3i"), pos); - if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 6) Failed. The correct string is" - " 'foo 042' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %03i"), pos); - if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 7) Failed. The correct string is" - " 'foo 042' and the result returned was "; - BadResult = buf; - return FAIL; - } - - wsprintf(buf, convert("foo %#i"), pos); - if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0) - { - ErrorMessage = "ERROR: (Test 8) Failed. The correct string is" - " 'foo 42' and the result returned was "; - BadResult = buf; - return FAIL; - } - - return PASS; -} - -int __cdecl main(int argc, char *argv[]) -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if(test1()) - { - Fail("%s '%s'\n",ErrorMessage,convertC(BadResult)); - - } - - PAL_Terminate(); - return PASS; - -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/testinfo.dat deleted file mode 100644 index 3006aa8..0000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = wsprintfW -Name = Positive test of wsprintfW -TYPE = DEFAULT -EXE1 = test -Description -= Test %i formatter with wsprintfW. - - diff --git a/src/coreclr/src/pal/tests/palsuite/paltestlist.txt b/src/coreclr/src/pal/tests/palsuite/paltestlist.txt index 9866f29..f7597f8 100644 --- a/src/coreclr/src/pal/tests/palsuite/paltestlist.txt +++ b/src/coreclr/src/pal/tests/palsuite/paltestlist.txt @@ -692,12 +692,6 @@ miscellaneous/InterlockedIncrement/test1/paltest_interlockedincrement_test1 miscellaneous/InterlockedIncrement/test2/paltest_interlockedincrement_test2 miscellaneous/InterlockedIncrement64/test1/paltest_interlockedincrement64_test1 miscellaneous/InterlockedIncrement64/test2/paltest_interlockedincrement64_test2 -miscellaneous/lstrcatW/test1/paltest_lstrcatw_test1 -miscellaneous/lstrcatW/test2/paltest_lstrcatw_test2 -miscellaneous/lstrcatW/test3/paltest_lstrcatw_test3 -miscellaneous/lstrcatW/test4/paltest_lstrcatw_test4 -miscellaneous/lstrcpynW/test1/paltest_lstrcpynw_test1 -miscellaneous/lstrcpyW/test1/paltest_lstrcpyw_test1 miscellaneous/lstrlenA/test1/paltest_lstrlena_test1 miscellaneous/lstrlenW/test1/paltest_lstrlenw_test1 miscellaneous/queryperformancecounter/test1/paltest_queryperformancecounter_test1 @@ -711,24 +705,6 @@ miscellaneous/SetEnvironmentVariableW/test2/paltest_setenvironmentvariablew_test miscellaneous/SetEnvironmentVariableW/test3/paltest_setenvironmentvariablew_test3 miscellaneous/SetEnvironmentVariableW/test4/paltest_setenvironmentvariablew_test4 miscellaneous/SetLastError/test1/paltest_setlasterror_test1 -miscellaneous/wsprintfA/test1/paltest_wsprintfa_test1 -miscellaneous/wsprintfA/test11/paltest_wsprintfa_test11 -miscellaneous/wsprintfA/test12/paltest_wsprintfa_test12 -miscellaneous/wsprintfA/test13/paltest_wsprintfa_test13 -miscellaneous/wsprintfA/test2/paltest_wsprintfa_test2 -miscellaneous/wsprintfA/test3/paltest_wsprintfa_test3 -miscellaneous/wsprintfA/test6/paltest_wsprintfa_test6 -miscellaneous/wsprintfA/test7/paltest_wsprintfa_test7 -miscellaneous/wsprintfA/test8/paltest_wsprintfa_test8 -miscellaneous/wsprintfA/test9/paltest_wsprintfa_test9 -miscellaneous/wsprintfW/test1/paltest_wsprintfw_test1 -miscellaneous/wsprintfW/test11/paltest_wsprintfw_test11 -miscellaneous/wsprintfW/test12/paltest_wsprintfw_test12 -miscellaneous/wsprintfW/test13/paltest_wsprintfw_test13 -miscellaneous/wsprintfW/test3/paltest_wsprintfw_test3 -miscellaneous/wsprintfW/test6/paltest_wsprintfw_test6 -miscellaneous/wsprintfW/test8/paltest_wsprintfw_test8 -miscellaneous/wsprintfW/test9/paltest_wsprintfw_test9 miscellaneous/_i64tow/test1/paltest_i64tow_test1 pal_specific/pal_entrypoint/test1/paltest_pal_entrypoint_test1 pal_specific/PAL_errno/test1/paltest_pal_errno_test1 diff --git a/src/coreclr/src/palrt/path.cpp b/src/coreclr/src/palrt/path.cpp index 1d610cd..fc01183 100644 --- a/src/coreclr/src/palrt/path.cpp +++ b/src/coreclr/src/palrt/path.cpp @@ -11,7 +11,7 @@ // =========================================================================== #include "common.h" - +#include "strsafe.h" #define CH_SLASH W('/') @@ -355,7 +355,8 @@ STDAPI_(BOOL) PathCanonicalizeW(LPWSTR lpszDst, LPCWSTR lpszSrc) else // Everything else { // Just copy it. - lstrcpynW(lpchDst, lpchSrc, cchPC); + int cchRemainingBuffer = MAX_PATH - (lpszDst - lpchDst); + StringCchCopyNW(lpchDst, cchRemainingBuffer, lpchSrc, cchPC); lpchDst += cchPC - 1; lpchSrc += cchPC - 1; } @@ -429,11 +430,12 @@ STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) { if (!lpszFile || *lpszFile==W('\0')) { - lstrcpynW(szTemp, lpszDir, ARRAYSIZE(szTemp)); // lpszFile is empty + // lpszFile is empty + StringCchCopyNW(szTemp, ARRAYSIZE(szTemp), lpszDir, ARRAYSIZE(szTemp)); } else if (PathIsRelativeW(lpszFile)) { - lstrcpynW(szTemp, lpszDir, ARRAYSIZE(szTemp)); + StringCchCopyNW(szTemp, ARRAYSIZE(szTemp), lpszDir, ARRAYSIZE(szTemp)); pszT = PathAddBackslashW(szTemp); if (pszT) { @@ -441,7 +443,7 @@ STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) if (lstrlenW(lpszFile) < iRemaining) { - lstrcpynW(pszT, lpszFile, iRemaining); + StringCchCopyNW(pszT, iRemaining, lpszFile, iRemaining); } else { @@ -455,7 +457,7 @@ STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) } else if (IsPathSeparator(*lpszFile) && !PathIsUNCW(lpszFile)) { - lstrcpynW(szTemp, lpszDir, ARRAYSIZE(szTemp)); + StringCchCopyNW(szTemp, ARRAYSIZE(szTemp), lpszDir, ARRAYSIZE(szTemp)); // FEATURE: Note that we do not check that an actual root is returned; // it is assumed that we are given valid parameters PathStripToRootW(szTemp); @@ -466,7 +468,8 @@ STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) // Skip the backslash when copying // Note: We don't support strings longer than 4GB, but that's // okay because we already barf at MAX_PATH - lstrcpynW(pszT, lpszFile+1, (int)(ARRAYSIZE(szTemp) - (pszT - szTemp))); + int iRemaining = (int)(ARRAYSIZE(szTemp) - (pszT - szTemp)); + StringCchCopyNW(pszT, iRemaining, lpszFile+1, iRemaining); } else { @@ -475,12 +478,14 @@ STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) } else { - lstrcpynW(szTemp, lpszFile, ARRAYSIZE(szTemp)); // already fully qualified file part + // already fully qualified file part + StringCchCopyNW(szTemp, ARRAYSIZE(szTemp), lpszFile, ARRAYSIZE(szTemp)); } } else if (lpszFile && *lpszFile) { - lstrcpynW(szTemp, lpszFile, ARRAYSIZE(szTemp)); // no dir just use file. + // no dir just use file. + StringCchCopyNW(szTemp, ARRAYSIZE(szTemp), lpszFile, ARRAYSIZE(szTemp)); } // diff --git a/src/coreclr/src/palrt/urlpars.cpp b/src/coreclr/src/palrt/urlpars.cpp index 77b0a6e..66289b6 100644 --- a/src/coreclr/src/palrt/urlpars.cpp +++ b/src/coreclr/src/palrt/urlpars.cpp @@ -11,6 +11,7 @@ // =========================================================================== #include "common.h" +#include "strsafe.h" #define SLASH W('/') #define WHACK W('\\') @@ -293,14 +294,13 @@ ParseURLW( // (+ 1) for null terminator. - StrCpyNW(rgchDebugProtocol, ppu->pszProtocol, + StringCchCopyNW(rgchDebugProtocol, ARRAYSIZE(rgchDebugProtocol), ppu->pszProtocol, min(ppu->cchProtocol + 1, SIZECHARS(rgchDebugProtocol))); // (+ 1) for null terminator. - StrCpyNW(rgchDebugSuffix, ppu->pszSuffix, + StringCchCopyNW(rgchDebugSuffix, ARRAYSIZE(rgchDebugSuffix), ppu->pszSuffix, min(ppu->cchSuffix + 1, SIZECHARS(rgchDebugSuffix))); - } #endif