Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* testsuite/print_long_arg_list
@ 1999-04-07  9:49 Philippe De Muyter
  1999-04-08 13:43 ` testsuite/print_long_arg_list Stan Shebs
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe De Muyter @ 1999-04-07  9:49 UTC (permalink / raw)
  To: gdb-patches

Running the testsuite with gdb-4.17.87 on m68k-motorola-sysv, I got
(among others) the following failure :

print_long_arg_list (a=22.219999999999998, b=33.332999999999998, c=0, d=-25, e=1
00, f=2345, struct1={value = 6, head = 0}, struct2={value = 10, head = 0}, struc
t3={value = 12, head = 0}, struct4={value = 14, head = 0}, flags={alpha = 1, bet
a = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0}, flags_combo={alpha = 1, be
ta = 0, ch1 = 121 'y', gamma = 1, delta = 0, ch2 = 110 'n', epsilon = 1, omega =
 0}, three_char={ch1 = 97 'a', ch2 = 98 'b', ch3 = 99 'c'}, five_char={ch1 = 108
 'l', ch2 = 109 'm', ch3 = 110 'n', ch4 = 111 'o', ch5 = 112 'p'}, int_char_comb
o={int1 = 123, ch1 = 122 'z'}, d1={double1 = 10.5}, d2={double1 = -3.33999999999
99998}, d3={double1 = 675.09122999999999}, f1={float1 = 45.2340012, float2 = 43.
5999985}, f2={float1 = 78.0100021, float2 = 122.099998}, f3={float1 = -1232.3449
7, float2 = -199.210007}) at call-ar-st.c:813
813         printf("double : %f\n", a);
(gdb) FAIL: gdb.base/call-ar-st.exp: step into print_long_arg_list


Looking at the expected result, I see :

    gdb_expect {
        -re ".*print_long_arg_list \\(a=22.219999999999999, b=33.332999999999998
, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value =
10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0
\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\},
 flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 =
 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\
', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n
\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \
'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.3399999999999999\}, d3=\{double
1 = 675.09123\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 =
78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.2100
07\}\\) at ${srcdir}/${subdir}/${srcfile}:813\[\r\n\]+813\[ \t\]+printf\\(\"doub
le :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list"}
        -re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
        timeout { fail "step into print_long_arg_list (timeout)" }
    }


For me, the differences are in the last digits of some float or double numbers.
Isn't the test too strict ?

Philippe



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: testsuite/print_long_arg_list
  1999-04-07  9:49 testsuite/print_long_arg_list Philippe De Muyter
@ 1999-04-08 13:43 ` Stan Shebs
  1999-04-08 15:28   ` testsuite/print_long_arg_list J.T. Conklin
  0 siblings, 1 reply; 4+ messages in thread
From: Stan Shebs @ 1999-04-08 13:43 UTC (permalink / raw)
  To: phdm; +Cc: gdb-patches, gdb

   Date: Wed, 7 Apr 1999 18:49:38 +0200 (CEST)
   From: "Philippe De Muyter" <phdm@macqel.be>

   Running the testsuite with gdb-4.17.87 on m68k-motorola-sysv, I got
   (among others) the following failure :

   print_long_arg_list (a=22.219999999999998, b=33.332999999999998, c=0, d=-25, e=1
   [...]

   Looking at the expected result, I see :

       gdb_expect {
	   -re ".*print_long_arg_list \\(a=22.219999999999999, b=33.332999999999998
   [...]

   For me, the differences are in the last digits of some float or double numbers.
   Isn't the test too strict ?

I'm no floating-point expert, but I do know that you're supposed to be
careful about ignoring the last digit.  On the other hand, GDB just
uses a printf %g to display float values, so the output is going to
depend on the system's C library as much as GDB's correctness.  In fact,
"a" is actually 22.22 in the sources, so even the expected test result
isn't what it should be.

My inclination is to relax the match here.  What does everybody else
think?

							Stan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: testsuite/print_long_arg_list
  1999-04-08 13:43 ` testsuite/print_long_arg_list Stan Shebs
@ 1999-04-08 15:28   ` J.T. Conklin
  1999-04-08 16:01     ` testsuite/print_long_arg_list Stan Shebs
  0 siblings, 1 reply; 4+ messages in thread
From: J.T. Conklin @ 1999-04-08 15:28 UTC (permalink / raw)
  To: gdb-patches; +Cc: phdm, gdb

>>>>> "Stan" == Stan Shebs <shebs@cygnus.com> writes:
Stan> I'm no floating-point expert, but I do know that you're supposed
Stan> to be careful about ignoring the last digit.  On the other hand,
Stan> GDB just uses a printf %g to display float values, so the output
Stan> is going to depend on the system's C library as much as GDB's
Stan> correctness.  In fact, "a" is actually 22.22 in the sources, so
Stan> even the expected test result isn't what it should be.

Stan> My inclination is to relax the match here.  What does everybody
Stan> else think?

Isn't the problem that 22.22 cannot be represented exactly in binary
floating point, thus is subject to various rounding issues in the
least significant digits?  Perhaps using values like 22.5, 22.25,
22.125, etc. would eliminate these problems.

	--jtc

-- 
J.T. Conklin
RedBack Networks


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: testsuite/print_long_arg_list
  1999-04-08 15:28   ` testsuite/print_long_arg_list J.T. Conklin
@ 1999-04-08 16:01     ` Stan Shebs
  0 siblings, 0 replies; 4+ messages in thread
From: Stan Shebs @ 1999-04-08 16:01 UTC (permalink / raw)
  To: jtc; +Cc: gdb-patches, phdm, gdb

   From: jtc@redback.com (J.T. Conklin)
   Date: 08 Apr 1999 15:26:12 -0700

   Isn't the problem that 22.22 cannot be represented exactly in binary
   floating point, thus is subject to various rounding issues in the
   least significant digits?  Perhaps using values like 22.5, 22.25,
   22.125, etc. would eliminate these problems.

Doh!  I should've thought of that!  Yes, that does give better
results, and the author of those tests, who is on this list, says
"change 'em however you want".  So that's what will happen.  Thanks! -s


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-04-08 16:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-07  9:49 testsuite/print_long_arg_list Philippe De Muyter
1999-04-08 13:43 ` testsuite/print_long_arg_list Stan Shebs
1999-04-08 15:28   ` testsuite/print_long_arg_list J.T. Conklin
1999-04-08 16:01     ` testsuite/print_long_arg_list Stan Shebs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox