aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-05-19 12:27:19 -0600
committerTom Tromey <tromey@adacore.com>2020-05-19 12:35:07 -0600
commit7d874253bfe9846e8d78790bbc32a152a94aa366 (patch)
treec8740ad160813fce88fd7f6a8f60732f2bc8f0aa
parent563c591bedf2e84ef812a89d573ece8546bd3c99 (diff)
downloadgdb-7d874253bfe9846e8d78790bbc32a152a94aa366.zip
gdb-7d874253bfe9846e8d78790bbc32a152a94aa366.tar.gz
gdb-7d874253bfe9846e8d78790bbc32a152a94aa366.tar.bz2
Fix duplicate tests in gdb.rust
gdb.rust complains about some duplicate test names. This patch fixes this in a straightforward way. 2020-05-19 Tom Tromey <tromey@adacore.com> * gdb.rust/simple.exp: Add some test descriptions. (test_one_slice): Use with_test_prefix.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.rust/simple.exp18
2 files changed, 15 insertions, 8 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 74d8b84..12ca19c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-19 Tom Tromey <tromey@adacore.com>
+
+ * gdb.rust/simple.exp: Add some test descriptions.
+ (test_one_slice): Use with_test_prefix.
+
2020-05-18 Tom de Vries <tdevries@suse.de>
* gdb.base/gdb-caching-proc.exp: Use with_test_prefix.
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 6daaf84..2653170 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -45,11 +45,11 @@ gdb_test "ptype c" " = i32"
gdb_test "print sizeof(c)" " = 4"
gdb_test "print c = 87" " = \\(\\)"
-gdb_test "print c" " = 87"
+gdb_test "print c" " = 87" "print after assignment"
gdb_test "print c += 3" " = \\(\\)"
-gdb_test "print c" " = 90"
+gdb_test "print c" " = 90" "print after plus assignment"
gdb_test "print c -= 90" " = \\(\\)"
-gdb_test "print c" " = 0"
+gdb_test "print c" " = 0" "print after minus assignment"
gdb_test "print *&c" " = 0"
gdb_test "print *(&c as &i32)" " = 0"
gdb_test "print *(&c as *const i32)" " = 0"
@@ -88,7 +88,7 @@ gdb_test "print w\[2\] @ 2" " = \\\[3, 4\\\]"
gdb_test "print w_ptr\[2\]" " = 3"
gdb_test "print fromslice" " = 3"
gdb_test "print slice\[0\]" " = 3"
-gdb_test "print slice as &\[i32\]\[0\]" " = 3"
+gdb_test "print slice as &\[i32\]\[0\]"
gdb_test_sequence "ptype slice" "" {
" = struct &\\\[i32\\\] \\{"
@@ -289,12 +289,14 @@ gdb_test "print st" \
" = simple::StringAtOffset {field1: \"hello\", field2: 1, field3: \"world\"}"
proc test_one_slice {svar length base range} {
- global hex
+ with_test_prefix $range {
+ global hex
- set result " = &\\\[.*\\\] \\{data_ptr: $hex, length: $length\\}"
+ set result " = &\\\[.*\\\] \\{data_ptr: $hex, length: $length\\}"
- gdb_test "print $svar" $result
- gdb_test "print &${base}\[${range}\]" $result
+ gdb_test "print $svar" $result
+ gdb_test "print &${base}\[${range}\]" $result
+ }
}
test_one_slice slice 1 w 2..3