about summary refs log tree commit diff
path: root/localedata/collate-test.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-12-26 09:07:14 +0000
committerUlrich Drepper <drepper@redhat.com>1999-12-26 09:07:14 +0000
commita35766db1672710adfc5c2dae5335526d20abab4 (patch)
tree067078fd70006041ce22749ec0d70a116fcac42c /localedata/collate-test.c
parentf6ada7adcbb56e73ee3a168a515f9b5cbe179611 (diff)
downloadglibc-a35766db1672710adfc5c2dae5335526d20abab4.tar.gz
glibc-a35766db1672710adfc5c2dae5335526d20abab4.tar.xz
glibc-a35766db1672710adfc5c2dae5335526d20abab4.zip
Update.
	* collate-test.c (main): Correct logic in test.
Diffstat (limited to 'localedata/collate-test.c')
-rw-r--r--localedata/collate-test.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/localedata/collate-test.c b/localedata/collate-test.c
index 84451967b5..75b234e2cc 100644
--- a/localedata/collate-test.c
+++ b/localedata/collate-test.c
@@ -1,5 +1,5 @@
 /* Test collation function using real data.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -93,11 +93,9 @@ main (int argc, char *argv[])
       /* While we are at it a first little test.  */
       r1 = strcoll (strings[idx1].key, strings[idx2].key);
       r2 = strcoll (strings[idx2].key, strings[idx1].key);
-      r = -(r1 * r2);
-      if (r)
-	r /= abs (r1 * r2);
+      r = r1 * r2;
 
-      if (r < 0 || abs (r1) != r || abs (r2) != r)
+      if (r > 0 || (r == 0 && r1 != 0) || (r == 0 && r2 != 0))
 	printf ("`%s' and `%s' collate wrong: %d vs. %d\n",
 		strings[idx1].key, strings[idx2].key, r1, r2);
     }