summaryrefslogtreecommitdiffstats
path: root/tests/enums
blob: 476c4781769d7794182635e1e3ad7eb15ede6db0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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"'[[:space:]]\{1,\}'"$cat"'\([^A-Za-z0-9_]\|$\)' < libsyscalls.h >/dev/null
done
check_enum_good SIGN
check_enum_good ANNOTATION
check_enum_good SECTION
check_enum_good TYPE cpp_enum_clean