test: use cap_last_cap() for max supported cap number, not capability_list_length()
authorDan Streetman <ddstreet@canonical.com>
Wed, 25 Nov 2020 20:22:24 +0000 (15:22 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 26 Nov 2020 12:35:48 +0000 (13:35 +0100)
commitebc815cd1c647faa934a446ceea91ff4bc9dffa4
tree308400243f03b02641c8f403154b448e64434cfb
parent9684a01ce46e99cd22bb38758440e2a8e6734d3e
test: use cap_last_cap() for max supported cap number, not capability_list_length()

This test assumes capability_list_length() is an invalid cap number,
but that isn't true if the running kernel supports more caps than we were
compiled with, which results in the test failing.

Instead use cap_last_cap() + 1.

If cap_last_cap() is 63, there are no more 'invalid' cap numbers to test with,
so the invalid cap number test part is skipped.
src/basic/cap-list.c
src/test/test-cap-list.c