testsuite/systemtap.string/strpos.stp
raw| 1 | private function dotest(haystack, needle) |
| 2 | { |
| 3 | printf("haystack=\"%s\" needle=\"%s\" strpos=%d\n", |
| 4 | haystack, needle, strpos(haystack, needle)) |
| 5 | } |
| 6 | |
| 7 | probe oneshot |
| 8 | { |
| 9 | dotest("foo", "abcfoobad") |
| 10 | dotest("abcfoobad", "foo") |
| 11 | dotest("foo", "foo") |
| 12 | dotest("foo", "") |
| 13 | dotest("", "foo") |
| 14 | dotest("", "") |
| 15 | } |