From 29ae12bd764e3b1876356e7628a32192b4ec9066 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Wed, 7 Mar 2018 23:33:07 +0200 Subject: tests/kms_properties: Validate properties harder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the property validation more thorough: - validate property flags - make sure there's an expected number of values/enums - make sure the possible values make sense - make sure the current value makes sense - actually iterate through all planes/crtc/connectors to check their properties - make sure encoders don't expose properties while at it - check that atomic props aren't exposed to non-atomic clients Still passes on my ivb. Not tested anything else so far. Signed-off-by: Ville Syrjälä Reviewed-by: Stanislav Lisovskiy --- lib/igt_core.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'lib/igt_core.h') diff --git a/lib/igt_core.h b/lib/igt_core.h index 57e97f2b..bf8cd66c 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -575,6 +575,32 @@ static inline void igt_ignore_warn(bool value) */ #define igt_assert_lte(n1, n2) igt_assert_cmpint(n1, <=, >, n2) +/** + * igt_assert_lte_u64: + * @n1: first integer + * @n2: second integer + * + * Fails (sub-)test if the second integer is strictly smaller than the first. + * Beware that for now this only works on integers. + * + * Like igt_assert(), but displays the values being compared on failure instead + * of simply printing the stringified expression. + */ +#define igt_assert_lte_u64(n1, n2) igt_assert_cmpu64(n1, <=, >, n2) + +/** + * igt_assert_lte_s64: + * @n1: first integer + * @n2: second integer + * + * Fails (sub-)test if the second integer is strictly smaller than the first. + * Beware that for now this only works on integers. + * + * Like igt_assert(), but displays the values being compared on failure instead + * of simply printing the stringified expression. + */ +#define igt_assert_lte_s64(n1, n2) igt_assert_cmps64(n1, <=, >, n2) + /** * igt_assert_lt: * @n1: first integer @@ -588,6 +614,32 @@ static inline void igt_ignore_warn(bool value) */ #define igt_assert_lt(n1, n2) igt_assert_cmpint(n1, <, >=, n2) +/** + * igt_assert_lt_u64: + * @n1: first integer + * @n2: second integer + * + * Fails (sub-)test if the second integer is smaller than or equal to the first. + * Beware that for now this only works on integers. + * + * Like igt_assert(), but displays the values being compared on failure instead + * of simply printing the stringified expression. + */ +#define igt_assert_lt_u64(n1, n2) igt_assert_cmpu64(n1, <, >=, n2) + +/** + * igt_assert_lt_s64: + * @n1: first integer + * @n2: second integer + * + * Fails (sub-)test if the second integer is smaller than or equal to the first. + * Beware that for now this only works on integers. + * + * Like igt_assert(), but displays the values being compared on failure instead + * of simply printing the stringified expression. + */ +#define igt_assert_lt_s64(n1, n2) igt_assert_cmps64(n1, <, >=, n2) + /** * igt_assert_fd: * @fd: file descriptor -- cgit v1.2.3