dat_wcscspn.c 4.9 KB

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