summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordsmith <dsmith>2006-11-06 16:18:18 +0000
committerdsmith <dsmith>2006-11-06 16:18:18 +0000
commit9f6cfc6aa98476877444bf86e35c13bec9ae7080 (patch)
tree86bedc0b89af735dce2bd2d0b5c812d1f52b4899
parent27f21e8c049b0cd20fd2d4e2fd9b96cad6c910cc (diff)
downloadsystemtap-steved-9f6cfc6aa98476877444bf86e35c13bec9ae7080.tar.gz
systemtap-steved-9f6cfc6aa98476877444bf86e35c13bec9ae7080.tar.xz
systemtap-steved-9f6cfc6aa98476877444bf86e35c13bec9ae7080.zip
2006-11-06 David Smith <dsmith@redhat.com>
* parseko/foreachstmt06.stp: Added new test for foreach "limit" keyword. * parseko/foreachstmt07.stp: Ditto. * parseok/foreachstmt01.stp: Ditto. * semko/foreachstmt01.stp: Ditto. * semko/foreachstmt02.stp: Ditto.
-rw-r--r--testsuite/ChangeLog9
-rwxr-xr-xtestsuite/parseko/foreachstmt06.stp12
-rwxr-xr-xtestsuite/parseko/foreachstmt07.stp12
-rwxr-xr-xtestsuite/parseok/foreachstmt01.stp10
-rwxr-xr-xtestsuite/semko/foreachstmt01.stp12
-rwxr-xr-xtestsuite/semko/foreachstmt02.stp17
6 files changed, 72 insertions, 0 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index e0bdd0d1..5ebaec26 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2006-11-06 David Smith <dsmith@redhat.com>
+
+ * parseko/foreachstmt06.stp: Added new test for foreach "limit"
+ keyword.
+ * parseko/foreachstmt07.stp: Ditto.
+ * parseok/foreachstmt01.stp: Ditto.
+ * semko/foreachstmt01.stp: Ditto.
+ * semko/foreachstmt02.stp: Ditto.
+
2006-11-02 Thang Nguyen <thang.p.nguyen@intel.com>
* systemtap.samples/tcptest.exp: Put TCP load gen into a
diff --git a/testsuite/parseko/foreachstmt06.stp b/testsuite/parseko/foreachstmt06.stp
new file mode 100755
index 00000000..43addb90
--- /dev/null
+++ b/testsuite/parseko/foreachstmt06.stp
@@ -0,0 +1,12 @@
+#! stap -p1
+
+# missing expression after limit
+
+global array
+
+function decl()
+{
+ array[0] = 1
+ foreach (key in array limit)
+ printf("key %d, value %d\n", key, array[key])
+}
diff --git a/testsuite/parseko/foreachstmt07.stp b/testsuite/parseko/foreachstmt07.stp
new file mode 100755
index 00000000..a7a9c9b9
--- /dev/null
+++ b/testsuite/parseko/foreachstmt07.stp
@@ -0,0 +1,12 @@
+#! stap -p1
+
+# missing limit keyword but with an expression
+
+global array
+
+function decl()
+{
+ array[0] = 1
+ foreach (key in array 5)
+ printf("key %d, value %d\n", key, array[key])
+}
diff --git a/testsuite/parseok/foreachstmt01.stp b/testsuite/parseok/foreachstmt01.stp
new file mode 100755
index 00000000..2b306474
--- /dev/null
+++ b/testsuite/parseok/foreachstmt01.stp
@@ -0,0 +1,10 @@
+#! stap -p1
+
+probe one
+{
+ foreach ([x+,y] in a limit 5) ;
+ n = 5 ;
+ foreach ([x,y-] in a limit n) ;
+ foreach ([x,y] in a+ limit n + 2) ;
+ foreach ([x,y] in a+ limit ++n) ;
+}
diff --git a/testsuite/semko/foreachstmt01.stp b/testsuite/semko/foreachstmt01.stp
new file mode 100755
index 00000000..6797c8d6
--- /dev/null
+++ b/testsuite/semko/foreachstmt01.stp
@@ -0,0 +1,12 @@
+#! stap -p2
+
+# limit keyword with string expression
+
+global array
+
+probe begin
+{
+ array[0] = 1
+ foreach (key in array limit "hi")
+ printf("key %d, value %d\n", key, array[key])
+}
diff --git a/testsuite/semko/foreachstmt02.stp b/testsuite/semko/foreachstmt02.stp
new file mode 100755
index 00000000..49eea342
--- /dev/null
+++ b/testsuite/semko/foreachstmt02.stp
@@ -0,0 +1,17 @@
+#! stap -p2
+
+# limit keyword with function returning a string expression
+
+global array
+
+function str_ret_type()
+{
+ return "hi"
+}
+
+probe begin
+{
+ array[0] = 1
+ foreach (key in array limit str_ret_type())
+ printf("key %d, value %d\n", key, array[key])
+}