_snprintf
_snwprintf
_vsnwprintf
-_itow
-_i64tow
+_itow_s
+_i64tow_s
memcpy_s
CoCreateGuid
#undef lstrcmp
#undef lstrcmpi
#undef lstrcpyn
-#undef lstrcpy
-#undef lstrcat
#undef lstrlen
#undef CreateMutex
#undef OpenMutex
// winuser.h
#undef MAKEINTRESOURCE
#undef wvsprintf
-#undef wsprintf
#undef LoadKeyboardLayout
#undef GetKeyboardLayoutName
#undef CreateDesktop
#define WszQueryRecoveryAgents QueryRecoveryAgentsW
#define Wszlstrcmp lstrcmpW
#define Wszlstrcmpi lstrcmpiW
-#define Wszlstrcpy lstrcpyW
-#define Wszlstrcat lstrcatW
#define WszCreateMutex CreateMutexW
#define WszOpenMutex OpenMutexW
#define WszCreateEvent CreateEventW
// 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
#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
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(
#endif
PALIMPORT
-LPWSTR
-PALAPI
-lstrcpynW(
- OUT LPWSTR lpString1,
- IN LPCWSTR lpString2,
- IN int iMaxLength);
-
-#ifdef UNICODE
-#define lstrcpyn lstrcpynW
-#endif
-
-
-PALIMPORT
DWORD
PALAPI
GetEnvironmentVariableW(
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*);
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
// 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
#ifdef UNICODE
#define StrCpy StrCpyW
-#define StrCpyN StrCpyNW
#define StrCat StrCatW
#define StrNCat StrNCatW
#define StrChr StrChrW
}
}
-/* _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 <size_t _SizeInWords>
-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 <size_t _SizeInWords>
-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 */
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
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;
-
-}
-
-
/*++
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.
}
-/*******************************************************************************
-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
#undef wcsncmp
#undef wcschr
#undef wcsrchr
-#undef wsprintf
#undef swscanf
#undef wcspbrk
#undef wcsstr
#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
#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 */
/***
/* 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,
/* 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,
**
** 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.
**
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);
}
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.
// 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);
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)
add_subdirectory(SetEnvironmentVariableA)
add_subdirectory(SetEnvironmentVariableW)
add_subdirectory(SetLastError)
-add_subdirectory(wsprintfA)
-add_subdirectory(wsprintfW)
add_subdirectory(_i64tow)
**
** 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.
**
**
for (i=0; i<sizeof(testCases) / sizeof(testCase); i++)
{
- ret = _i64tow(testCases[i].value, buffer, testCases[i].radix);
- if (ret != buffer)
+ errno_t err = _i64tow_s(testCases[i].value, buffer, sizeof(buffer) / sizeof(buffer[0]), testCases[i].radix);
+
+ if(err != 0)
{
- Fail("_i64tow did not return a pointer to the string.\n"
- "Expected %p, got %p\n", buffer, ret);
+ Fail("ERROR: _i64tow_s didn't return success, error code %d.\n", err);
}
testStr = convert(testCases[i].result);
if (wcscmp(testStr, buffer) != 0)
{
- Fail("_i64tow did not give the correct string.\n"
+ Fail("_i64tow_s did not give the correct string.\n"
"Expected %S, got %S\n", testStr, buffer);
}
free(testStr);
Version = 1.0
Section = miscellaneous
-Function = _i64tow
-Name = Test #1 for _i64tow
+Function = _i64tow_s
+Name = Test #1 for _i64tow_s
TYPE = DEFAULT
EXE1 = test1
Description
-=Tests _i64tow with normal values and different radices, negative
+=Tests _i64tow_s with normal values and different radices, negative
=values, as well as the highest and lowest values.
+++ /dev/null
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-add_subdirectory(test2)
-add_subdirectory(test3)
-add_subdirectory(test4)
-
+++ /dev/null
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.cpp
-)
-
-add_executable(paltest_lstrcatw_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_lstrcatw_test1 coreclrpal)
-
-target_link_libraries(paltest_lstrcatw_test1
- pthread
- m
- coreclrpal
-)
+++ /dev/null
-// 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 lstrcatW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-
-#include <palsuite.h>
-
-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;
-}
-
-
-
+++ /dev/null
-# 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.
-
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-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;
-}
-
-
-
+++ /dev/null
-# 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.
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-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;
-}
-
-
-
+++ /dev/null
-# 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
-
-
-
-
-
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-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;
-}
-
-
-
+++ /dev/null
-# 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
-
-
-
-
-
-
-
+++ /dev/null
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-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;
-}
-
-
+++ /dev/null
-# 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.
-
-
-
+++ /dev/null
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-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;
-}
-
-
-
+++ /dev/null
-# 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.
-
-
-
+++ /dev/null
-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)
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
- 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;
-
-}
-
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-/* 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;
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-/* 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;
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-/* 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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-/* 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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-/* 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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-/* 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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-/* 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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-/* 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;
-
-}
-
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-/* 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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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)
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-
-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;
-
-}
-
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-
-
-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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-
-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;
-
-}
-
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-
-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;
-
-}
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-
-
-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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-
-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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-
-
-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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-
-
-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;
-
-}
-
-
-
+++ /dev/null
-# 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.
-
-
+++ /dev/null
-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
-)
+++ /dev/null
-// 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 <palsuite.h>
-
-
-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;
-
-}
-
-
+++ /dev/null
-# 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.
-
-
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
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
// ===========================================================================
#include "common.h"
-
+#include "strsafe.h"
#define CH_SLASH W('/')
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;
}
{
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)
{
if (lstrlenW(lpszFile) < iRemaining)
{
- lstrcpynW(pszT, lpszFile, iRemaining);
+ StringCchCopyNW(pszT, iRemaining, lpszFile, iRemaining);
}
else
{
}
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);
// 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
{
}
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));
}
//
// ===========================================================================
#include "common.h"
+#include "strsafe.h"
#define SLASH W('/')
#define WHACK W('\\')
// (+ 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