summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.maps/foreach_limit.exp
diff options
context:
space:
mode:
authordsmith <dsmith>2006-11-06 19:08:43 +0000
committerdsmith <dsmith>2006-11-06 19:08:43 +0000
commit2c2b1e9a5eda8415e687350dc35cfb5d8b647c08 (patch)
tree9c996ef8b9a56d43a5cd72759c5aa40ec76a31d3 /testsuite/systemtap.maps/foreach_limit.exp
parent3a02f9bf9b9ccf502aa51b80f18be556b493a579 (diff)
downloadsystemtap-steved-2c2b1e9a5eda8415e687350dc35cfb5d8b647c08.tar.gz
systemtap-steved-2c2b1e9a5eda8415e687350dc35cfb5d8b647c08.tar.xz
systemtap-steved-2c2b1e9a5eda8415e687350dc35cfb5d8b647c08.zip
2006-11-06 David Smith <dsmith@redhat.com>
* systemtap.maps/foreach_limit.exp: Added new test for foreach "limit" keyword. * systemtap.maps/foreach_limit.stp: Ditto.
Diffstat (limited to 'testsuite/systemtap.maps/foreach_limit.exp')
-rw-r--r--testsuite/systemtap.maps/foreach_limit.exp83
1 files changed, 83 insertions, 0 deletions
diff --git a/testsuite/systemtap.maps/foreach_limit.exp b/testsuite/systemtap.maps/foreach_limit.exp
new file mode 100644
index 00000000..1d98a874
--- /dev/null
+++ b/testsuite/systemtap.maps/foreach_limit.exp
@@ -0,0 +1,83 @@
+# Test of foreach statements using "limit EXP".
+
+load_lib "stap_run2.exp"
+
+set test "foreach_limit"
+
+set ::result_string {Arrays:
+unsorted:
+key 9, value 18
+key 1, value 2
+key 8, value 16
+key 2, value 4
+key 7, value 14
+key 3, value 6
+key 6, value 12
+key 5, value 10
+key 4, value 8
+key 10, value 20
+
+unsorted limit 5:
+key 9, value 18
+key 1, value 2
+key 8, value 16
+key 2, value 4
+key 7, value 14
+loop had 5 iterations
+
+sorted limit 5:
+key 1, value 2
+key 2, value 4
+key 3, value 6
+key 4, value 8
+key 5, value 10
+loop had 5 iterations
+
+sorted limit x (3):
+key 1, value 2
+key 2, value 4
+key 3, value 6
+loop had 3 iterations
+
+sorted limit x * 2 (6):
+key 1, value 2
+key 2, value 4
+key 3, value 6
+key 4, value 8
+key 5, value 10
+key 6, value 12
+loop had 6 iterations
+
+sorted limit ++x:
+key 1, value 2
+key 2, value 4
+key 3, value 6
+key 4, value 8
+loop had 4 iterations
+x ended up as 4
+
+sorted limit x++:
+key 1, value 2
+key 2, value 4
+key 3, value 6
+key 4, value 8
+loop had 4 iterations
+x ended up as 5
+
+Aggregates:
+64 total aggregate entries
+
+aggregate limit 5:
+bucket 0: 0
+bucket 1: 0
+bucket 2: 1
+bucket 3: 4
+bucket 4: 11
+loop had 5 iterations
+
+Done.
+}
+
+stap_run2 $srcdir/$subdir/$test.stp
+
+