diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/systemtap.base/flightrec3.exp | 4 | ||||
-rw-r--r-- | testsuite/systemtap.string/tokenize.exp | 19 | ||||
-rw-r--r-- | testsuite/systemtap.string/tokenize.stp | 54 |
3 files changed, 39 insertions, 38 deletions
diff --git a/testsuite/systemtap.base/flightrec3.exp b/testsuite/systemtap.base/flightrec3.exp index 20a65c50..3799c6a6 100644 --- a/testsuite/systemtap.base/flightrec3.exp +++ b/testsuite/systemtap.base/flightrec3.exp @@ -61,7 +61,9 @@ catch {exec kill -CONT $pid} # check logfile number set cnt 0 foreach e [array names cpus] { - if {$cpus($e) != 6} { + # If we have more than 6 files per cpu, something is wrong. We + # might have less than 6 files per cpu if the machine is slow. + if {$cpus($e) > 6} { fail "$test (log file numbers cpu:$e, cnt:$cpus($e)))" } set cnt [expr $cnt + $cpus($e)] diff --git a/testsuite/systemtap.string/tokenize.exp b/testsuite/systemtap.string/tokenize.exp index 697b7c7e..d32868cf 100644 --- a/testsuite/systemtap.string/tokenize.exp +++ b/testsuite/systemtap.string/tokenize.exp @@ -1,5 +1,6 @@ set test "tokenize" -set ::result_string {one +set ::result_string {- +one two three four @@ -9,7 +10,9 @@ seven eight nine ten +- one|two|three|four|five|six|seven|eight|nine|ten +- a b c @@ -17,10 +20,22 @@ d e f g +- 1 2 3 4 -this is a string with no delimiters} +- +- +this is a string with no delimiters +- +this +is +a +string +which +has +two +delimiters} stap_run2 $srcdir/$subdir/$test.stp diff --git a/testsuite/systemtap.string/tokenize.stp b/testsuite/systemtap.string/tokenize.stp index 10703d90..ba95f63f 100644 --- a/testsuite/systemtap.string/tokenize.stp +++ b/testsuite/systemtap.string/tokenize.stp @@ -1,3 +1,14 @@ +function tokprint(str, delim) +{ + println("-") + + tok = tokenize(str, delim) + while (tok != "") { + println(tok) + tok = tokenize("", delim) + } +} + probe begin { teststr1 = "one|two|three|four|five|six|seven|eight|nine|ten" @@ -5,42 +16,15 @@ probe begin teststr3 = "1,,2,3, ,4" teststr4 = "" teststr5 = "this is a string with no delimiters" + teststr6 = "this is a string, which has two delimiters" - tok = tokenize(teststr1, "|") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", "|") - } - - tok = tokenize(teststr1, ",") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", "|") - } - - tok = tokenize(teststr2, ",") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", ",") - } - - tok = tokenize(teststr3, ",") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", ",") - } - - tok = tokenize(teststr4, ",") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", ",") - } - - tok = tokenize(teststr5, ",") - while (tok != "") { - printf("%s\n", tok) - tok = tokenize("", ",") - } + tokprint(teststr1, "|") + tokprint(teststr1, ",") + tokprint(teststr2, ",") + tokprint(teststr3, ",") + tokprint(teststr4, ",") + tokprint(teststr5, ",") + tokprint(teststr6, ", ") exit() } |