Leaked source code of windows server 2003
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.

48 lines
1.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: convbvt.cxx
  8. //
  9. //--------------------------------------------------------------------------
  10. #include <precomp.hxx>
  11. #include "CharConv.hxx"
  12. int main()
  13. {
  14. WCHAR wt1[] = L"Hello world!";
  15. WCHAR we[] = L"";
  16. char at1[] = "Hello world!";
  17. char ae[] = "";
  18. char abuf[100];
  19. WCHAR wbuf[100];
  20. CHeapUnicode hu;
  21. CHeapAnsi ha;
  22. CNlUnicode nu;
  23. CNlAnsi na;
  24. CStackUnicode su;
  25. CStackAnsi sa;
  26. USES_CONVERSION;
  27. // test heap conversions
  28. ATTEMPT_HEAP_W2A(ha, wt1);
  29. ASSERT(lstrcmpA(ha, at1) == 0);
  30. ATTEMPT_HEAP_A2W(hu, at1);
  31. ASSERT(lstrcmpW(hu, wt1) == 0);
  32. // test Nl conversions
  33. ATTEMPT_NL_W2A(na, wt1);
  34. ASSERT(lstrcmpA(na, at1) == 0);
  35. ATTEMPT_NL_A2W(nu, at1);
  36. ASSERT(lstrcmpW(nu, wt1) == 0);
  37. // test stack conversions
  38. ATTEMPT_STACK_W2A(sa, wt1);
  39. ASSERT(lstrcmpA(sa, at1) == 0);
  40. ATTEMPT_STACK_A2W(su, at1);
  41. ASSERT(lstrcmpW(su, wt1) == 0);
  42. return 0;
  43. }