summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.string/isinstr.stp
diff options
context:
space:
mode:
authorhunt <hunt>2006-08-21 16:39:35 +0000
committerhunt <hunt>2006-08-21 16:39:35 +0000
commitfc98aa95b304065ebbf8beb77699d7b686591259 (patch)
tree6de0c75a45af70b7d3ceba77ef62c2dfaa0b756f /testsuite/systemtap.string/isinstr.stp
parent8267555c5fefa23a30988e3327c4aaeeed662c54 (diff)
downloadsystemtap-steved-fc98aa95b304065ebbf8beb77699d7b686591259.tar.gz
systemtap-steved-fc98aa95b304065ebbf8beb77699d7b686591259.tar.xz
systemtap-steved-fc98aa95b304065ebbf8beb77699d7b686591259.zip
New tests for string functions.
Diffstat (limited to 'testsuite/systemtap.string/isinstr.stp')
-rw-r--r--testsuite/systemtap.string/isinstr.stp25
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/systemtap.string/isinstr.stp b/testsuite/systemtap.string/isinstr.stp
new file mode 100644
index 00000000..4688fe18
--- /dev/null
+++ b/testsuite/systemtap.string/isinstr.stp
@@ -0,0 +1,25 @@
+probe begin
+{
+ a = "foo"
+ str = "abcfoobad"
+
+ if (isinstr(str,a))
+ printf("\"%s\" is in \"%s\"\n", a, str)
+ else
+ printf("\"%s\" is NOT in \"%s\"\n", a, str)
+
+ str = "abcdefg"
+ if (isinstr(str,a))
+ printf("\"%s\" is in \"%s\"\n", a, str)
+ else
+ printf("\"%s\" is NOT in \"%s\"\n", a, str)
+
+ a = ""
+ str = ""
+ if (isinstr(str,a))
+ printf("\"%s\" is in \"%s\"\n", a, str)
+ else
+ printf("\"%s\" is NOT in \"%s\"\n", a, str)
+
+ exit()
+}