Unbreak btrace(8) regress, adding missing files.
authordv <dv@openbsd.org>
Sun, 3 Oct 2021 22:19:03 +0000 (22:19 +0000)
committerdv <dv@openbsd.org>
Sun, 3 Oct 2021 22:19:03 +0000 (22:19 +0000)
regress/usr.sbin/btrace/staticv.args [new file with mode: 0644]
regress/usr.sbin/btrace/str.args [new file with mode: 0644]
regress/usr.sbin/btrace/str.bt [new file with mode: 0644]
regress/usr.sbin/btrace/str.ok [new file with mode: 0644]

diff --git a/regress/usr.sbin/btrace/staticv.args b/regress/usr.sbin/btrace/staticv.args
new file mode 100644 (file)
index 0000000..7f9ba40
--- /dev/null
@@ -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 (file)
index 0000000..355af03
--- /dev/null
@@ -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 (file)
index 0000000..84455aa
--- /dev/null
@@ -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 (file)
index 0000000..88c5ba7
--- /dev/null
@@ -0,0 +1,5 @@
+OpenBSD is free!
+OpenSSH is free!
+No 3 please: 111111111111111111111111111111111111111111111111111111111111112
+Open
+Open