Source code of Windows XP (NT5)
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.

344 lines
5.7 KiB

  1. /*++
  2. Copyright (c) 1991-1999, 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. LPSTR
  84. GetAnsiString(
  85. LPSTR str,
  86. int count);
  87. LPSTR
  88. GetUnicodeString(
  89. LPWSTR wstr,
  90. int count);
  91. void
  92. CheckLastError(
  93. DWORD ExpectedLastError,
  94. LPSTR pErrString,
  95. int *pNumErrors);
  96. void
  97. CheckReturnBadParam(
  98. int CurrentReturn,
  99. int ExpectedReturn,
  100. DWORD ExpectedLastError,
  101. LPSTR pErrString,
  102. int *pNumErrors);
  103. void
  104. CheckReturnBadParamEnum(
  105. int CurrentReturn,
  106. int ExpectedReturn,
  107. DWORD ExpectedLastError,
  108. LPSTR pErrString,
  109. int *pNumErrors,
  110. int CurrentEnumCtr,
  111. int ExpectedEnumCtr);
  112. void
  113. CheckReturnEqual(
  114. int CurrentReturn,
  115. int NonExpectedReturn,
  116. LPSTR pErrString,
  117. int *pNumErrors);
  118. void
  119. CheckReturnValidEnumLoop(
  120. int CurrentReturn,
  121. int ExpectedReturn,
  122. int CurrentCtr,
  123. int ExpectedCtr,
  124. LPSTR pErrString,
  125. DWORD ItemValue,
  126. int *pNumErrors);
  127. void
  128. CheckReturnValidEnum(
  129. int CurrentReturn,
  130. int ExpectedReturn,
  131. int CurrentCtr,
  132. int ExpectedCtr,
  133. LPSTR pErrString,
  134. int *pNumErrors);
  135. void
  136. CheckReturnValidLoopW(
  137. int CurrentReturn,
  138. int ExpectedReturn,
  139. LPWSTR pCurrentString,
  140. LPWSTR pExpectedString,
  141. LPSTR pErrString,
  142. DWORD ItemValue,
  143. int *pNumErrors);
  144. void
  145. CheckReturnValidLoopA(
  146. int CurrentReturn,
  147. int ExpectedReturn,
  148. LPSTR pCurrentString,
  149. LPSTR pExpectedString,
  150. LPSTR pErrString,
  151. DWORD ItemValue,
  152. int *pNumErrors);
  153. void
  154. CheckReturnValidW(
  155. int CurrentReturn,
  156. int ExpectedReturn,
  157. LPWSTR pCurrentString,
  158. LPWSTR pExpectedString,
  159. LPSTR pErrString,
  160. int *pNumErrors);
  161. void
  162. CheckReturnValidA(
  163. int CurrentReturn,
  164. int ExpectedReturn,
  165. LPSTR pCurrentString,
  166. LPSTR pExpectedString,
  167. LPBOOL pUsedDef,
  168. LPSTR pErrString,
  169. int *pNumErrors);
  170. void
  171. CheckReturnValidInt(
  172. int CurrentReturn,
  173. int ExpectedReturn,
  174. DWORD CurrentInt,
  175. DWORD ExpectedInt,
  176. LPSTR pErrString,
  177. int *pNumErrors);
  178. int
  179. TestMBToWC(void);
  180. int
  181. TestWCToMB(void);
  182. int
  183. TestGetCPInfo(void);
  184. int
  185. TestCompareString(void);
  186. int
  187. TestGetStringType(void);
  188. int
  189. TestFoldString(void);
  190. int
  191. TestLCMapString(void);
  192. int
  193. TestGetLocaleInfo(void);
  194. int
  195. TestSetLocaleInfo(void);
  196. int
  197. TestGetCalendarInfo(void);
  198. int
  199. TestSetCalendarInfo(void);
  200. int
  201. TestGetGeoInfo(void);
  202. int
  203. TestIsDBCSLeadByte(void);
  204. int
  205. TestIsValidCodePage(void);
  206. int
  207. TestIsValidLanguageGroup(void);
  208. int
  209. TestIsValidLocale(void);
  210. int
  211. TestUtilityAPIs(void);
  212. int
  213. TestGetTimeFormat(void);
  214. int
  215. TestGetDateFormat(void);
  216. int
  217. TestGetNumberFormat(void);
  218. int
  219. TestGetCurrencyFormat(void);
  220. int
  221. TestEnumUILanguages(void);
  222. int
  223. TestEnumSystemLanguageGroups(void);
  224. int
  225. TestEnumLanguageGroupLocales(void);
  226. int
  227. TestEnumSystemLocales(void);
  228. int
  229. TestEnumSystemCodePages(void);
  230. int
  231. TestEnumCalendarInfo(void);
  232. int
  233. TestEnumTimeFormats(void);
  234. int
  235. TestEnumDateFormats(void);
  236. int
  237. TestEnumSystemGeoID(void);
  238. ////////////////////////////////////////////////////////////////////////////
  239. //
  240. // Global Variables
  241. //
  242. // All of the global variables for the NLSTEST should be put here.
  243. //
  244. // Globals are included last because they may require some of the types
  245. // being defined above.
  246. //
  247. ////////////////////////////////////////////////////////////////////////////
  248. extern BOOL Verbose; // verbose flag
  249. extern LCID pAllLocales[]; // all supported locale ids
  250. extern int NumLocales; // number of all supported locale ids