dat_wcsspn.c 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /*
  2. * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
  3. *
  4. * FILE: dat_wcsspn.c
  5. *
  6. * WCSSPN: size_t wcsspn (const wchar_t *ws1, const wchar_t *ws2);
  7. */
  8. TST_WCSSPN tst_wcsspn_loc [] = {
  9. {
  10. { Twcsspn, TST_LOC_de },
  11. {
  12. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  13. { 0x00D1,0x0000 }, }, /* #01 */
  14. /*expect*/ { 0,1,1, },
  15. },
  16. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  17. { 0x00D2,0x0000 }, }, /* #02 */
  18. /*expect*/ { 0,1,0, },
  19. },
  20. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  21. { 0x00D3,0x0000 }, }, /* #03 */
  22. /*expect*/ { 0,1,0, },
  23. },
  24. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  25. { 0x00D4,0x0000 }, }, /* #04 */
  26. /*expect*/ { 0,1,0, },
  27. },
  28. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  29. { 0x00D2,0x00D3,0x0000 }, }, /* #05 */
  30. /*expect*/ { 0,1,0, },
  31. },
  32. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  33. { 0x00D3,0x00D4,0x0000 }, }, /* #06 */
  34. /*expect*/ { 0,1,0, },
  35. },
  36. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  37. { 0x00D1,0x00D2,0x00D3,0x0000 }, }, /* #07 */
  38. /*expect*/ { 0,1,3, },
  39. },
  40. { /*input.*/ { { 0x00D1,0x00D2,0x0000 },
  41. { 0x00D1,0x00D2,0x00D3,0x0000 }, }, /* #08 */
  42. /*expect*/ { 0,1,2, },
  43. },
  44. { /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 },
  45. { 0x00D2,0x0000 }, }, /* #09 */
  46. /*expect*/ { 0,1,0, },
  47. },
  48. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  49. { 0x0000,0x00D2,0x0000 }, }, /* #10 */
  50. /*expect*/ { 0,1,0, },
  51. },
  52. { /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 },
  53. { 0x0000,0x00D2,0x0000 }, }, /* #11 */
  54. /*expect*/ { 0,1,0, },
  55. },
  56. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  57. { 0x00D2,0x00D1,0x0000 }, }, /* #12 */
  58. /*expect*/ { 0,1,2, },
  59. },
  60. { .is_last = 1 }
  61. }
  62. },
  63. {
  64. { Twcsspn, TST_LOC_enUS },
  65. {
  66. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  67. { 0x0041,0x0000 }, }, /* #01 */
  68. /*expect*/ { 0,1,1, },
  69. },
  70. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  71. { 0x0042,0x0000 }, }, /* #02 */
  72. /*expect*/ { 0,1,0, },
  73. },
  74. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  75. { 0x0043,0x0000 }, }, /* #03 */
  76. /*expect*/ { 0,1,0, },
  77. },
  78. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  79. { 0x0044,0x0000 }, }, /* #04 */
  80. /*expect*/ { 0,1,0, },
  81. },
  82. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  83. { 0x0042,0x0043,0x0000 }, }, /* #05 */
  84. /*expect*/ { 0,1,0, },
  85. },
  86. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  87. { 0x0043,0x0044,0x0000 }, }, /* #06 */
  88. /*expect*/ { 0,1,0, },
  89. },
  90. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  91. { 0x0041,0x0042,0x0043,0x0000 }, }, /* #07 */
  92. /*expect*/ { 0,1,3, },
  93. },
  94. { /*input.*/ { { 0x0041,0x0042,0x0000 },
  95. { 0x0041,0x0042,0x0043,0x0000 }, }, /* #08 */
  96. /*expect*/ { 0,1,2, },
  97. },
  98. { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 },
  99. { 0x0042,0x0000 }, }, /* #09 */
  100. /*expect*/ { 0,1,0, },
  101. },
  102. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  103. { 0x0000,0x0042,0x0000 }, }, /* #10 */
  104. /*expect*/ { 0,1,0, },
  105. },
  106. { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 },
  107. { 0x0000,0x0042,0x0000 }, }, /* #11 */
  108. /*expect*/ { 0,1,0, },
  109. },
  110. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  111. { 0x0042,0x0041,0x0000 }, }, /* #12 */
  112. /*expect*/ { 0,1,2, },
  113. },
  114. { .is_last = 1 }
  115. }
  116. },
  117. {
  118. #if 0
  119. { Twcsspn, TST_LOC_eucJP },
  120. #else
  121. { Twcsspn, TST_LOC_ja_UTF8 },
  122. #endif
  123. {
  124. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  125. { 0x3041,0x0000 }, }, /* #1 */
  126. /*expect*/ { 0,1,1, },
  127. },
  128. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  129. { 0x3042,0x0000 }, }, /* #2 */
  130. /*expect*/ { 0,1,0, },
  131. },
  132. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  133. { 0x3043,0x0000 }, }, /* #3 */
  134. /*expect*/ { 0,1,0, },
  135. },
  136. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  137. { 0x3044,0x0000 }, }, /* #4 */
  138. /*expect*/ { 0,1,0, },
  139. },
  140. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  141. { 0x3042,0x3043,0x0000 }, }, /* #5 */
  142. /*expect*/ { 0,1,0, },
  143. },
  144. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  145. { 0x3043,0x3044,0x0000 }, }, /* #6 */
  146. /*expect*/ { 0,1,0, },
  147. },
  148. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  149. { 0x3041,0x3042,0x3043,0x0000 }, }, /* #7 */
  150. /*expect*/ { 0,1,3, },
  151. },
  152. { /*input.*/ { { 0x3041,0x3042,0x0000 },
  153. { 0x3041,0x3042,0x3043,0x0000 }, }, /* #8 */
  154. /*expect*/ { 0,1,2, },
  155. },
  156. { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 },
  157. { 0x3042,0x0000 }, }, /* #9 */
  158. /*expect*/ { 0,1,0, },
  159. },
  160. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  161. { 0x0000,0x3042,0x0000 }, }, /* #10 */
  162. /*expect*/ { 0,1,0, },
  163. },
  164. { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 },
  165. { 0x0000,0x3042,0x0000 }, }, /* #11 */
  166. /*expect*/ { 0,1,0, },
  167. },
  168. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  169. { 0x3042,0x3041,0x0000 }, }, /* #12 */
  170. /*expect*/ { 0,1,2, },
  171. },
  172. { .is_last = 1 }
  173. }
  174. },
  175. {
  176. { Twcsspn, TST_LOC_end }
  177. }
  178. };