summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorDave Voutila <dv@cvs.openbsd.org>2021-10-03 22:19:04 +0000
committerDave Voutila <dv@cvs.openbsd.org>2021-10-03 22:19:04 +0000
commit127ddb69636fbdc99be76e09e6db8aba70a4bb27 (patch)
treea5c0e3726b4afb714ec9a9db191667395433159c /regress
parent525ef8fe3a7e850248f2e9bb95b5b61c72f87bb7 (diff)
Unbreak btrace(8) regress, adding missing files.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.sbin/btrace/staticv.args3
-rw-r--r--regress/usr.sbin/btrace/str.args7
-rw-r--r--regress/usr.sbin/btrace/str.bt15
-rw-r--r--regress/usr.sbin/btrace/str.ok5
4 files changed, 30 insertions, 0 deletions
diff --git a/regress/usr.sbin/btrace/staticv.args b/regress/usr.sbin/btrace/staticv.args
new file mode 100644
index 00000000000..7f9ba4056bd
--- /dev/null
+++ b/regress/usr.sbin/btrace/staticv.args
@@ -0,0 +1,3 @@
+42
+1337
+-2019
diff --git a/regress/usr.sbin/btrace/str.args b/regress/usr.sbin/btrace/str.args
new file mode 100644
index 00000000000..355af032cf6
--- /dev/null
+++ b/regress/usr.sbin/btrace/str.args
@@ -0,0 +1,7 @@
+OpenBSD
+is
+"free!"
+4
+SSH
+111111111111111111111111111111111111111111111111111111111111112333
+2
diff --git a/regress/usr.sbin/btrace/str.bt b/regress/usr.sbin/btrace/str.bt
new file mode 100644
index 00000000000..84455aa2cfc
--- /dev/null
+++ b/regress/usr.sbin/btrace/str.bt
@@ -0,0 +1,15 @@
+/* Tests for str() */
+BEGIN {
+ /* Should pass through regular string args */
+ printf("%s %s %s\n", $1, $2, str($3));
+
+ /* Should truncate when given an index < the max (currently 64) */
+ printf("%sSSH %s %s\n", str($1, $4), $2, $3);
+
+ /* Should truncate long arguments to 64 bytes */
+ printf("No 3 please: %s\n", str($6));
+
+ /* Should support nested expressions for the index */
+ print(str($1, 2 + 2));
+ print(str($1, 2 + $7));
+}
diff --git a/regress/usr.sbin/btrace/str.ok b/regress/usr.sbin/btrace/str.ok
new file mode 100644
index 00000000000..88c5ba720d6
--- /dev/null
+++ b/regress/usr.sbin/btrace/str.ok
@@ -0,0 +1,5 @@
+OpenBSD is free!
+OpenSSH is free!
+No 3 please: 111111111111111111111111111111111111111111111111111111111111112
+Open
+Open