From fc98aa95b304065ebbf8beb77699d7b686591259 Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 21 Aug 2006 16:39:35 +0000 Subject: New tests for string functions. --- testsuite/systemtap.string/isinstr.stp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 testsuite/systemtap.string/isinstr.stp (limited to 'testsuite/systemtap.string/isinstr.stp') 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() +} -- cgit