public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "slicer_ghent at hushmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug localedata/15831] New: Bad $expect passed from tst-fmon.sh to tst-fmon
Date: Mon, 12 Aug 2013 21:32:00 -0000	[thread overview]
Message-ID: <bug-15831-131@http.sourceware.org/bugzilla/> (raw)

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.


             reply	other threads:[~2013-08-12 21:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 21:32 slicer_ghent at hushmail dot com [this message]
2013-08-12 22:55 ` [Bug localedata/15831] " schwab@linux-m68k.org
2013-08-14  3:46 ` slicer_ghent at hushmail dot com
2013-08-14 14:50 ` carlos at redhat dot com
2013-08-18 20:47 ` joseph at codesourcery dot com
2013-08-19 18:29 ` carlos at redhat dot com
2014-06-13 13:12 ` fweimer at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-15831-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).