From 74d02c8639d983738c157058aea60866e7aba461 Mon Sep 17 00:00:00 2001 From: jasper Date: Thu, 9 Sep 2021 19:02:50 +0000 Subject: [PATCH] add hist() tests similar to mapempty.bt ok mpi@ --- regress/usr.sbin/btrace/Makefile | 5 +++-- regress/usr.sbin/btrace/histempty.bt | 18 ++++++++++++++++++ regress/usr.sbin/btrace/histempty.ok | 5 +++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 regress/usr.sbin/btrace/histempty.bt create mode 100644 regress/usr.sbin/btrace/histempty.ok diff --git a/regress/usr.sbin/btrace/Makefile b/regress/usr.sbin/btrace/Makefile index cd553a3748d..bbe18079024 100644 --- a/regress/usr.sbin/btrace/Makefile +++ b/regress/usr.sbin/btrace/Makefile @@ -1,10 +1,11 @@ -# $OpenBSD: Makefile,v 1.19 2021/09/09 10:00:04 mpi Exp $ +# $OpenBSD: Makefile,v 1.20 2021/09/09 19:02:50 jasper Exp $ BTRACE?= /usr/sbin/btrace ALLOWDT!= sysctl -n kern.allowdt # scripts that don't need /dev/dt -BT_LANG_SCRIPTS= arithm beginend boolean comments delete exit if \ +BT_LANG_SCRIPTS= arithm beginend boolean comments delete exit \ + histempty if \ 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/histempty.bt b/regress/usr.sbin/btrace/histempty.bt new file mode 100644 index 00000000000..b8842e63fcf --- /dev/null +++ b/regress/usr.sbin/btrace/histempty.bt @@ -0,0 +1,18 @@ +BEGIN +{ + @histmap = hist(1); + print(@histmap); +} + +END +{ + clear(@histmap); + printf("=> clear() after clear:\n"); + clear(@histmap); + printf("=> delete() after clear:\n"); + delete(@histmap[0]); + printf("=> zero() after clear:\n"); + zero(@histmap); + print(@histmap); + +} diff --git a/regress/usr.sbin/btrace/histempty.ok b/regress/usr.sbin/btrace/histempty.ok new file mode 100644 index 00000000000..1f9a3d7cf1c --- /dev/null +++ b/regress/usr.sbin/btrace/histempty.ok @@ -0,0 +1,5 @@ +@h: +[0, 1) 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| +=> clear() after clear: +=> delete() after clear: +=> zero() after clear: -- 2.20.1