diff options
author | hunt <hunt> | 2006-08-21 16:39:35 +0000 |
---|---|---|
committer | hunt <hunt> | 2006-08-21 16:39:35 +0000 |
commit | fc98aa95b304065ebbf8beb77699d7b686591259 (patch) | |
tree | 6de0c75a45af70b7d3ceba77ef62c2dfaa0b756f /testsuite/systemtap.string/isinstr.stp | |
parent | 8267555c5fefa23a30988e3327c4aaeeed662c54 (diff) | |
download | systemtap-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.stp | 25 |
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() +} |