Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Overload test failure patch
@ 1999-03-17 15:15 ahaas
  1999-04-01  0:00 ` ahaas
  0 siblings, 1 reply; 2+ messages in thread
From: ahaas @ 1999-03-17 15:15 UTC (permalink / raw)
  To: gdb-patches

Hi.

I believe one test in the 'overload' tests fails because of
a potential problem in the test program, not gdb. The failure
I see is when gdb prints out the values of instance 'foo_instance1'
of class 'Foo'. This instance is called with the constructor
function taking an integer as a parameter. The character pointer
parameter 'ccpfoo' is never initialized to anything, so when
gdb executes 'print foo_instance1' it prints out

{ifoo = '111', ccpfoo = 0xXXXXXX "{stuff}"}

instead of

{ifoo = '111', ccpfoo = 0x0}

as the test expects.

My patch modifies the constructor function to explicitly set
the pointer to null in this case, thus making the test pass.

I'm not a C++ programmer by a long shot, so this
patch may be compensating for an issue regarding the compiler -
egcs-1.1.2, i586 - but I really, really doubt that.

Use the patch as you see fit.

Art Haas
==============================================
--- gdb-4.17.86/gdb/testsuite/gdb.c++/overload.cc.orig	Mon Jan  4 09:35:05 1999
+++ gdb-4.17.86/gdb/testsuite/gdb.c++/overload.cc	Wed Mar 17 16:51:11 1999
@@ -73,7 +73,7 @@
     return 0; 
 }
 
-foo::foo  (int i)                  { ifoo = i;}
+foo::foo  (int i)                  { ifoo = i; ccpfoo = NULL;}
 foo::foo  (int i, const char *ccp) { ifoo = i; ccpfoo = ccp; }
 foo::foo  (foo& afoo)              { ifoo = afoo.ifoo; ccpfoo = afoo.ccpfoo;}
 foo::~foo ()                       {}


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-17 15:15 [PATCH] Overload test failure patch ahaas
1999-04-01  0:00 ` ahaas

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