2000-09-30  Bruno Haible  <haible@clisp.cons.org>

	* tests-mbwc/tst_wcscmp.c (tst_wcscmp): Take the sign of ret.
	* tests-mbwc/dat_wcscmp.c (tst_wcscmp_loc): Don't expect precise
	return values.  Only the sign matters.
This commit is contained in:
Ulrich Drepper 2000-10-01 18:47:09 +00:00
parent aaca11d8a1
commit d6040f1781
6 changed files with 36 additions and 31 deletions

View File

@ -202,6 +202,7 @@ cat <<EOF |
#ISO-2022-KR
#ISO-2022-CN
#ISO-2022-CN-EXT
#UTF-7
#
EOF
while read charset charmap; do

View File

@ -3364,8 +3364,11 @@ struct wctype_table
static inline void
wctype_table_init (struct wctype_table *t)
{
t->level1 = NULL;
t->level1_alloc = t->level1_size = 0;
t->level2 = NULL;
t->level2_alloc = t->level2_size = 0;
t->level3 = NULL;
t->level3_alloc = t->level3_size = 0;
}
@ -3413,10 +3416,8 @@ wctype_table_add (struct wctype_table *t, uint32_t wc)
size_t alloc = 2 * t->level1_alloc;
if (alloc <= index1)
alloc = index1 + 1;
t->level1 = (t->level1_alloc > 0
? (uint32_t *) xrealloc ((char *) t->level1,
alloc * sizeof (uint32_t))
: (uint32_t *) xmalloc (alloc * sizeof (uint32_t)));
t->level1 = (uint32_t *) xrealloc ((char *) t->level1,
alloc * sizeof (uint32_t));
t->level1_alloc = alloc;
}
while (index1 >= t->level1_size)
@ -3428,10 +3429,8 @@ wctype_table_add (struct wctype_table *t, uint32_t wc)
if (t->level2_size == t->level2_alloc)
{
size_t alloc = 2 * t->level2_alloc + 1;
t->level2 = (t->level2_alloc > 0
? (uint32_t *) xrealloc ((char *) t->level2,
(alloc << t->q) * sizeof (uint32_t))
: (uint32_t *) xmalloc ((alloc << t->q) * sizeof (uint32_t)));
t->level2 = (uint32_t *) xrealloc ((char *) t->level2,
(alloc << t->q) * sizeof (uint32_t));
t->level2_alloc = alloc;
}
i1 = t->level2_size << t->q;
@ -3448,10 +3447,8 @@ wctype_table_add (struct wctype_table *t, uint32_t wc)
if (t->level3_size == t->level3_alloc)
{
size_t alloc = 2 * t->level3_alloc + 1;
t->level3 = (t->level3_alloc > 0
? (uint32_t *) xrealloc ((char *) t->level3,
(alloc << t->p) * sizeof (uint32_t))
: (uint32_t *) xmalloc ((alloc << t->p) * sizeof (uint32_t)));
t->level3 = (uint32_t *) xrealloc ((char *) t->level3,
(alloc << t->p) * sizeof (uint32_t));
t->level3_alloc = alloc;
}
i1 = t->level3_size << t->p;

View File

@ -1,3 +1,9 @@
2000-09-30 Bruno Haible <haible@clisp.cons.org>
* tests-mbwc/tst_wcscmp.c (tst_wcscmp): Take the sign of ret.
* tests-mbwc/dat_wcscmp.c (tst_wcscmp_loc): Don't expect precise
return values. Only the sign matters.
2000-09-28 Ulrich Drepper <drepper@redhat.com>
* locales/ar_SA: Last non <Uxxxx> entries removed.

View File

