]> sourceware.org Git - systemtap.git/commitdiff
2007-06-20 Martin Hunt <hunt@redhat.com>
authorhunt <hunt>
Wed, 20 Jun 2007 21:42:39 +0000 (21:42 +0000)
committerhunt <hunt>
Wed, 20 Jun 2007 21:42:39 +0000 (21:42 +0000)
* systemtap.string/dot.exp: New test.
* systemtap.string/sprint.exp: New test.

testsuite/systemtap.string/dot.exp [new file with mode: 0644]
testsuite/systemtap.string/dot.stp [new file with mode: 0644]
testsuite/systemtap.string/sprint.exp [new file with mode: 0644]
testsuite/systemtap.string/sprint.stp [new file with mode: 0644]

diff --git a/testsuite/systemtap.string/dot.exp b/testsuite/systemtap.string/dot.exp
new file mode 100644 (file)
index 0000000..b1d3817
--- /dev/null
@@ -0,0 +1,10 @@
+set test "sprint"
+set ::result_string {hello
+helloworld
+12345678
+0
+100
+-42
+66
+}
+stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.string/dot.stp b/testsuite/systemtap.string/dot.stp
new file mode 100644 (file)
index 0000000..94d9c97
--- /dev/null
@@ -0,0 +1,23 @@
+# Test of "." concatenation operator
+#
+# Use of this function is probably never a good idea
+# and is discouraged. Nevertheless, we still support it.
+
+probe begin {
+       a = "hello"
+       b = "world"
+       c = ""
+
+       x = a.b
+       y = a.b.c
+
+       print(x . "\n")
+       print(y . "\n")
+       if (x == y) print("EQUAL\n")
+       if (x == a.b) print("EQUAL\n")
+
+       z = a."-".b." ". x . " FOO " . y . "\n"
+       print(z)
+
+       exit()
+}
diff --git a/testsuite/systemtap.string/sprint.exp b/testsuite/systemtap.string/sprint.exp
new file mode 100644 (file)
index 0000000..c8f9826
--- /dev/null
@@ -0,0 +1,8 @@
+set test "dot"
+set ::result_string {helloworld
+helloworld
+EQUAL
+EQUAL
+hello-world helloworld FOO helloworld
+}
+stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.string/sprint.stp b/testsuite/systemtap.string/sprint.stp
new file mode 100644 (file)
index 0000000..30f2f85
--- /dev/null
@@ -0,0 +1,20 @@
+# Test of sprint() to 
+#
+# Use of this function is probably never a good idea
+# and is discouraged. Nevertheless, we still support it.
+
+probe begin {
+       a = "hello"
+       b = "world"
+       c = sprint(12345678)
+       print(sprint(a) . "\n")
+       print(sprint(a.b) . "\n")
+       print(c . "\n")
+       print(sprint(0) . "\n")
+       print(sprint(100) . "\n")
+       print(sprint(-42) . "\n")
+       print(sprint(0x42) . "\n")
+
+       exit()
+}
+
This page took 0.029384 seconds and 5 git commands to generate.