Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

296 lines
5.0 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1991-1996, Microsoft Corporation All rights reserved.
  3. Module Name:
  4. nlstest.h
  5. Abstract:
  6. This file contains the header information for the NLS test module.
  7. NOTE: This code was simply hacked together quickly in order to
  8. test the different code modules of the NLS component.
  9. This is NOT meant to be a formal regression test.
  10. Revision History:
  11. 06-14-91 JulieB Created.
  12. --*/
  13. ////////////////////////////////////////////////////////////////////////////
  14. //
  15. // Includes Files.
  16. //
  17. ////////////////////////////////////////////////////////////////////////////
  18. #include <nt.h>
  19. #include <ntrtl.h>
  20. #include <nturtl.h>
  21. #include <excpt.h>
  22. #include <windows.h>
  23. #include <winerror.h>
  24. #include <winnlsp.h>
  25. #include <stdio.h>
  26. #include <string.h>
  27. ////////////////////////////////////////////////////////////////////////////
  28. //
  29. // Constant Declarations.
  30. //
  31. ////////////////////////////////////////////////////////////////////////////
  32. //
  33. // Error codes.
  34. //
  35. #ifndef NO_ERROR
  36. #define NO_ERROR 0
  37. #endif
  38. //
  39. // Performance Break Points.
  40. // Uncomment this definition to enable the break points.
  41. //
  42. //#define PERF
  43. ////////////////////////////////////////////////////////////////////////////
  44. //
  45. // Typedef Declarations.
  46. //
  47. ////////////////////////////////////////////////////////////////////////////
  48. ////////////////////////////////////////////////////////////////////////////
  49. //
  50. // Macro Definitions.
  51. //
  52. ////////////////////////////////////////////////////////////////////////////
  53. //
  54. // Macros for getting string lengths.
  55. //
  56. #define MB_STRING_LEN(pStr) ((int)(strlen(pStr)))
  57. #define MB_STRING_LEN_NULL(pStr) ((int)(strlen(pStr) + 1))
  58. #define WC_STRING_LEN(pStr) ((int)(wcslen(pStr)))
  59. #define WC_STRING_LEN_NULL(pStr) ((int)(wcslen(pStr) + 1))
  60. ////////////////////////////////////////////////////////////////////////////
  61. //
  62. // Function Prototypes
  63. //
  64. ////////////////////////////////////////////////////////////////////////////
  65. int
  66. CompStringsW(
  67. WCHAR *WCStr1,
  68. WCHAR *WCStr2,
  69. int size);
  70. int
  71. CompStringsA(
  72. BYTE *MBStr1,
  73. BYTE *MBStr2,
  74. int size);
  75. void
  76. PrintWC(
  77. WCHAR *WCStr,
  78. int size);
  79. void
  80. PrintMB(
  81. BYTE *MBStr,
  82. int size);
  83. void
  84. CheckReturnBadParam(
  85. int CurrentReturn,
  86. int ExpectedReturn,
  87. DWORD ExpectedLastError,
  88. LPSTR pErrString,
  89. int *pNumErrors);
  90. void
  91. CheckReturnBadParamEnum(
  92. int CurrentReturn,
  93. int ExpectedReturn,
  94. DWORD ExpectedLastError,
  95. LPSTR pErrString,
  96. int *pNumErrors,
  97. int CurrentEnumCtr,
  98. int ExpectedEnumCtr);
  99. void
  100. CheckReturnEqual(
  101. int CurrentReturn,
  102. int NonExpectedReturn,
  103. LPSTR pErrString,
  104. int *pNumErrors);
  105. void
  106. CheckReturnValidEnumLoop(
  107. int CurrentReturn,
  108. int ExpectedReturn,
  109. int CurrentCtr,
  110. int ExpectedCtr,
  111. LPSTR pErrString,
  112. DWORD ItemValue,
  113. int *pNumErrors);
  114. void
  115. CheckReturnValidEnum(
  116. int CurrentReturn,
  117. int ExpectedReturn,
  118. int CurrentCtr,
  119. int ExpectedCtr,
  120. LPSTR pErrString,
  121. int *pNumErrors);
  122. void
  123. CheckReturnValidLoopW(
  124. int CurrentReturn,
  125. int ExpectedReturn,
  126. LPWSTR pCurrentString,
  127. LPWSTR pExpectedString,
  128. LPSTR pErrString,
  129. DWORD ItemValue,
  130. int *pNumErrors);
  131. void
  132. CheckReturnValidW(
  133. int CurrentReturn,
  134. int ExpectedReturn,
  135. LPWSTR pCurrentString,
  136. LPWSTR pExpectedString,
  137. LPSTR pErrString,
  138. int *pNumErrors);
  139. void
  140. CheckReturnValidA(
  141. int CurrentReturn,
  142. int ExpectedReturn,
  143. LPSTR pCurrentString,
  144. LPSTR pExpectedString,
  145. LPBOOL pUsedDef,
  146. LPSTR pErrString,
  147. int *pNumErrors);
  148. void
  149. CheckReturnValidInt(
  150. int CurrentReturn,
  151. int ExpectedReturn,
  152. DWORD CurrentInt,
  153. DWORD ExpectedInt,
  154. LPSTR pErrString,
  155. int *pNumErrors);
  156. int
  157. TestMBToWC(void);
  158. int
  159. TestWCToMB(void);
  160. int
  161. TestGetCPInfo(void);
  162. int
  163. TestCompareString(void);
  164. int
  165. TestGetStringType(void);
  166. int
  167. TestFoldString(void);
  168. int
  169. TestLCMapString(void);
  170. int
  171. TestGetLocaleInfo(void);
  172. int
  173. TestSetLocaleInfo(void);
  174. int
  175. TestIsDBCSLeadByte(void);
  176. int
  177. TestIsValidCodePage(void);
  178. int
  179. TestIsValidLocale(void);
  180. int
  181. TestUtilityAPIs(void);
  182. int
  183. TestGetTimeFormat(void);
  184. int
  185. TestGetDateFormat(void);
  186. int
  187. TestGetNumberFormat(void);
  188. int
  189. TestGetCurrencyFormat(void);
  190. int
  191. TestEnumSystemLocales(void);
  192. int
  193. TestEnumSystemCodePages(void);
  194. int
  195. TestEnumCalendarInfo(void);
  196. int
  197. TestEnumTimeFormats(void);
  198. int
  199. TestEnumDateFormats(void);
  200. ////////////////////////////////////////////////////////////////////////////
  201. //
  202. // Global Variables
  203. //
  204. // All of the global variables for the NLSTEST should be put here.
  205. //
  206. // Globals are included last because they may require some of the types
  207. // being defined above.
  208. //
  209. ////////////////////////////////////////////////////////////////////////////
  210. extern BOOL Verbose; // verbose flag
  211. extern LCID pAllLocales[]; // all supported locale ids
  212. extern int NumLocales; // number of all supported locale ids