Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David Carlton <carlton@math.stanford.edu>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com,
	Michael Elizabeth Chastain <mec@shout.net>
Subject: Re: [patch] delete namespace __gnu_test from C++ testsuite
Date: Wed, 18 Dec 2002 03:11:00 -0000	[thread overview]
Message-ID: <ro1pts0mbof.fsf@jackfruit.Stanford.EDU> (raw)
In-Reply-To: <20021217233500.GA26182@nevyn.them.org>

On Tue, 17 Dec 2002 18:35:00 -0500, Daniel Jacobowitz <drow@mvista.com> said:
> On Tue, Dec 17, 2002 at 03:28:17PM -0800, David Carlton wrote:

>> I've committed the following patches to delete the namespace
>> __gnu_test from the C++ testsuite files in which it occurs: it's
>> pointless, illegally-named, and turns those files into tests of
>> namespace support as well as tests of whatever they're trying to
>> test.

> I hardly agree.  These tests were taken from libstdc++ or the
> libstdc++ testsuite, weren't they?  They have to work with the
> namespace.

Geez - you were the one who complained about that namespace when I
originally made the patch that created m-static1.cc. :-)

Anyways: I don't know where they were taken from: there's no
indication in the files or the ChangeLogs that they were taken from
anywhere else.  They may be taken from libstdc++, but they certainly
don't depend on libstdc++: the tests are in standard C++, and most of
the tests don't involve the library at all.

> I'd rather you added simpler versions rather than changing what an
> existing test is testing.  That messes up test results history in
> general.

Removing the namespace doesn't change what gdb.sum looks like at all.
If I were to add simpler versions, they would change the current file

  namespace __gnu_test
  {
    <lots of stuff>
  }

  main ()
  {
    using namespace __gnu_test;

    <more stuff>
  }

to

  namespace __gnu_test
  {
    <lots of stuff>
  }

  <the exact same lots of stuff, trivially modified to prevent name clashes>

  main ()
  {
    using namespace __gnu_test;

    <more stuff>

    <the exact same more stuff, trivially modified to prevent name clashes>
  }

(Plus similar changes for the .exp file.)  I don't see what the point
of that is.

Basically, I don't like tests that test multiple concepts at once, as
a general policy: if you have a test testing A and B then, when it
fails, you only know that you screwed up A or B, but not which.
(Exactly such a situation is what prompted me to remove these
namespaces: I'm not doing it for theoretical reasons, but because it's
already caused a practical problem for me once.)

When concepts A and B interact in nontrivial ways, then you should
ideally have tests for A, B, and A+B: and, indeed, m-data.cc, say, has
tests for data members that don't involve templates as well as data
members that do involve templates.  But it previously didn't have any
tests that involved data members but that didn't involve namespaces;
that's bad.  After the patch, it doesn't have tests that involve both
data members and namespaces; that's also bad, but it's not as bad, and
namespace.exp goes a long way towards covering that gap.

Admittedly, namespaces are orthogonal enough to other C++ language
issues that we may eventually want all or almost all of the C++
testsuite files to include namespace tests as well.  But, in the mean
time, I'd rather have focused tests rather than vague tests.

David Carlton
carlton@math.stanford.edu


  reply	other threads:[~2002-12-18  0:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-17 15:34 David Carlton
2002-12-17 16:08 ` Daniel Jacobowitz
2002-12-18  3:11   ` David Carlton [this message]
2002-12-18 10:19     ` David Carlton
2002-12-18 11:16 Michael Elizabeth Chastain
2002-12-18 11:46 ` David Carlton

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=ro1pts0mbof.fsf@jackfruit.Stanford.EDU \
    --to=carlton@math.stanford.edu \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec@shout.net \
    /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