16#define INVALID_PTR_OFF(x) ((PVOID)(ULONG_PTR)(0xdeadbeefdeadbeefULL + x))
17#define INVALID_PTR INVALID_PTR_OFF(0)
385 sz = (
len + 1) *
sizeof(lpszStr[0]);
429 LPWSTR wszStart, wszCurrent;
435 if (!wszStart &&
pEntry->lpszStart)
437 skip(
"[%u] AllocStringW for wszStart failed\n",
i);
441 wszCurrent = wszStart +
len;
443 wszCurrent = wszStart +
pEntry->iOffset;
447 if (!wszCurrent &&
pEntry->lpszCurrent)
449 skip(
"[%u] AllocStringW for wszCurrent failed\n",
i);
454 if (wszCurrent - wszStart >= 0)
455 iRealOffset =
pEntry->iResOffset;
457 iRealOffset =
pEntry->iResOffsetNeg;
460 b = pchW >= wszStart && pchW <= wszStart +
len;
461 if (iRealOffset >= 0)
462 ok(
b,
"[%u] CharPrevW: pchW (0x%p) is expected to be within wszStart (0x%p)\n",
i, pchW, wszStart);
464 ok(!
b,
"[%u] CharPrevW: pchW (0x%p) is expected to be outside wszStart (0x%p)\n",
i, pchW, wszStart);
465 ok(pchW == wszStart + iRealOffset,
"[%u] CharPrevW: pchW is 0x%p (offset %d)\n",
i, pchW, pchW - wszStart);
469 b = pchW >= wszCurrent && pchW <= wszCurrent +
wcslen(
pEntry->lpszCurrent);
470 if (iRealOffset >= 0)
471 ok(
b,
"[%u] CharPrevW: pchW (0x%p) is expected to be within wszCurrent (0x%p)\n",
i, pchW, wszCurrent);
473 ok(!
b,
"[%u] CharPrevW: pchW (0x%p) is expected to be outside wszCurrent (0x%p)\n",
i, pchW, wszCurrent);
474 ok(pchW == wszCurrent + iRealOffset,
"[%u] CharPrevW: pchW is 0x%p (offset %d)\n",
i, pchW, pchW - wszCurrent);
486 LPSTR szStart, szCurrent;
492 if (!szStart &&
pEntry->lpszStart)
494 skip(
"[%u] AllocStringA for szStart failed\n",
i);
498 szCurrent = szStart +
len;
500 szCurrent = szStart +
pEntry->iOffset;
504 if (!szCurrent &&
pEntry->lpszCurrent)
506 skip(
"[%u] AllocStringA for szCurrent failed\n",
i);
512 if (szCurrent - szStart >= 0)
513 iRealOffset =
pEntry->iResOffset;
515 iRealOffset =
pEntry->iResOffsetNeg;
518 b = pchA >= szStart && pchA <= szStart +
len;
519 if (iRealOffset >= 0)
520 ok(
b,
"[%u] CharPrevA: pchA (0x%p) is expected to be within szStart (0x%p)\n",
i, pchA, szStart);
522 ok(!
b,
"[%u] CharPrevA: pchA (0x%p) is expected to be outside szStart (0x%p)\n",
i, pchA, szStart);
523 ok(pchA == szStart + iRealOffset,
"[%u] CharPrevA: pchA is 0x%p (offset %d)\n",
i, pchA, pchA - szStart);
527 b = pchA >= szCurrent && pchA <= szCurrent +
wcslen(
pEntry->lpszCurrent);
528 if (iRealOffset >= 0)
529 ok(
b,
"[%u] CharPrevA: pchA (0x%p) is expected to be within szCurrent (0x%p)\n",
i, pchA, szCurrent);
531 ok(!
b,
"[%u] CharPrevA: pchA (0x%p) is expected to be outside szCurrent (0x%p)\n",
i, pchA, szCurrent);
532 ok(pchA == szCurrent + iRealOffset,
"[%u] CharPrevA: pchA is 0x%p (offset %d)\n",
i, pchA, pchA - szCurrent);
534 ok(pchA == pchEx,
"[%u] CharPrevExA: pchA (0x%p) is not equal to pchEx (0x%p)\n",
i, pchA, pchEx);
562 ok(pchW ==
pEntry->wszResult,
"[%u] CharPrevW: pchW is 0x%p (expected 0x%p)\n",
i, pchW,
pEntry->wszResult);
568 ok(pchA ==
pEntry->szResult,
"[%u] CharPrevA: pchA is 0x%p (expected 0x%p)\n",
i, pchA,
pEntry->szResult);
571 ok(pchA ==
pEntry->szResult,
"[%u] CharPrevExA: pchA is 0x%p (expected 0x%p)\n",
i, pchA,
pEntry->szResult);
579 ok(pchA ==
pEntry->szResult,
"[%u] CharPrevExA(%u): pchA is 0x%p (expected 0x%p)\n",
i,
pEntry->uCodePage, pchA,
pEntry->szResult);
588 ok(pchW ==
pEntry->wszResult,
"[%u] CharNextW: pchW is 0x%p (expected 0x%p)\n",
i, pchW,
pEntry->wszResult);
594 ok(pchA ==
pEntry->szResult,
"[%u] CharNextA: pchA is 0x%p (expected 0x%p)\n",
i, pchA,
pEntry->szResult);
597 ok(pchA ==
pEntry->szResult,
"[%u] CharNextExA: pchA is 0x%p (expected 0x%p)\n",
i, pchA,
pEntry->szResult);
605 ok(pchA ==
pEntry->szResult,
"[%u] CharNextExA(%u): pchA is 0x%p (expected 0x%p)\n",
i,
pEntry->uCodePage, pchA,
pEntry->szResult);
662 ok(
FALSE,
"testCharPrev: unexpected INVALID PTR < wszReactOS\n");
667 ok(
FALSE,
"testCharPrev: unexpected INVALID PTR < szReactOS\n");
690 ok(pchW ==
pEntry->wszResult,
"[%u] CharPrevW: pchW is 0x%p, expected 0x%p\n",
i, pchW,
pEntry->wszResult);
704 ok(pchA ==
pEntry->szResult,
"[%u] CharPrevA: pchA is 0x%p, expected 0x%p\n",
i, pchA,
pEntry->szResult);
717 ok(pchA ==
pEntry->szExResult,
"[%u] CharPrevExA: pchA is 0x%p, expected 0x%p\n",
i, pchA,
pEntry->szExResult);
754 ok(
FALSE,
"testCharNext: unexpected INVALID PTR < wszReactOS\n");
759 ok(
FALSE,
"testCharNext: unexpected INVALID PTR < szReactOS\n");
782 ok(pchW ==
pEntry->wszResult,
"[%u] CharNextW: pchW is 0x%p, expected 0x%p\n",
i, pchW,
pEntry->wszResult);
796 ok(pchA ==
pEntry->szResult,
"[%u] CharNextA: pchA is 0x%p, expected 0x%p\n",
i, pchA,
pEntry->szResult);
809 ok(pchA ==
pEntry->szResult,
"[%u] CharNextExA: pchA is 0x%p, expected 0x%p\n",
i, pchA,
pEntry->szResult);
static LPWSTR AllocStringW(LPWSTR lpszStr, SIZE_T len)
TESTS_CHARPREV TestCharPrev[]
static const WCHAR wszSpecial[]
ST_TESTS_CHARPREV TestStaticCharPrev_Vista[]
static const CHAR szSpecial[]
EX_TESTS_CHARPREV TestExceptionCharPrev[]
ST_TESTS_CHARPREV TestStaticCharPrev_XP[]
static void testStatCodePageCharPrev(const ST_CODEPAGE_TESTS_CHARPREV *pEntry, UINT i)
TESTS_CHARPREV TestCharPrev_Vista[]
ST_TESTS_CHARNEXT TestStaticCharNext[]
ST_TESTS_CHARNEXT TestStaticCharNext_Vista[]
static void testCharNext(void)
static const CHAR szReactOS[]
static const WCHAR wszReactOS[]
static const WCHAR wszMagic1[]
TESTS_CHARPREV TestCharPrev_XP[]
ST_CODEPAGE_TESTS_CHARNEXT TestStaticCodePageCharNext[]
ST_TESTS_CHARPREV TestStaticCharPrev[]
#define INVALID_PTR_OFF(x)
ST_CODEPAGE_TESTS_CHARPREV TestStaticCodePageCharPrev[]
static void testCharPrevA(const TESTS_CHARPREV *pEntry, SIZE_T len, UINT i)
EX_TESTS_CHARNEXT TestExceptionCharNext[]
ST_TESTS_CHARNEXT TestStaticCharNext_XP[]
static void testStatCodePageCharNext(const ST_CODEPAGE_TESTS_CHARNEXT *pEntry, UINT i)
static void testCharPrev(void)
static const CHAR szUTF8Greek[]
static const CHAR szUTF8Cyril[]
static void testStatCharNext(const ST_TESTS_CHARNEXT *pEntry, UINT i)
static const CHAR szCP932Japan[]
static LPSTR AllocStringA(LPWSTR lpszStr, SIZE_T len)
static const WCHAR wszMagic2[]
static void testDynCharPrev(const TESTS_CHARPREV *pEntry, UINT i)
static const CHAR szUTF8Japan[]
static void testStatCharPrev(const ST_TESTS_CHARPREV *pEntry, UINT i)
static void testCharPrevW(const TESTS_CHARPREV *pEntry, SIZE_T len, UINT i)
#define HeapFree(x, y, z)
#define WideCharToMultiByte
static const WCHAR Cleanup[]
GLboolean GLboolean GLboolean b
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define EXCEPTION_EXECUTE_HANDLER
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define STATUS_ACCESS_VIOLATION
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
VERSIONHELPERAPI IsWindowsVistaOrGreater()
DWORD WINAPI GetLastError(void)
LPSTR WINAPI CharPrevA(_In_ LPCSTR, _In_ LPCSTR)
LPSTR WINAPI CharNextExA(_In_ WORD, _In_ LPCSTR, _In_ DWORD)
LPSTR WINAPI CharNextA(_In_ LPCSTR)
LPSTR WINAPI CharPrevExA(_In_ WORD, _In_ LPCSTR, _In_ LPCSTR, _In_ DWORD)
LPWSTR WINAPI CharPrevW(_In_ LPCWSTR, _In_ LPCWSTR)
LPWSTR WINAPI CharNextW(_In_ LPCWSTR)