This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]