dat_wcsncpy.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
  3. *
  4. * FILE: dat_wcsncpy.c
  5. *
  6. * WCSNCPY: wchar_t *wcsncpy (wchar_t *ws1, const wchar_t *ws2,
  7. * size_t n);
  8. */
  9. /* Note:
  10. *
  11. * An initial value of ws1 in the test program is defined as:
  12. *
  13. * #define WCSNUM_NCPY 7
  14. * wchar_t ws1 [WCSSIZE] = { 0x9999, 0x9999, 0x9999, 0x9999,
  15. * 0x9999, 0x9999, 0x0000 };
  16. * */
  17. TST_WCSNCPY tst_wcsncpy_loc [] = {
  18. {
  19. {Twcsncpy, TST_LOC_de},
  20. {
  21. /* 1 */
  22. {{ { 0x00D1,0x00D2,0x00D3,0x0000 }, 6 },
  23. { 0,0,0, { 0x00D1,0x00D2,0x00D3,0x0000,0x0000,0x0000,0x0000 } },
  24. },
  25. /* 2 */
  26. {{ { 0x00D1,0x00D2,0x00D3,0x0000 }, 5 },
  27. { 0,0,0, { 0x00D1,0x00D2,0x00D3,0x0000,0x0000,0x9999,0x0000 } },
  28. },
  29. /* 3 */
  30. {{ { 0x00D1,0x00D2,0x00D3,0x0000 }, 3 },
  31. { 0,0,0, { 0x00D1,0x00D2,0x00D3,0x9999,0x9999,0x9999,0x0000 } },
  32. },
  33. /* 4 */
  34. {{ { 0x00D1,0x00D2,0x00D3,0x0000 }, 2 },
  35. { 0,0,0, { 0x00D1,0x00D2,0x9999,0x9999,0x9999,0x9999,0x0000 } },
  36. },
  37. /* 5 */
  38. {{ { 0x00D1,0x00D2,0x00D3,0x0000 }, 0 },
  39. { 0,0,0, { 0x9999,0x9999,0x9999,0x9999,0x9999,0x9999,0x0000 } },
  40. },
  41. /* 6 */
  42. {{ { 0x0000,0x00D2,0x00D3,0x0000 }, 3 },
  43. { 0,0,0, { 0x0000,0x0000,0x0000,0x9999,0x9999,0x9999,0x0000 } },
  44. },
  45. {.is_last = 1}
  46. }
  47. },
  48. {
  49. {Twcsncpy, TST_LOC_enUS},
  50. {
  51. /* 1 */
  52. {{ { 0x0041,0x0042,0x0043,0x0000 }, 6 },
  53. { 0,0,0, { 0x0041,0x0042,0x0043,0x0000,0x0000,0x0000,0x0000 } },
  54. },
  55. /* 2 */
  56. {{ { 0x0041,0x0042,0x0043,0x0000 }, 5 },
  57. { 0,0,0, { 0x0041,0x0042,0x0043,0x0000,0x0000,0x9999,0x0000 } },
  58. },
  59. /* 3 */
  60. {{ { 0x0041,0x0042,0x0043,0x0000 }, 3 },
  61. { 0,0,0, { 0x0041,0x0042,0x0043,0x9999,0x9999,0x9999,0x0000 } },
  62. },
  63. /* 4 */
  64. {{ { 0x0041,0x0042,0x0043,0x0000 }, 2 },
  65. { 0,0,0, { 0x0041,0x0042,0x9999,0x9999,0x9999,0x9999,0x0000 } },
  66. },
  67. /* 5 */
  68. {{ { 0x0041,0x0042,0x0043,0x0000 }, 0 },
  69. { 0,0,0, { 0x9999,0x9999,0x9999,0x9999,0x9999,0x9999,0x0000 } },
  70. },
  71. /* 6 */
  72. {{ { 0x0000,0x0042,0x0043,0x0000 }, 3 },
  73. { 0,0,0, { 0x0000,0x0000,0x0000,0x9999,0x9999,0x9999,0x0000 } },
  74. },
  75. {.is_last = 1}
  76. }
  77. },
  78. {
  79. #if 0
  80. {Twcsncpy, TST_LOC_eucJP},
  81. #else
  82. {Twcsncpy, TST_LOC_ja_UTF8},
  83. #endif
  84. {
  85. /* 1 */
  86. {{ { 0x3041,0x3042,0x3043,0x0000 }, 6 },
  87. { 0,0,0, { 0x3041,0x3042,0x3043,0x0000,0x0000,0x0000,0x0000 } },
  88. },
  89. /* 2 */
  90. {{ { 0x3041,0x3042,0x3043,0x0000 }, 5 },
  91. { 0,0,0, { 0x3041,0x3042,0x3043,0x0000,0x0000,0x9999,0x0000 } },
  92. },
  93. /* 3 */
  94. {{ { 0x3041,0x3042,0x3043,0x0000 }, 3 },
  95. { 0,0,0, { 0x3041,0x3042,0x3043,0x9999,0x9999,0x9999,0x0000 } },
  96. },
  97. /* 4 */
  98. {{ { 0x3041,0x3042,0x3043,0x0000 }, 2 },
  99. { 0,0,0, { 0x3041,0x3042,0x9999,0x9999,0x9999,0x9999,0x0000 } },
  100. },
  101. /* 5 */
  102. {{ { 0x3041,0x3042,0x3043,0x0000 }, 0 },
  103. { 0,0,0, { 0x9999,0x9999,0x9999,0x9999,0x9999,0x9999,0x0000 } },
  104. },
  105. /* 6 */
  106. {{ { 0x0000,0x3042,0x3043,0x0000 }, 3 },
  107. { 0,0,0, { 0x0000,0x0000,0x0000,0x9999,0x9999,0x9999,0x0000 } },
  108. },
  109. {.is_last = 1}
  110. }
  111. },
  112. {
  113. {Twcsncpy, TST_LOC_end}
  114. }
  115. };