dat_wcsncat.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*
  2. * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
  3. *
  4. * FILE: dat_wcsncat.c
  5. *
  6. * WCSNCAT: wchar_t *wcsncat (wchar_t *ws1, wchar_t *ws2, size_t n);
  7. */
  8. /*
  9. * Note:
  10. * A terminating null wide chararacter is always appended to
  11. * the result: ws1.
  12. *
  13. */
  14. TST_WCSNCAT tst_wcsncat_loc [] = {
  15. {
  16. {Twcsncat, TST_LOC_de},
  17. {
  18. /* 1 */
  19. {
  20. /* Input: */
  21. {{ 0x00D1,0x00D2,0x0000 },
  22. { 0x00D3,0x00D4,0x0000 }, 3 },
  23. /* Expect: */
  24. { 0, 0, 0,
  25. { 0x00D1,0x00D2,0x00D3,0x00D4,0x0000 } },
  26. },
  27. /* 2 */
  28. {{{ 0x00D1,0x00D2,0x0000 },
  29. { 0x00D3,0x00D4,0x0000 }, 2 },
  30. { 0, 0, 0,
  31. { 0x00D1,0x00D2,0x00D3,0x00D4,0x0000 } },
  32. },
  33. /* 3 */
  34. {{{ 0x00E1,0x00E2,0x0000 },
  35. { 0x00E3,0x00E4,0x0000 }, 1 },
  36. { 0, 0, 0,
  37. { 0x00E1,0x00E2,0x00E3,0x0000 } },
  38. },
  39. /* 4 */
  40. {{{ 0x00E1,0x00E2,0x0000 },
  41. { 0x00E3,0x00E4,0x0000 }, 0 },
  42. { 0, 0, 0,
  43. { 0x00E1,0x00E2,0x0000 } },
  44. },
  45. /* 5 */
  46. {{{ 0x0000 },
  47. { 0x00D3,0x00D4,0x0000 }, 3 },
  48. { 0, 0, 0,
  49. { 0x00D3,0x00D4,0x0000 } },
  50. },
  51. /* 6 */
  52. {{{ 0x00E1,0x00E2,0x0000 },
  53. { 0x0000 }, 3 },
  54. { 0, 0, 0,
  55. { 0x00E1,0x00E2,0x0000 } },
  56. },
  57. {.is_last = 1}
  58. }
  59. },
  60. {
  61. {Twcsncat, TST_LOC_enUS},
  62. {
  63. /* 1 */
  64. {
  65. /* Input: */
  66. {{ 0x0041,0x0042,0x0000 },
  67. { 0x0043,0x0044,0x0000 }, 3 },
  68. /* Expect: */
  69. { 0, 0, 0,
  70. { 0x0041,0x0042,0x0043,0x0044,0x0000 } },
  71. },
  72. /* 2 */
  73. {{{ 0x0041,0x0042,0x0000 },
  74. { 0x0043,0x0044,0x0000 }, 2 },
  75. { 0, 0, 0,
  76. { 0x0041,0x0042,0x0043,0x0044,0x0000 } },
  77. },
  78. /* 3 */
  79. {{{ 0x0051,0x0052,0x0000 },
  80. { 0x0053,0x0054,0x0000 }, 1 },
  81. { 0, 0, 0,
  82. { 0x0051,0x0052,0x0053,0x0000 } },
  83. },
  84. /* 4 */
  85. {{{ 0x0051,0x0052,0x0000 },
  86. { 0x0053,0x0054,0x0000 }, 0 },
  87. { 0, 0, 0,
  88. { 0x0051,0x0052,0x0000 } },
  89. },
  90. /* 5 */
  91. {{{ 0x0000 },
  92. { 0x0043,0x0044,0x0000 }, 3 },
  93. { 0, 0, 0,
  94. { 0x0043,0x0044,0x0000 } },
  95. },
  96. /* 6 */
  97. {{{ 0x0051,0x0052,0x0000 },
  98. { 0x0000 }, 3 },
  99. { 0, 0, 0,
  100. { 0x0051,0x0052,0x0000 } },
  101. },
  102. {.is_last = 1}
  103. }
  104. },
  105. {
  106. #if 0
  107. {Twcsncat, TST_LOC_eucJP},
  108. #else
  109. {Twcsncat, TST_LOC_ja_UTF8},
  110. #endif
  111. {
  112. /* 1 */
  113. {{{ 0x3041,0x3042,0x0000 },
  114. { 0x3043,0x3044,0x0000 }, 3 },
  115. { 0, 0, 0,
  116. { 0x3041,0x3042,0x3043,0x3044,0x0000 } },
  117. },
  118. /* 2 */
  119. {{{ 0x30A2,0x30A3,0x0000 },
  120. { 0xFF71,0xFF72,0x0000 }, 2 },
  121. { 0, 0, 0,
  122. { 0x30A2,0x30A3,0xFF71,0xFF72,0x0000 } },
  123. },
  124. /* 3 */
  125. {{{ 0x3051,0x3052,0x0000 },
  126. { 0x3053,0x3054,0x0000 }, 1 },
  127. { 0, 0, 0,
  128. { 0x3051,0x3052,0x3053,0x0000 } },
  129. },
  130. /* 4 */
  131. {{{ 0x3051,0x3052,0x0000 },
  132. { 0x3053,0x3054,0x0000 }, 0 },
  133. { 0, 0, 0,
  134. { 0x3051,0x3052,0x0000 } },
  135. },
  136. /* 5 */
  137. {{{ 0x0000 },
  138. { 0x3043,0x3044,0x0000 }, 3 },
  139. { 0, 0, 0,
  140. { 0x3043,0x3044,0x0000 } },
  141. },
  142. /* 6 */
  143. {{{ 0x3051,0x3052,0x0000 },
  144. { 0x0000 }, 3 },
  145. { 0, 0, 0,
  146. { 0x3051,0x3052,0x0000 } },
  147. },
  148. {.is_last = 1}
  149. }
  150. },
  151. {
  152. {Twcsncat, TST_LOC_end}
  153. }
  154. };