summaryrefslogtreecommitdiffstats
path: root/tests/enums
diff options
context:
space:
mode:
Diffstat (limited to 'tests/enums')
-rw-r--r--tests/enums24
1 files changed, 24 insertions, 0 deletions
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