@ -26,27 +26,27 @@ TST_WCSCMP tst_wcscmp_loc [] = {
},
{ /*input.*/ { { 0x00D1,0x00D1,0x00D3,0x0000 },
{ 0x0000,0x00D2,0x00D3,0x0000 }, }, /* #3 */
/*expect*/ { 0,1,0x00D1, },
/*expect*/ { 0,1,1, },
},
{ /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 },
{ 0x00D1,0x00D1,0x00D3,0x0000 }, }, /* #4 */
/*expect*/ { 0,1,-0x00D1, },
/*expect*/ { 0,1,-1, },
},
{ /*input.*/ { { 0x00D1,0x00D5,0x00D3,0x0000 },
{ 0x00D1,0x00D2,0x00D3,0x0000 }, }, /* #5 */
/*expect*/ { 0,1,3, },
/*expect*/ { 0,1,1, },
},
{ /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
{ 0x00D1,0x00D2,0x00D9,0x0000 }, }, /* #6 */
/*expect*/ { 0,1,-6, },
/*expect*/ { 0,1,-1, },
},
{ /*input.*/ { { 0x00D1,0x00D2,0x0000 },
{ 0x00D1,0x00D2,0x00D9,0x0000 }, }, /* #7 */
/*expect*/ { 0,1,-0x00D9, },
/*expect*/ { 0,1,-1, },
},
{ /*input.*/ { { 0x00D1,0x00D2,0x00D9,0x0000 },
{ 0x00D1,0x00D2,0x0000 }, }, /* #8 */
/*expect*/ { 0,1,0x00D9, },
/*expect*/ { 0,1,1, },
},
{ is_last: 1 }
}
@ -64,27 +64,27 @@ TST_WCSCMP tst_wcscmp_loc [] = {
},
{ /*input.*/ { { 0x0041,0x0041,0x0043,0x0000 },
{ 0x0000,0x0042,0x0043,0x0000 }, }, /* #3 */
/*expect*/ { 0,1,0x0041, },
/*expect*/ { 0,1,1, },
},
{ /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 },
{ 0x0041,0x0041,0x0043,0x0000 }, }, /* #4 */
/*expect*/ { 0,1,-0x0041, },
/*expect*/ { 0,1,-1, },
},
{ /*input.*/ { { 0x0041,0x0045,0x0043,0x0000 },
{ 0x0041,0x0042,0x0043,0x0000 }, }, /* #5 */
/*expect*/ { 0,1,3, },
/*expect*/ { 0,1,1, },
},
{ /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
{ 0x0041,0x0042,0x0049,0x0000 }, }, /* #6 */
/*expect*/ { 0,1,-6, },
/*expect*/ { 0,1,-1, },
},
{ /*input.*/ { { 0x0041,0x0042,0x0000 },
{ 0x0041,0x0042,0x0049,0x0000 }, }, /* #7 */
/*expect*/ { 0,1,-0x0049, },
/*expect*/ { 0,1,-1, },
},
{ /*input.*/ { { 0x0041,0x0042,0x0049,0x0000 },
{ 0x0041,0x0042,0x0000 }, }, /* #8 */
/*expect*/ { 0,1,0x0049, },
/*expect*/ { 0,1,1, },
},
{ is_last: 1 }
}
@ -102,27 +102,27 @@ TST_WCSCMP tst_wcscmp_loc [] = {
},
{ /*input.*/ { { 0x3041,0x3041,0x3043,0x0000 },
{ 0x0000,0x3042,0x3043,0x0000 }, }, /* #3 */
/*expect*/ { 0,1,0x3041, },
/*expect*/ { 0,1,1, },
},
{ /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 },
{ 0x3041,0x3041,0x3043,0x0000 }, }, /* #4 */
/*expect*/ { 0,1,-0x3041, },
/*expect*/ { 0,1,-1, },
},
{ /*input.*/ { { 0x3041,0x3045,0x3043,0x0000 },
{ 0x3041,0x3042,0x3043,0x0000 }, }, /* #5 */
/*expect*/ { 0,1,3, },
/*expect*/ { 0,1,1, },
},
{ /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
{ 0x3041,0x3042,0x3049,0x0000 }, }, /* #6 */
/*expect*/ { 0,1,-6, },
/*expect*/ { 0,1,-1, },
},
{ /*input.*/ { { 0x3041,0x3042,0x0000 },
{ 0x3041,0x3042,0x3049,0x0000 }, }, /* #7 */
/*expect*/ { 0,1,-0x3049, },
/*expect*/ { 0,1,-1, },
},
{ /*input.*/ { { 0x3041,0x3042,0x3049,0x0000 },
{ 0x3041,0x3042,0x0000 }, }, /* #8 */
/*expect*/ { 0,1,0x3049, },
/*expect*/ { 0,1,1, },
},
{ is_last: 1 }
}

View File

@ -23,6 +23,7 @@ tst_wcscmp (FILE * fp, int debug_flg)
ws1 = TST_INPUT (wcscmp).ws1;
ws2 = TST_INPUT (wcscmp).ws2;
ret = wcscmp (ws1, ws2);
ret = (ret > 0 ? 1 : ret < 0 ? -1 : 0);
if (debug_flg)
{

View File

@ -1,7 +1,7 @@
libc {
GLIBC_2.0 {
# functions used in inline functions or macros
__wcsto*_internal; __mbrlen;
__wcsto*_internal; __mbrlen; __mbrtowc;
# b*
btowc;