This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug localedata/15831] New: Bad $expect passed from tst-fmon.sh to tst-fmon


http://sourceware.org/bugzilla/show_bug.cgi?id=15831

            Bug ID: 15831
           Summary: Bad $expect passed from tst-fmon.sh to tst-fmon
           Product: glibc
           Version: 2.17
            Status: NEW
          Keywords: glibc_2.17
          Severity: normal
          Priority: P2
         Component: localedata
          Assignee: unassigned at sourceware dot org
          Reporter: slicer_ghent at hushmail dot com
                CC: libc-locales at sourceware dot org
              Host: x86_64-unknown-linux-gnu
             Build: x86_64-unknown-linux-gnu

uname -m = x86_64
uname -r = 3.0.0-12-generic
uname -s = Linux
uname -v = #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011

Working from SRCDIR/glibc-build/, as per INSTALL instructions:

$ ../glibc-2.17/configure --prefix=/usr --enable-add-ons --enable-shared
--enable-kernel=3.0.0 --with-headers=/usr/src/linux-headers-3.0.0-32/include

Completes successfully. Next:

$ make -j

Completes successfully. Next:

$ make check
[...]
/bin/sh tst-fmon.sh SRCDIR/glibc-build/ ' 
SRCDIR/glibc-build/elf/ld-linux-x86-64.so.2 --library-path
SRCDIR/glibc-build:SRCDIR/glibc-build/math:SRCDIR/glibc-build/elf:SRCDIR/glibc-build/dlfcn:SRCDIR/glibc-build/nss:SRCDIR/glibc-build/nis:SRCDIR/glibc-build/rt:SRCDIR/glibc-build/resolv:SRCDIR/glibc-build/crypt:SRCDIR/glibc-build/nptl'
tst-fmon.data \
      > SRCDIR/glibc-build/localedata/tst-fmon.out
make[2]: *** [SRCDIR/glibc-build/localedata/tst-fmon.out] Error 1
make[2]: Leaving directory `SRCDIR/glibc-2.17/localedata'
make[1]: *** [localedata/tests] Error 2
make[1]: Leaving directory `SRCDIR/glibc-2.17'
make: *** [check] Error 2

Contents of tst-fmon.out:

