Check clear(), delete(), zero() and print() after clear().
authormpi <mpi@openbsd.org>
Thu, 9 Sep 2021 06:59:51 +0000 (06:59 +0000)
committermpi <mpi@openbsd.org>
Thu, 9 Sep 2021 06:59:51 +0000 (06:59 +0000)
ok jasper@

regress/usr.sbin/btrace/Makefile
regress/usr.sbin/btrace/mapempty.bt [new file with mode: 0644]
regress/usr.sbin/btrace/mapempty.ok [new file with mode: 0644]

index 751e7a1..59665a0 100644 (file)
@@ -1,10 +1,10 @@
-# $OpenBSD: Makefile,v 1.15 2021/09/07 19:31:56 mpi Exp $
+# $OpenBSD: Makefile,v 1.16 2021/09/09 06:59:51 mpi Exp $
 
 BTRACE?=                /usr/sbin/btrace
 
 # scripts that don't need /dev/dt
 BT_LANG_SCRIPTS=       arithm beginend boolean comments delete exit if \
-                       map mapclear mapsyntax mapzero map-unnamed \
+                       map mapclear mapempty mapsyntax mapzero map-unnamed \
                        maxoperand min+max+sum multismts nsecs+var \
                        precedence print read-map-after-clear syntaxerror
 
diff --git a/regress/usr.sbin/btrace/mapempty.bt b/regress/usr.sbin/btrace/mapempty.bt
new file mode 100644 (file)
index 0000000..e0dba63
--- /dev/null
@@ -0,0 +1,17 @@
+BEGIN
+{
+        @map[3 + 1] = 9999;
+        print(@map);
+}
+
+END
+{
+        clear(@map);
+        printf("=> clear() after clear:\n");
+        clear(@map);
+        printf("=> delete() after clear:\n");
+        delete(@map[4]);
+        printf("=> zero() after clear:\n");
+        zero(@map);
+        print(@map);
+}
diff --git a/regress/usr.sbin/btrace/mapempty.ok b/regress/usr.sbin/btrace/mapempty.ok
new file mode 100644 (file)
index 0000000..1736a03
--- /dev/null
@@ -0,0 +1,4 @@
+@map[4]: 9999
+=> clear() after clear:
+=> delete() after clear:
+=> zero() after clear: