incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Liviu Nicoara <nikko...@hates.ms>
Subject Re: [PATCH] STDCXX-1073
Date Sat, 13 Oct 2012 15:16:29 GMT
The initial patch does not pass the following test case. Have re-worked 
the patch and attached it to the incident, and I am also attaching it 
here. It passes all collate tests.

Here is the second test case:

$ cat ../../tests/localization/t.cpp; nice make t.cpp && ./t af_ZA.utf8; 
echo $?
#include <iostream>
#include <locale>
#include <string>

int
main (int argc, char** argv)
{
     std::locale loc (argv [1]);

     const std::collate< char >& fac =
         std::use_facet< std::collate< char > > (loc);

     char const buf [] = "a\0\0b";
     std::string s = fac.transform (buf, buf + sizeof buf - 1);

     size_t i = 0;
     for (; i < s.size () && 0 == s [i]; ++i) ;

     return !(i == 2);
}
1

On 10/10/12 08:25, Liviu Nicoara wrote:
> 2012-10-10  Liviu Nicoara  <lnicoara@apache.org>
>
>      * src/collate.cpp (__rw_strnxfrm): preserved embedded NULs
>


Mime
View raw message