This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] testsuite/gdb.base/arithmet.exp: re-write
- To: msnyder at redhat dot com
- Subject: Re: [RFC] testsuite/gdb.base/arithmet.exp: re-write
- From: Michael Elizabeth Chastain <chastain at cygnus dot com>
- Date: Tue, 12 Jun 2001 09:48:15 -0700
- Cc: gdb-patches at sources dot redhat dot com
Michael Snyder writes:
> gdb_test "print x-y-z" "10" "test x-y-z == 10"
> gdb_test "print x-y-z" "9" "test x-y-z == 9"
The third parameter works well for this case.
Here is an awkward case:
gdb_test "set variable z=2" ""
...
gdb_test "set variable z=3" ""
...
gdb_test "set variable z=2" ""
...
gdb_test "set variable z=3" ""
...
I chose to make an operational change by re-organizing the assignments:
gdb_test "set variable z=2" ""
gdb_test "set variable w=3" ""
...
# no more assignments
# use either "z" or "w" as appropriate
Alternatively, I could do some 3rd-argument clutter:
gdb_test "set variable z=2" "" ".1. set variable z=2"
...
gdb_test "set variable z=3" "" ".2. set variable z=3"
...
gdb_test "set variable z=2" "" ".3. set variable z=2"
...
gdb_test "set variable z=3" "" ".4. set variable z=3"
...
There's really no general clean way to do this. And there's no tool
in common use that tells people "whoops, you just wrote a duplicate test".
Michael