From a98f2d2dc6c92f234fe69fb3e028d19d2379d33b Mon Sep 17 00:00:00 2001 From: mpi Date: Thu, 9 Sep 2021 06:59:51 +0000 Subject: [PATCH] Check clear(), delete(), zero() and print() after clear(). ok jasper@ --- regress/usr.sbin/btrace/Makefile | 4 ++-- regress/usr.sbin/btrace/mapempty.bt | 17 +++++++++++++++++ regress/usr.sbin/btrace/mapempty.ok | 4 ++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 regress/usr.sbin/btrace/mapempty.bt create mode 100644 regress/usr.sbin/btrace/mapempty.ok diff --git a/regress/usr.sbin/btrace/Makefile b/regress/usr.sbin/btrace/Makefile index 751e7a1a7cf..59665a073a7 100644 --- a/regress/usr.sbin/btrace/Makefile +++ b/regress/usr.sbin/btrace/Makefile @@ -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 index 00000000000..e0dba63d215 --- /dev/null +++ b/regress/usr.sbin/btrace/mapempty.bt @@ -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 index 00000000000..1736a0372d0 --- /dev/null +++ b/regress/usr.sbin/btrace/mapempty.ok @@ -0,0 +1,4 @@ +@map[4]: 9999 +=> clear() after clear: +=> delete() after clear: +=> zero() after clear: -- 2.20.1