Locale: "de_DE.ISO-8859-1" Format: "%n" Value: "1.23" Received: "1,23 EUR"
Expected: "  1,23 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%n" Value: "-1.23" Received: "-1,23 EUR"
Expected: "        -1,23 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%n" Value: "1234.56" Received: "1.234,56
EUR" Expected: "   1.234,56 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%12n" Value: "123.45" Received: "  123,45
EUR" Expected: "    123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%12n" Value: "-123.45" Received: " -123,45
EUR" Expected: "  -123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%^n" Value: "1234.56" Received: "1234,56
EUR" Expected: "   1234,56 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%+n" Value: "1234.56" Received: "1.234,56
EUR" Expected: "  1.234,56 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%(n" Value: "1234.56" Received: "1.234,56
EUR" Expected: "  1.234,56 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%^n" Value: "1234.56" Received: "1234,56
EUR" Expected: "   1234,56 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%i" Value: "1.23" Received: "1,23 EUR"
Expected: "  1,23 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%i" Value: "-1.23" Received: "-1,23 EUR"
Expected: "        -1,23 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%i" Value: "1234.56" Received: "1.234,56
EUR" Expected: "   1.234,56 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%^i" Value: "1234.56" Received: "1234,56
EUR" Expected: "   1234,56 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%+i" Value: "1234.56" Received: "1.234,56
EUR" Expected: "  1.234,56 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%(i" Value: "1234.56" Received: "1.234,56
EUR" Expected: "  1.234,56 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%^i" Value: "1234.56" Received: "1234,56
EUR" Expected: "   1234,56 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%#5n" Value: "123.45" Received: "    123,45
EUR" Expected: "            123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%#5n" Value: "-123.45" Received: "-  
123,45 EUR" Expected: "       -   123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%=*#5n" Value: "123.45" Received: "
***123,45 EUR" Expected: "       ***123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%=*#5n" Value: "-123.45" Received:
"-***123,45 EUR" Expected: "     -***123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%=0#5n" Value: "123.45" Received: "
000123,45 EUR" Expected: "       000123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%=0#5n" Value: "-123.45" Received:
"-000123,45 EUR" Expected: "     -000123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%^#5n" Value: "123.45" Received: "   123,45
EUR" Expected: "           123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%^#5n" Value: "-123.45" Received: "- 
123,45 EUR" Expected: "       -  123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%^#5.0n" Value: "123.45" Received: "   123
EUR" Expected: "    123 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%^#5.0n" Value: "-123.45" Received: "-  123
EUR" Expected: "        -  123 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%^#5.4n" Value: "123.45" Received: "  
123,4500 EUR" Expected: "       123,4500 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%^#5.4n" Value: "-123.45" Received: "- 
123,4500 EUR" Expected: "   -  123,4500 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%(#5n" Value: "123.45" Received: "   
123,45 EUR" Expected: "           123,45 EUR" => false
Locale: "de_DE.ISO-8859-1" Format: "%(#5n" Value: "-123.45" Received: "(  
123,45 EUR)" Expected: "     (   123,45 EUR)" => false
Locale: "de_DE.ISO-8859-1" Format: "%!(#5n" Value: "123.45" Received: "   
123,45" Expected: "      123,45" => false
Locale: "de_DE.ISO-8859-1" Format: "%!(#5n" Value: "-123.45" Received: "(  
123,45)" Expected: "        (   123,45)" => false
Locale: "en_US.ISO-8859-1" Format: "%n" Value: "123.45" Received: "$123.45"
Expected: " $123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%n" Value: "-123.45" Received: "-$123.45"
Expected: "       -$123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%i" Value: "123.45" Received: "USD 123.45"
Expected: "      USD 123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%i" Value: "-123.45" Received: "-USD
123.45" Expected: "    -USD 123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%11n" Value: "123.45" Received: "   
$123.45" Expected: "       $123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%11n" Value: "-123.45" Received: "  
-$123.45" Expected: "     -$123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%=*#5n" Value: "123.45" Received: "
$***123.45" Expected: "  $***123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%=*#5n" Value: "-123.45" Received:
"-$***123.45" Expected: "        -$***123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%=0#5n" Value: "123.45" Received: "
$000123.45" Expected: "  $000123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%=0#5n" Value: "-123.45" Received:
"-$000123.45" Expected: "        -$000123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%^#5n" Value: "123.45" Received: " $ 
123.45" Expected: "    $  123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%^#5n" Value: "-123.45" Received: "-$ 
123.45" Expected: "  -$  123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%^#5.0n" Value: "123.45" Received: " $ 
123" Expected: "     $  123" => false
Locale: "en_US.ISO-8859-1" Format: "%^#5.0n" Value: "-123.45" Received: "-$ 
123" Expected: "   -$  123" => false
Locale: "en_US.ISO-8859-1" Format: "%^#5.4n" Value: "123.45" Received: " $ 
123.4500" Expected: "        $  123.4500" => false
Locale: "en_US.ISO-8859-1" Format: "%^#5.4n" Value: "-123.45" Received: "-$ 
123.4500" Expected: "      -$  123.4500" => false
Locale: "en_US.ISO-8859-1" Format: "%(#5n" Value: "123.45" Received: " $  
123.45" Expected: "   $   123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%(#5n" Value: "-123.45" Received: "($  
123.45)" Expected: "        ($   123.45)" => false
Locale: "en_US.ISO-8859-1" Format: "%!(#5n" Value: "123.45" Received: "   
123.45" Expected: "      123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%!(#5n" Value: "-123.45" Received: "(  
123.45)" Expected: "        (   123.45)" => false
Locale: "en_US.ISO-8859-1" Format: "%#5n" Value: "123.45" Received: " $  
123.45" Expected: "    $   123.45" => false
Locale: "en_US.ISO-8859-1" Format: "%#5n" Value: "-123.45" Received: "-$  
123.45" Expected: "  -$   123.45" => false

Began inspecting tst-fmon.sh since it was the script called in the last command
reported. Eventually worked through tst-fmon.c and then strfmon.c. Feeling in
over my head, I found documentation for strfmon.c at
http://www.gnu.org/software/libc/manual/html_mono/libc.html in Section 7.7.
Returning to tst-fmon.out, I realized the "Received" values were correct, as
per the documentation I had just read, and the "Expected" values were not.

I now opened tst-fmon.data for inspection. What is weird to me is that extra
white space appears to be added to the left of the expectation, but this is not
consistent because, for instance, the line:

de_DE.ISO-8859-1        %12n    3456.781        3.456,78 EUR

passes the test, as it should if all intervening whitespace were removed, but
the line:

de_DE.ISO-8859-1        %12n    -123.45          -123,45 EUR

fails because an extra space has been added to the left side giving the
expectation a total width of 13 characters, rather than 12, as seen in the
format specifier.

Why the extra space would be added to the second example and not the first is
not a question I am able to answer. I thought it might have been an issue with
the read builtin. On my system:

$ ll /bin/sh
lrwxrwxrwx 1 root root 4 2011-12-24 01:00 /bin/sh -> dash
$ ll /bin/dash
-rwxr-xr-x 1 root root 109768 2011-05-03 08:04 /bin/dash

So I included a line in tst-fmon.sh to print the values read in from
tst-fmon.data. The results appeared to be correct, so I modified tst-fmon.c to
print out the values it was passed and found that extra whitespace had then
been added.

For example, the following line from tst-fmon.data:

de_DE.ISO-8859-1        %=*#5n  123.45           ***123,45 EUR

is stored as such in tst-fmon.sh:

de_DE.ISO-8859-1
%=*#5n
123.45
 ***123,45 EUR

but appears in tst-fmon as:

de_DE.ISO-8859-1
%=*#5n
123.45
        ***123,45 EUR

Hopefully this is helpful. If you require any more information, let me know.
Also, from the lines I did inspect in tst-fmon.data, there appear to be
redundant tests at lines 59/64 and 68/73 and there is a typo in tst-fmon.c
which states that it expects three parameters and then describes four.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]