From 6d77b155bcd4725e09837604e6ea86f5f124ba9c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 5 Dec 2023 20:10:48 +0100 Subject: Third commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- tests/enums | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/enums (limited to 'tests/enums') diff --git a/tests/enums b/tests/enums new file mode 100644 index 0000000..43afe3d --- /dev/null +++ b/tests/enums @@ -0,0 +1,24 @@ +# -*- sh -*- +# See LICENSE file for copyright and license details. + +check_enum_good () { + test -n "$(getnamelist "$@")" + test -n "$(getnumlist "$@")" + test -z "$(getnamelist "$@" | sort | uniq -d)" + test -z "$(getnumlist "$@" | sort | uniq -d)" + (( "$(getnumlist "$@" | sort -n | sed -n \$p)" <= 0xFFFF )) +} +check_enum_good OS +check_enum_good ARCH +check_enum_good CAT +for cat in $(getnamelist CAT); do + if test "$cat" = SUPPORT_PENDING || test "$cat" = NOT_IMPLEMENTED; then + continue + fi + check_enum_good ${cat}_SUBCAT + grep -i "enum.libsyscalls_${cat}_syscall_subcategory"'\s\+'"$cat"\\b < libsyscalls.h >/dev/null +done +check_enum_good SIGN +check_enum_good ANNOTATION +check_enum_good SECTION +check_enum_good TYPE cpp_enum_clean -- cgit v1.2.3-70-g09d2