Re: [RFC] testsuite/gdb.base/arithmet.exp: re-write

Michael Elizabeth Chastain
2001-06-12T09:42:00Z

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