dat_wcscmp.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
  3. *
  4. * FILE: dat_wcscmp.c
  5. *
  6. * WCSCMP: int wcscmp (const wchar_t *ws1, const wchar_t *ws2);
  7. */
  8. /* NOTE:
  9. This is not a locale sensitive function and
  10. it may not make sence testing it for each locale ...
  11. */
  12. TST_WCSCMP tst_wcscmp_loc [] = {
  13. {
  14. { Twcscmp, TST_LOC_de },
  15. {
  16. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  17. { 0x00D1,0x00D2,0x00D3,0x0000 }, }, /* #1 */
  18. /*expect*/ { 0,1,0, },
  19. },
  20. { /*input.*/ { { 0x0000,0x00D1,0x00D3,0x0000 },
  21. { 0x0000,0x00D2,0x00D3,0x0000 }, }, /* #2 */
  22. /*expect*/ { 0,1,0, },
  23. },
  24. { /*input.*/ { { 0x00D1,0x00D1,0x00D3,0x0000 },
  25. { 0x0000,0x00D2,0x00D3,0x0000 }, }, /* #3 */
  26. /*expect*/ { 0,1,1, },
  27. },
  28. { /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 },
  29. { 0x00D1,0x00D1,0x00D3,0x0000 }, }, /* #4 */
  30. /*expect*/ { 0,1,-1, },
  31. },
  32. { /*input.*/ { { 0x00D1,0x00D5,0x00D3,0x0000 },
  33. { 0x00D1,0x00D2,0x00D3,0x0000 }, }, /* #5 */
  34. /*expect*/ { 0,1,1, },
  35. },
  36. { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
  37. { 0x00D1,0x00D2,0x00D9,0x0000 }, }, /* #6 */
  38. /*expect*/ { 0,1,-1, },
  39. },
  40. { /*input.*/ { { 0x00D1,0x00D2,0x0000 },
  41. { 0x00D1,0x00D2,0x00D9,0x0000 }, }, /* #7 */
  42. /*expect*/ { 0,1,-1, },
  43. },
  44. { /*input.*/ { { 0x00D1,0x00D2,0x00D9,0x0000 },
  45. { 0x00D1,0x00D2,0x0000 }, }, /* #8 */
  46. /*expect*/ { 0,1,1, },
  47. },
  48. { .is_last = 1 }
  49. }
  50. },
  51. {
  52. { Twcscmp, TST_LOC_enUS },
  53. {
  54. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  55. { 0x0041,0x0042,0x0043,0x0000 }, }, /* #1 */
  56. /*expect*/ { 0,1,0, },
  57. },
  58. { /*input.*/ { { 0x0000,0x0041,0x0043,0x0000 },
  59. { 0x0000,0x0042,0x0043,0x0000 }, }, /* #2 */
  60. /*expect*/ { 0,1,0, },
  61. },
  62. { /*input.*/ { { 0x0041,0x0041,0x0043,0x0000 },
  63. { 0x0000,0x0042,0x0043,0x0000 }, }, /* #3 */
  64. /*expect*/ { 0,1,1, },
  65. },
  66. { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 },
  67. { 0x0041,0x0041,0x0043,0x0000 }, }, /* #4 */
  68. /*expect*/ { 0,1,-1, },
  69. },
  70. { /*input.*/ { { 0x0041,0x0045,0x0043,0x0000 },
  71. { 0x0041,0x0042,0x0043,0x0000 }, }, /* #5 */
  72. /*expect*/ { 0,1,1, },
  73. },
  74. { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
  75. { 0x0041,0x0042,0x0049,0x0000 }, }, /* #6 */
  76. /*expect*/ { 0,1,-1, },
  77. },
  78. { /*input.*/ { { 0x0041,0x0042,0x0000 },
  79. { 0x0041,0x0042,0x0049,0x0000 }, }, /* #7 */
  80. /*expect*/ { 0,1,-1, },
  81. },
  82. { /*input.*/ { { 0x0041,0x0042,0x0049,0x0000 },
  83. { 0x0041,0x0042,0x0000 }, }, /* #8 */
  84. /*expect*/ { 0,1,1, },
  85. },
  86. { .is_last = 1 }
  87. }
  88. },
  89. {
  90. #if 0
  91. { Twcscmp, TST_LOC_eucJP},
  92. #else
  93. { Twcscmp, TST_LOC_ja_UTF8},
  94. #endif
  95. {
  96. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  97. { 0x3041,0x3042,0x3043,0x0000 }, }, /* #1 */
  98. /*expect*/ { 0,1,0, },
  99. },
  100. { /*input.*/ { { 0x0000,0x3041,0x3043,0x0000 },
  101. { 0x0000,0x3042,0x3043,0x0000 }, }, /* #2 */
  102. /*expect*/ { 0,1,0, },
  103. },
  104. { /*input.*/ { { 0x3041,0x3041,0x3043,0x0000 },
  105. { 0x0000,0x3042,0x3043,0x0000 }, }, /* #3 */
  106. /*expect*/ { 0,1,1, },
  107. },
  108. { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 },
  109. { 0x3041,0x3041,0x3043,0x0000 }, }, /* #4 */
  110. /*expect*/ { 0,1,-1, },
  111. },
  112. { /*input.*/ { { 0x3041,0x3045,0x3043,0x0000 },
  113. { 0x3041,0x3042,0x3043,0x0000 }, }, /* #5 */
  114. /*expect*/ { 0,1,1, },
  115. },
  116. { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
  117. { 0x3041,0x3042,0x3049,0x0000 }, }, /* #6 */
  118. /*expect*/ { 0,1,-1, },
  119. },
  120. { /*input.*/ { { 0x3041,0x3042,0x0000 },
  121. { 0x3041,0x3042,0x3049,0x0000 }, }, /* #7 */
  122. /*expect*/ { 0,1,-1, },
  123. },
  124. { /*input.*/ { { 0x3041,0x3042,0x3049,0x0000 },
  125. { 0x3041,0x3042,0x0000 }, }, /* #8 */
  126. /*expect*/ { 0,1,1, },
  127. },
  128. { .is_last = 1 }
  129. }
  130. },
  131. {
  132. { Twcschr, TST_LOC_end}
  133. }
  134. };