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]
Other format: [Raw text]

[patch/testsuite/cp] classes.exp: cleanup TODO items


This patch cleans up several little TODO items in classes.exp.

Tested on native i686-pc-linux-gnu and native hppa2.0w-hp-hpux11.11.

I am committing this now.

Michael C

2004-08-13  Michael Chastain  <mec.gnu@mindspring.com>

	* gdb.cp/classes.exp: Remove unused declarations.  Just let
	test names default instead of providing special names.  Remove
	extraneous demangler test.

Index: gdb.cp/classes.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/classes.exp,v
retrieving revision 1.12
diff -c -3 -p -r1.12 classes.exp
*** gdb.cp/classes.exp	12 Aug 2004 18:51:41 -0000	1.12
--- gdb.cp/classes.exp	13 Aug 2004 08:00:51 -0000
***************
*** 18,24 ****
  # This file was written by Fred Fish. (fnf@cygnus.com)
  # And rewritten by Michael Chastain <mec.gnu@mindspring.com>.
  
- set ws "\[\r\n\t \]+"
  set nl "\[\r\n\]+"
  
  if $tracelevel then {
--- 18,23 ----
*************** if  { [gdb_compile "${srcdir}/${subdir}/
*** 40,46 ****
  # Test ptype of class objects.
  
  proc test_ptype_class_objects {} {
-     global gdb_prompt
  
      # Simple type.
  
--- 39,44 ----
*************** proc test_ptype_class_objects {} {
*** 320,396 ****
  }
  
  # Test simple access to class members.
- # TODO: these test names are gross!
- # Just let the test name default.
  
  proc test_non_inherited_member_access {} {
-     global gdb_prompt
      
      # Print non-inherited members of g_A.
!     gdb_test "print g_A.a" ".* = 1" "g_A.a incorrect"
!     gdb_test "print g_A.x" ".* = 2" "g_A.x incorrect"
  
      # Print non-inherited members of g_B.
!     gdb_test "print g_B.b" ".* = 5" "g_B.b incorrect"
!     gdb_test "print g_B.x" ".* = 6" "g_B.x incorrect"
  
      # Print non-inherited members of g_C.
!     gdb_test "print g_C.c" ".* = 9" "g_C.c incorrect"
!     gdb_test "print g_C.x" ".* = 10" "g_C.x incorrect"
  
      # Print non-inherited members of g_D.
!     gdb_test "print g_D.d" ".* = 19" "g_D.d incorrect"
!     gdb_test "print g_D.x" ".* = 20" "g_D.x incorrect"
  
      # Print non-inherited members of g_E.
!     gdb_test "print g_E.e" ".* = 31" "g_E.e incorrect"
!     gdb_test "print g_E.x" ".* = 32" "g_E.x incorrect"
  }
  
  # Test access to members of other classes.
  # gdb should refuse to print them.
  # (I feel old -- I remember when this was legal in C -- chastain).
- # TODO: Again, change the silly test names.
  
  proc test_wrong_class_members {} {
!     global gdb_prompt
! 
!     gdb_test "print g_A.b" "There is no member( or method|) named b." "print g_A.b should be error"
!     gdb_test "print g_B.c" "There is no member( or method|) named c." "print g_B.c should be error"
!     gdb_test "print g_B.d" "There is no member( or method|) named d." "print g_B.d should be error"
!     gdb_test "print g_C.b" "There is no member( or method|) named b." "print g_C.b should be error"
!     gdb_test "print g_C.d" "There is no member( or method|) named d." "print g_C.d should be error"
!     gdb_test "print g_D.e" "There is no member( or method|) named e." "print g_D.e should be error"
  }
  
  # Test access to names that are not members of any class.
- # TODO: test names again.
  
  proc test_nonexistent_members {} {
!     global gdb_prompt
! 
!     gdb_test "print g_A.y" "There is no member( or method|) named y." "print g_A.y should be error"
!     gdb_test "print g_B.z" "There is no member( or method|) named z." "print g_B.z should be error"
!     gdb_test "print g_C.q" "There is no member( or method|) named q." "print g_C.q should be error"
!     gdb_test "print g_D.p" "There is no member( or method|) named p." "print g_D.p should be error"
  }
  
  # Call a method that expects a base class parameter with base, inherited,
  # and unrelated class arguments.
  
  proc test_method_param_class {} {
!     gdb_test "call class_param.Aptr_a (&g_A)" ".* = 1" "base class param->a"
!     gdb_test "call class_param.Aptr_x (&g_A)" ".* = 2" "base class param->x"
!     gdb_test "call class_param.Aptr_a (&g_B)" ".* = 3" "inherited class param->a"
!     gdb_test "call class_param.Aptr_x (&g_B)" ".* = 4" "inherited class param->x"
!     gdb_test "call class_param.Aref_a (g_A)" ".* = 1" "base class (&param)->a"
!     gdb_test "call class_param.Aref_x (g_A)" ".* = 2" "base class (&param)->x"
!     gdb_test "call class_param.Aref_a (g_B)" ".* = 3" "inherited class (&param)->a"
!     gdb_test "call class_param.Aref_x (g_B)" ".* = 4" "inherited class (&param)->x"
!     gdb_test "call class_param.Aval_a (g_A)" ".* = 1" "base class param.a"
!     gdb_test "call class_param.Aval_x (g_A)" ".* = 2" "base class param.x"
!     gdb_test "call class_param.Aval_a (g_B)" ".* = 3" "inherited class param.a"
!     gdb_test "call class_param.Aval_x (g_B)" ".* = 4" "inherited class param.x"
  
      gdb_test "call class_param.Aptr_a (&foo)" "Cannot resolve .*" "unrelated class *param"
      gdb_test "call class_param.Aref_a (foo)" "Cannot resolve .*" "unrelated class &param"
--- 318,385 ----
  }
  
  # Test simple access to class members.
  
  proc test_non_inherited_member_access {} {
      
      # Print non-inherited members of g_A.
!     gdb_test "print g_A.a" ".* = 1"
!     gdb_test "print g_A.x" ".* = 2"
  
      # Print non-inherited members of g_B.
!     gdb_test "print g_B.b" ".* = 5"
!     gdb_test "print g_B.x" ".* = 6"
  
      # Print non-inherited members of g_C.
!     gdb_test "print g_C.c" ".* = 9"
!     gdb_test "print g_C.x" ".* = 10"
  
      # Print non-inherited members of g_D.
!     gdb_test "print g_D.d" ".* = 19"
!     gdb_test "print g_D.x" ".* = 20"
  
      # Print non-inherited members of g_E.
!     gdb_test "print g_E.e" ".* = 31"
!     gdb_test "print g_E.x" ".* = 32"
  }
  
  # Test access to members of other classes.
  # gdb should refuse to print them.
  # (I feel old -- I remember when this was legal in C -- chastain).
  
  proc test_wrong_class_members {} {
!     gdb_test "print g_A.b" "There is no member( or method|) named b."
!     gdb_test "print g_B.c" "There is no member( or method|) named c."
!     gdb_test "print g_B.d" "There is no member( or method|) named d."
!     gdb_test "print g_C.b" "There is no member( or method|) named b."
!     gdb_test "print g_C.d" "There is no member( or method|) named d."
!     gdb_test "print g_D.e" "There is no member( or method|) named e."
  }
  
  # Test access to names that are not members of any class.
  
  proc test_nonexistent_members {} {
!     gdb_test "print g_A.y" "There is no member( or method|) named y."
!     gdb_test "print g_B.z" "There is no member( or method|) named z."
!     gdb_test "print g_C.q" "There is no member( or method|) named q."
!     gdb_test "print g_D.p" "There is no member( or method|) named p."
  }
  
  # Call a method that expects a base class parameter with base, inherited,
  # and unrelated class arguments.
  
  proc test_method_param_class {} {
!     gdb_test "call class_param.Aptr_a (&g_A)" ".* = 1"
!     gdb_test "call class_param.Aptr_x (&g_A)" ".* = 2"
!     gdb_test "call class_param.Aptr_a (&g_B)" ".* = 3"
!     gdb_test "call class_param.Aptr_x (&g_B)" ".* = 4"
!     gdb_test "call class_param.Aref_a (g_A)" ".* = 1"
!     gdb_test "call class_param.Aref_x (g_A)" ".* = 2"
!     gdb_test "call class_param.Aref_a (g_B)" ".* = 3"
!     gdb_test "call class_param.Aref_x (g_B)" ".* = 4"
!     gdb_test "call class_param.Aval_a (g_A)" ".* = 1"
!     gdb_test "call class_param.Aval_x (g_A)" ".* = 2"
!     gdb_test "call class_param.Aval_a (g_B)" ".* = 3"
!     gdb_test "call class_param.Aval_x (g_B)" ".* = 4"
  
      gdb_test "call class_param.Aptr_a (&foo)" "Cannot resolve .*" "unrelated class *param"
      gdb_test "call class_param.Aref_a (foo)" "Cannot resolve .*" "unrelated class &param"
*************** proc test_method_param_class {} {
*** 402,408 ****
  proc test_enums {} {
      global gdb_prompt
      global nl
-     global ws
  
      # print the object
  
--- 391,396 ----
*************** proc test_enums {} {
*** 509,516 ****
  # Pointers to class members
  
  proc test_pointers_to_class_members {} {
-     global gdb_prompt
- 
      gdb_test "print Bar::z" "\\$\[0-9\]+ = \\(int ?\\( ?Bar::& ?\\) ?\\) ?Bar::z"
      gdb_test "print &Foo::x" "\\$\[0-9\]+ = \\(int ?\\( ?Foo::\\* ?\\) ?\\) ?&Foo::x"
      gdb_test "print (int)&Foo::x" "\\$\[0-9\]+ = 0"
--- 497,502 ----
*************** proc test_pointers_to_class_members {} {
*** 527,533 ****
  # Test static members.
  
  proc test_static_members {} {
-     global gdb_prompt
      global hex
  
      gdb_test "print Foo::st" "\\$\[0-9\]+ = 100"
--- 513,518 ----
*************** proc do_tests {} {
*** 634,644 ****
  	    fail "calling method for small class"
  	}
      }
- 
-     # This is a random v2 demangling test.
-     # This is redundant with existing tests in demangle.exp.
-     # TODO: Just remove this.
-     gdb_test "maint demangle inheritance1__Fv" "inheritance1\\(void\\)" "demangle"
  }
  
  do_tests
--- 619,624 ----


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