From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15304 invoked by alias); 18 Dec 2002 18:05:47 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15296 invoked from network); 18 Dec 2002 18:05:46 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 209.249.29.67 with SMTP; 18 Dec 2002 18:05:46 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id gBII5Wn09888; Wed, 18 Dec 2002 10:05:32 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com, Michael Elizabeth Chastain Subject: Re: [patch] delete namespace __gnu_test from C++ testsuite References: <20021217233500.GA26182@nevyn.them.org> From: David Carlton Date: Wed, 18 Dec 2002 10:19:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-12/txt/msg00536.txt.bz2 On 17 Dec 2002 16:08:00 -0800, David Carlton said: > 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.) Actually, I'm misremembering the situation. What actually happened is that the tests in question were wrong. The .cc file looked like this, among other things: namespace __gnu_test { enum region { oriental, egyptian, greek, etruscan, roman }; } Then, at some point, the .exp file asked GDB to print the value of a variable whose type was that enum, as follows: # simple object, enum gdb_test "print test1.value" "\\$\[0-9\]* = egyptian" "simple object, enum" But this isn't really correct: a more sensible thing to look for is the value __gnu_test::egyptian: that's the canonical name of the enum constant in question. Which is, in fact, what my branch did, causing tests to go from PASS to FAIL when they should have been going from FAIL to PASS! Obviously it would be possible to fix the expected output for the tests, but then there's the problem that the current GDB wouldn't get them right (which isn't a big deal, in fact which is probably desirable, we can KFAIL them) and the more important problem that we're left without a test that tests GDB's ability to print out data members whose values are enum constants. So, for now, I'm a lot more interested in the latter issue, and removing the __gnu_test seemed like the best way to fix it. But I'll make sure I've filed a PR so that I add back tests to test this aspect of namespace support properly. David Carlton carlton@math.stanford.edu