public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [patch] srcwin testing patch
@ 2001-04-09 10:20 Martin M. Hunt
  0 siblings, 0 replies; only message in thread
From: Martin M. Hunt @ 2001-04-09 10:20 UTC (permalink / raw)
  To: insight

I have checked the following patch in.

2001-04-09  Martin M. Hunt  <hunt@redhat.com>

	* srcwin1.test: Fix line numbers to correspond to
	modified source files in gdb.base. Commented-out test
	case for moving up past main() because sometimes there
	is a libc init function which makes the results
	inconsistent.
	* srcwin2.test: Ditto.
	* srcwin3.test: Ditto.

Index: testsuite/gdb.gdbtk/srcwin.test
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.gdbtk/srcwin.test,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 srcwin.test
--- srcwin.test	2000/02/07 00:19:45	1.1.1.1
+++ srcwin.test	2001/04/09 16:51:27
@@ -1,4 +1,4 @@
-#   Copyright (C) 1999 Cygnus Solutions
+#   Copyright (C) 1999, 2001 Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -296,7 +296,7 @@ gdbtk_test srcwin-2.6 "goto function bar
     foreach {k v i} $z {
       if {$k == "tagon"} {
 	if {$v == "BROWSE_TAG"} {
-	  if {$i == "5.2"} {
+	  if {$i == "10.2"} {
 	    incr r
 	  } else {
 	    incr r 5
@@ -340,9 +340,9 @@ gdbtk_test srcwin-2.7 "goto function oof
     foreach {k v i} $z {
       if {$k == "tagon"} {
 	if {$v == "BROWSE_TAG"} {
-	  if {$i == "32.2"} {
+	  if {$i == "38.2"} {
 	    set line_number [$twin get "$i wordstart" "$i wordend"]
-	    if {$line_number == "32"} {
+	    if {$line_number == "38"} {
 	      incr r
 	    } else {
 	      incr r -100
@@ -475,7 +475,7 @@ gdbtk_test srcwin-2.10 "step" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -519,7 +519,7 @@ gdbtk_test srcwin-2.11 "set BP and conti
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "32.2"} {
+	    if {$i == "38.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -565,14 +565,16 @@ gdbtk_test srcwin-3.1 "stack up (1)" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "32.2"} {
+	    # return n + 1;
+	    if {$i == "38.2"} {
 	      incr r
 	    } else {
 	      incr r 5
 	    }
 	  }
 	  if {$v == "STACK_TAG"} {
-	    if {$i == "22.2"} {
+	    # oof (67);
+	    if {$i == "26.2"} {
 	      incr r
 	    } else {
 	      incr r 10
@@ -611,14 +613,16 @@ gdbtk_test srcwin-3.2 "stack up (2)" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "32.2"} {
+	    # return n + 1;
+	    if {$i == "38.2"} {
 	      incr r
 	    } else {
 	      incr r 5
 	    }
 	  }
 	  if {$v == "STACK_TAG"} {
-	    if {$i == "7.2"} {
+	    # long_line ();
+	    if {$i == "12.2"} {
 	      incr r
 	    } else {
 	      incr r 10
@@ -657,7 +661,7 @@ gdbtk_test srcwin-3.3 "stack up (3)" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "STACK_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -714,45 +718,47 @@ gdbtk_test srcwin-3.4 "stack up (4)" {
   set r
 } {1}

+# Disabled for now because there are different correct results.
+# Test should be rewritten to include those.
 # Test: srcwin-3.5
 # Desc: "stack up" when we are at the top
-gdbtk_test srcwin-3.5 "stack up when at the top" {
-  $srcwin stack up
-  set r 0
-  set name [$statbar.name get]
-  set func [$statbar.func get]
-
+#gdbtk_test srcwin-3.5 "stack up when at the top" {
+#  $srcwin stack up
+#  set r 0
+#  set name [$statbar.name get]
+#  set func [$statbar.func get]
+#
   # check contents of name and function comboboxes
-  if {$name != "list0.c"} {set r -1}
-  if {$func != "main"} {set r -2}
+#  if {$name != "list0.c"} {set r -1}
+#  if {$func != "main"} {set r -2}

   # check that the correct file is displayed
-  set twin [$stw test_get twin]
-  set a [$twin get 1.0 end]
-  if {[string compare $file1(source) $a]} {set r -3}
+#  set twin [$stw test_get twin]
+#  set a [$twin get 1.0 end]
+#  if {[string compare $file1(source) $a]} {set r -3}

   # check for PC_TAG and STACK_TAG on correct lines
-  if {$r == 0} {
-    if {![catch {set z [$twin dump -tag 1.0 end]}]} {
-      foreach {k v i} $z {
-	if {$k == "tagon"} {
-	  if {$v == "STACK_TAG"} {
-	    if {$i == "12.2"} {
-	      incr r
-	    } else {
-	      incr r 5
-	    }
-	  }
-	  if {$v == "PC_TAG"} {incr r 10}
-	  if {$v == "BROWSE_TAG"} {incr r 100}
-	}
-      }
-    } else {
-      set r -4
-    }
-  }
-  set r
-} {1}
+#  if {$r == 0} {
+#    if {![catch {set z [$twin dump -tag 1.0 end]}]} {
+#      foreach {k v i} $z {
+#	if {$k == "tagon"} {
+#	  if {$v == "STACK_TAG"} {
+#	    if {$i == "12.2"} {
+#	      incr r
+#	    } else {
+#	      incr r 5
+#	    }
+#	  }
+#	  if {$v == "PC_TAG"} {incr r 10}
+#	  if {$v == "BROWSE_TAG"} {incr r 100}
+#	}
+#      }
+#    } else {
+#      set r -4
+#    }
+#  }
+#  set r
+#} {1}

 # Test: srcwin-3.6
 # Desc: "stack down"  test
@@ -777,7 +783,7 @@ gdbtk_test srcwin-3.6 "stack down" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "STACK_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -817,7 +823,7 @@ gdbtk_test srcwin-3.7 "stack bottom" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "32.2"} {
+	    if {$i == "38.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -857,7 +863,7 @@ gdbtk_test srcwin-3.8 "stack down when a
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "32.2"} {
+	    if {$i == "38.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -897,7 +903,7 @@ gdbtk_test srcwin-4.1 "set BP in another
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "BROWSE_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -906,7 +912,7 @@ gdbtk_test srcwin-4.1 "set BP in another
 	  if {$v == "STACK_TAG"} {incr r 10}
 	  if {$v == "PC_TAG"} {incr r 100}
 	} elseif {$k == "image"} {
-	  if {$i == "8.0"} {
+	  if {$i == "9.0"} {
 	    incr r
 	  } else {
 	    set r -200
@@ -950,7 +956,7 @@ gdbtk_test srcwin-4.2 "temporary BP" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "BROWSE_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -959,7 +965,7 @@ gdbtk_test srcwin-4.2 "temporary BP" {
 	  if {$v == "STACK_TAG"} {incr r 10}
 	  if {$v == "PC_TAG"} {incr r 100}
 	} elseif {$k == "image"} {
-	  if {$i == "8.0"} {
+	  if {$i == "9.0"} {
 	    incr r
 	  } else {
 	    set r -200
@@ -979,7 +985,7 @@ gdbtk_test srcwin-4.2 "temporary BP" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -1016,7 +1022,7 @@ gdbtk_test srcwin-4.3 "BP Balloons" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -1176,9 +1182,9 @@ gdbtk_test srcwin-5.1 "variable balloon
   move_mouse_to $twin [$twin bbox 10.$index]
   sleep 1
   if {[winfo ismapped $balloon]} {
-    if {![string compare "x=6" [$balloon.label cget -text]]} {incr r}
+    if {![string compare "x=5" [$balloon.label cget -text]]} {incr r}
     gdb_immediate "continue" 1
-    if {![string compare "x=8" [$balloon.label cget -text]]} {incr r}
+    if {![string compare "x=7" [$balloon.label cget -text]]} {incr r}
   } else {
     set r -1
   }
Index: testsuite/gdb.gdbtk/srcwin2.test
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.gdbtk/srcwin2.test,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 srcwin2.test
--- srcwin2.test	2000/02/07 00:19:45	1.1.1.1
+++ srcwin2.test	2001/04/09 16:51:27
@@ -1,4 +1,4 @@
-#   Copyright (C) 1999 Cygnus Solutions
+#   Copyright (C) 1999, 2001 Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -283,14 +283,14 @@ gdbtk_test srcwin2-2.6 "goto function ba
   # now get a dump of all tags and check that only one line is
   # marked BROWSE_TAG and no lines are STACK_TAG or PC_TAG.

-  # We know that list1.c should have BROWSE_TAG set at index 5.2
+  # We know that list1.c should have BROWSE_TAG set at index 10.2
   # for function "bar".  If list1.c is changed or the layout of the source
   # window is changed, this must be updated.
   if {![catch {set z [$twin dump -tag 1.0 end]}]} {
     foreach {k v i} $z {
       if {$k == "tagon"} {
 	if {$v == "BROWSE_TAG"} {
-	  if {$i == "5.2"} {
+	  if {$i == "10.2"} {
 	    incr r
 	  } else {
 	    incr r 5
@@ -327,16 +327,16 @@ gdbtk_test srcwin2-2.7 "goto function oo
   # now get a dump of all tags and check that only one line is
   # marked BROWSE_TAG and no lines are STACK_TAG or PC_TAG.

-  # We know that list1.c should have BROWSE_TAG set at index 32.2
+  # We know that list1.c should have BROWSE_TAG set at index 38.2
   # for function "oof".  If list1.c is changed or the layout of the source
   # window is changed, this must be updated.
   if {![catch {set z [$twin dump -tag 1.0 end]}]} {
     foreach {k v i} $z {
       if {$k == "tagon"} {
 	if {$v == "BROWSE_TAG"} {
-	  if {$i == "32.2"} {
+	  if {$i == "38.2"} {
 	    set line_number [$twin get "$i wordstart" "$i wordend"]
-	    if {$line_number == "32"} {
+	    if {$line_number == "38"} {
 	      incr r
 	    } else {
 	      incr r -100
@@ -426,7 +426,7 @@ gdbtk_test srcwin2-2.11 "set BP and cont
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "32.2"} {
+	    if {$i == "38.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -472,14 +472,14 @@ gdbtk_test srcwin2-3.1 "stack up (1)" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "32.2"} {
+	    if {$i == "38.2"} {
 	      incr r
 	    } else {
 	      incr r 5
 	    }
 	  }
 	  if {$v == "STACK_TAG"} {
-	    if {$i == "22.2"} {
+	    if {$i == "26.2"} {
 	      incr r
 	    } else {
 	      incr r 10
@@ -518,14 +518,14 @@ gdbtk_test srcwin2-3.2 "stack up (2)" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "32.2"} {
+	    if {$i == "38.2"} {
 	      incr r
 	    } else {
 	      incr r 5
 	    }
 	  }
 	  if {$v == "STACK_TAG"} {
-	    if {$i == "7.2"} {
+	    if {$i == "12.2"} {
 	      incr r
 	    } else {
 	      incr r 10
@@ -564,7 +564,7 @@ gdbtk_test srcwin2-3.3 "stack up (3)" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "STACK_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -617,41 +617,44 @@ gdbtk_test srcwin2-3.4 "stack up (4)" {
   set r
 } {1}

+
+# Disabled for now because there are different correct results.
+# Test should be rewritten to include those.
 # Test: srcwin2-3.5
 # Desc: "stack up" when we are at the top
-gdbtk_test srcwin2-3.5 "stack up when at the top" {
-  $srcwin stack up
-  set r 0
-  set name [$statbar.name get]
-  set func [$statbar.func get]
+#gdbtk_test srcwin2-3.5 "stack up when at the top" {
+# $srcwin stack up
+#  set r 0
+#  set name [$statbar.name get]
+#  set func [$statbar.func get]

   # check contents of name and function comboboxes
-  if {$name != "list0.c"} {set r -1}
-  if {$func != "main"} {set r -2}
+#  if {$name != "list0.c"} {set r -1}
+#  if {$func != "main"} {set r -2}

   # check that the correct file is displayed
-  set twin [$stw test_get twin]
-  set a [$twin get 1.0 end]
-  if {[string compare $file1(source) $a]} {set r -3}
+#  set twin [$stw test_get twin]
+#  set a [$twin get 1.0 end]
+#  if {[string compare $file1(source) $a]} {set r -3}

   # check for STACK_TAG
-  if {$r == 0} {
-    if {![catch {set z [$twin dump -tag 1.0 end]}]} {
-      foreach {k v i} $z {
-	if {$k == "tagon"} {
-	  if {$v == "STACK_TAG"} {
-	    incr r
-	  }
-	  if {$v == "PC_TAG"} {incr r 10}
-	  if {$v == "BROWSE_TAG"} {incr r 100}
-	}
-      }
-    } else {
-      set r -4
-    }
-  }
-  set r
-} {1}
+#  if {$r == 0} {
+#    if {![catch {set z [$twin dump -tag 1.0 end]}]} {
+#      foreach {k v i} $z {
+#	if {$k == "tagon"} {
+#	  if {$v == "STACK_TAG"} {
+#	    incr r
+#	  }
+#	  if {$v == "PC_TAG"} {incr r 10}
+#	  if {$v == "BROWSE_TAG"} {incr r 100}
+#	}
+#      }
+#    } else {
+#      set r -4
+#    }
+#  }
+#  set r
+#} {1}

 # Test: srcwin2-3.6
 # Desc: "stack down"  test
@@ -676,7 +679,7 @@ gdbtk_test srcwin2-3.6 "stack down" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "STACK_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -716,7 +719,7 @@ gdbtk_test srcwin2-3.7 "stack bottom" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "32.2"} {
+	    if {$i == "38.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -756,7 +759,7 @@ gdbtk_test srcwin2-3.8 "stack down when
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "32.2"} {
+	    if {$i == "38.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -796,7 +799,7 @@ gdbtk_test srcwin2-4.1 "set BP in anothe
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "BROWSE_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -805,7 +808,7 @@ gdbtk_test srcwin2-4.1 "set BP in anothe
 	  if {$v == "STACK_TAG"} {incr r 10}
 	  if {$v == "PC_TAG"} {incr r 100}
 	} elseif {$k == "image"} {
-	  if {$i == "8.0"} {
+	  if {$i == "9.0"} {
 	    incr r
 	  } else {
 	    set r -200
@@ -849,7 +852,7 @@ gdbtk_test srcwin2-4.2 "temporary BP" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "BROWSE_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
@@ -858,7 +861,7 @@ gdbtk_test srcwin2-4.2 "temporary BP" {
 	  if {$v == "STACK_TAG"} {incr r 10}
 	  if {$v == "PC_TAG"} {incr r 100}
 	} elseif {$k == "image"} {
-	  if {$i == "8.0"} {
+	  if {$i == "9.0"} {
 	    incr r
 	  } else {
 	    set r -200
@@ -878,7 +881,7 @@ gdbtk_test srcwin2-4.2 "temporary BP" {
       foreach {k v i} $z {
 	if {$k == "tagon"} {
 	  if {$v == "PC_TAG"} {
-	    if {$i == "8.2"} {
+	    if {$i == "9.2"} {
 	      incr r
 	    } else {
 	      incr r 5
Index: testsuite/gdb.gdbtk/srcwin3.test
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.gdbtk/srcwin3.test,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 srcwin3.test
--- srcwin3.test	2000/02/07 00:19:45	1.1.1.1
+++ srcwin3.test	2001/04/09 16:51:27
@@ -1,4 +1,4 @@
-#   Copyright (C) 1999 Cygnus Solutions
+#   Copyright (C) 1999, 2001 Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -541,41 +541,43 @@ gdbtk_test srcwin3-3.4 "stack up (4)" {
   set r
 } {1}

+# Disabled for now because there are different correct results.
+# Test should be rewritten to include those.
 # Test: srcwin3-3.5
 # Desc: "stack up" when we are at the top
-gdbtk_test srcwin3-3.5 "stack up when at the top" {
-  $srcwin stack up
-  set r 0
-  set name [$statbar.name get]
-  set func [$statbar.func get]
+#gdbtk_test srcwin3-3.5 "stack up when at the top" {
+#  $srcwin stack up
+#  set r 0
+#  set name [$statbar.name get]
+#  set func [$statbar.func get]

   # check contents of name and function comboboxes
-  if {$name != ""} {set r -1}
-  if {$func != "main"} {set r -2}
+#  if {$name != ""} {set r -1}
+#  if {$func != "main"} {set r -2}

   # check that the correct file is displayed
-  set twin [$stw test_get twin]
-  set a [$twin get 1.0 end]
-  if {[string compare $source(main) $a]} {set r -3}
+#  set twin [$stw test_get twin]
+#  set a [$twin get 1.0 end]
+#  if {[string compare $source(main) $a]} {set r -3}

   # check for STACK_TAG
-  if {$r == 0} {
-    if {![catch {set z [$twin dump -tag 1.0 end]}]} {
-      foreach {k v i} $z {
-	if {$k == "tagon"} {
-	  if {$v == "STACK_TAG"} {
-	    incr r
-	  }
-	  if {$v == "PC_TAG"} {incr r 10}
-	  if {$v == "BROWSE_TAG"} {incr r 100}
-	}
-      }
-    } else {
-      set r -4
-    }
-  }
-  set r
-} {1}
+#  if {$r == 0} {
+#    if {![catch {set z [$twin dump -tag 1.0 end]}]} {
+#      foreach {k v i} $z {
+#	if {$k == "tagon"} {
+#	  if {$v == "STACK_TAG"} {
+#	    incr r
+#	  }
+#	  if {$v == "PC_TAG"} {incr r 10}
+#	  if {$v == "BROWSE_TAG"} {incr r 100}
+#	}
+#      }
+#    } else {
+#      set r -4
+#    }
+#  }
+#  set r
+#} {1}

 # Test: srcwin3-3.6
 # Desc: "stack down"  test

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-09 10:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-09 10:20 [patch] srcwin testing patch Martin M. Hunt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).