aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp')
-rw-r--r--gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp21
1 files changed, 15 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp b/gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp
index f9610af..6b46b1c 100644
--- a/gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp
+++ b/gdb/testsuite/gdb.testsuite/gdb-caching-proc.exp
@@ -22,23 +22,32 @@ gdb_caching_proc gdb_testsuite_gdb_caching_proc_exp_arg { arg } {
return $arg
}
+gdb_caching_proc gdb_testsuite_gdb_caching_proc_exp_arg_nested { arg } {
+ incr ::count
+ return [gdb_testsuite_gdb_caching_proc_exp_arg $arg]
+}
+
+# List of "expected $::count after running expression" and
+# "expression".
set assertions {
- { [gdb_testsuite_gdb_caching_proc_exp_noarg] == 1 }
- { [gdb_testsuite_gdb_caching_proc_exp_arg 1] == 1 }
- { [gdb_testsuite_gdb_caching_proc_exp_arg "foo foo"] == "foo foo" }
+ 1 { [gdb_testsuite_gdb_caching_proc_exp_noarg] == 1 }
+ 1 { [gdb_testsuite_gdb_caching_proc_exp_arg 1] == 1 }
+ 1 { [gdb_testsuite_gdb_caching_proc_exp_arg "foo foo"] == "foo foo" }
+ 1 { [gdb_testsuite_gdb_caching_proc_exp_arg_nested "foo foo"] == "foo foo" }
+ 2 { [gdb_testsuite_gdb_caching_proc_exp_arg_nested "bar bar"] == "bar bar" }
}
set assertion_nr 0
-foreach assertion $assertions {
+foreach {expected_count assertion} $assertions {
with_test_prefix $assertion_nr {
set ::count 0
gdb_assert $assertion
- gdb_assert { $::count == 1 }
+ gdb_assert { $::count == $expected_count }
with_test_prefix cached {
gdb_assert $assertion
- gdb_assert { $::count == 1 }
+ gdb_assert { $::count == $expected_count }
}
}
incr assertion_nr