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: [RFA] testsuite/arithmet.change: Remove duplicate assignments


Michael Elizabeth Chastain wrote:
> 
> Here is my final change to gdb.base/arithmet.exp.
> 
> This change removes several of the repetitive variable assignment so
> that variables keep their values longer.  I do this to conform to the
> requirement that all test names be unique.
> 
> I could conform in a different way by keeping all the tests, but using
> the optional third argument to gdb_test to give the affected tests
> different names.  It's a matter of taste and my taste runs towards
> removing lines.  I'll accede to other maintainers' taste if they'd
> rather just add names though.
> 
> Testing: I tested this on native Red Hat Linux 7 and native Solaris 2.8
> with a gcc-3_0-branch gcc.
> 
> OK to apply?
> 
> Michael
> 

Sure.  That was a smart solution.

Thanks.





> ===
> 
> 2001-06-24  Michael Chastain  <chastain@redhat.com>
> 
>         * gdb.base/arithmet.exp: Remove some tests to make all test names
>         unique.
> 
> Index: gdb/testsuite/gdb.base//arithmet.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/arithmet.exp,v
> retrieving revision 1.3
> diff -c -3 -p -r1.3 arithmet.exp
> *** gdb/testsuite/gdb.base//arithmet.exp        2001/06/23 05:22:46     1.3
> --- gdb/testsuite/gdb.base//arithmet.exp        2001/06/25 06:17:53
> *************** gdb_test "print x%y%z"  "0"
> *** 94,133 ****
> 
>   gdb_test "set variable x=10" ""
>   gdb_test "set variable y=4"  ""
> - gdb_test "set variable z=2"  ""
> 
>   #  x  y  z  w
>   # 10  4  2  3
> 
>   gdb_test "print x+y-z" "12"
>   gdb_test "print x+y*z" "18"
> !
> ! #  x  y  z  w
> ! # 10  4  3  3
> !
> ! gdb_test "set variable z=3"  ""
> ! gdb_test "print x+y%z" "11"
> ! gdb_test "print x+y/z" "11"
> !
> ! #  x  y  z  w
> ! # 10  4  2  3
> !
> ! gdb_test "set variable z=2"  ""
>   gdb_test "print x-y*z"  "2"
>   gdb_test "print x-y%z" "10"
>   gdb_test "print x-y/z"  "8"
>   gdb_test "print x*y/z" "20"
> !
> ! #  x  y  z  w
> ! # 10  4  3  3
> !
> ! gdb_test "set variable z=3"  ""
> ! gdb_test "print x*y%z"  "1"
> ! gdb_test "print x/y%z"  "2"
> 
>   # test use of parentheses to enforce different order of evaluation
> 
> ! gdb_test "print x-(y+z)"  "3"
> ! gdb_test "print x/(y*z)"  "0"
> ! gdb_test "print x-(y/z)"  "9"
> ! gdb_test "print (x+y)*z" "42"
> --- 94,117 ----
> 
>   gdb_test "set variable x=10" ""
>   gdb_test "set variable y=4"  ""
> 
>   #  x  y  z  w
>   # 10  4  2  3
> 
>   gdb_test "print x+y-z" "12"
>   gdb_test "print x+y*z" "18"
> ! gdb_test "print x+y%w" "11"
> ! gdb_test "print x+y/w" "11"
>   gdb_test "print x-y*z"  "2"
>   gdb_test "print x-y%z" "10"
>   gdb_test "print x-y/z"  "8"
>   gdb_test "print x*y/z" "20"
> ! gdb_test "print x*y%w"  "1"
> ! gdb_test "print x/y%w"  "2"
> 
>   # test use of parentheses to enforce different order of evaluation
> 
> ! gdb_test "print x-(y+w)"  "3"
> ! gdb_test "print x/(y*w)"  "0"
> ! gdb_test "print x-(y/w)"  "9"
> ! gdb_test "print (x+y)*w" "42"

-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


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