[haiku-commits] haiku: hrev43565 - src/tests/system/libroot/posix

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 27 Dec 2011 23:34:45 +0100 (CET)

hrev43565 adds 1 changeset to branch 'master'
old head: 9cb0187a4ff4222a3e317a6acd4cd18d76ab1cab
new head: 3d438b96051778550e5dc54eef4a7f42074726a0

----------------------------------------------------------------------------

3d438b9: Fix collation-related part of locale_test.
  
  * don't try to compute the size of an array passed in as parameter,
    but use end markers instead
  * use fr_CA instead of fr_FR when testing reverse collation of secondary
    differences (fr_FR doesn't do that by default anymore)

                                    [ Oliver Tappe <zooey@xxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev43565
Commit:      3d438b96051778550e5dc54eef4a7f42074726a0
URL:         http://cgit.haiku-os.org/haiku/commit/?id=3d438b9
Author:      Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
Date:        Tue Dec 27 22:34:08 2011 UTC

----------------------------------------------------------------------------

1 files changed, 12 insertions(+), 4 deletions(-)
src/tests/system/libroot/posix/locale_test.cpp |   16 ++++++++++++----

----------------------------------------------------------------------------

diff --git a/src/tests/system/libroot/posix/locale_test.cpp 
b/src/tests/system/libroot/posix/locale_test.cpp
index 050c566..5a50537 100644
--- a/src/tests/system/libroot/posix/locale_test.cpp
+++ b/src/tests/system/libroot/posix/locale_test.cpp
@@ -1461,13 +1461,13 @@ static int sign (int a)
 
 
 void
-test_coll(bool useStrxfrm, const char* locale, const coll_data coll[])
+test_coll(bool useStrxfrm, const char* locale, const coll_data* coll)
 {
        setlocale(LC_COLLATE, locale);
        printf("%s in %s locale\n", useStrxfrm ? "strxfrm" : "strcoll", locale);
 
        int problemCount = 0;
-       for (unsigned int i = 0; i < sizeof(coll) / sizeof(coll_data); ++i) {
+       for (unsigned int i = 0; coll[i].a != NULL; ++i) {
                errno = 0;
                int result;
                char funcCall[100];
@@ -1508,6 +1508,7 @@ test_collation()
                { "test", "tester", -1, 0 },
                { "tast", "täst", -1, EINVAL },
                { "tæst", "test", 1, EINVAL },
+               { NULL, NULL, 0, 0 },
        };
        test_coll(0, "POSIX", coll_posix);
        test_coll(1, "POSIX", coll_posix);
@@ -1535,6 +1536,7 @@ test_collation()
                { "cote", "coté", -1, 0 },
                { "coté", "côte", -1, 0 },
                { "côte", "côté", -1, 0 },
+               { NULL, NULL, 0, 0 },
        };
        test_coll(0, "en_US.UTF-8", coll_en);
        test_coll(1, "en_US.UTF-8", coll_en);
@@ -1562,6 +1564,7 @@ test_collation()
                { "cote", "coté", -1, 0 },
                { "coté", "côte", -1, 0 },
                { "côte", "côté", -1, 0 },
+               { NULL, NULL, 0, 0 },
        };
        test_coll(0, "de_DE.UTF-8", coll_de);
        test_coll(1, "de_DE.UTF-8", coll_de);
@@ -1589,6 +1592,7 @@ test_collation()
                { "cote", "coté", -1, 0 },
                { "coté", "côte", -1, 0 },
                { "côte", "côté", -1, 0 },
+               { NULL, NULL, 0, 0 },
        };
        test_coll(0, "de_DE.UTF-8@collation=phonebook", coll_de_phonebook);
        test_coll(1, "de_DE.UTF-8@collation=phonebook", coll_de_phonebook);
@@ -1616,9 +1620,13 @@ test_collation()
                { "cote", "coté", -1, 0 },
                { "coté", "côte", 1, 0 },
                { "côte", "côté", -1, 0 },
+               { NULL, NULL, 0, 0 },
        };
-       test_coll(0, "fr_FR.UTF-8", coll_fr);
-       test_coll(1, "fr_FR.UTF-8", coll_fr);
+       // CLDR-1.9 has adjusted the defaults of fr_FR to no longer do reverse
+       // ordering of secondary differences (accents), but fr_CA still does 
that
+       // by default
+       test_coll(0, "fr_CA.UTF-8", coll_fr);
+       test_coll(1, "fr_CA.UTF-8", coll_fr);
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev43565 - src/tests/system/libroot/posix - zooey