Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] tests/xe/xe_query: Add subtest query-invalid-extension
@ 2023-04-25 18:40 janga.rahul.kumar
  2023-04-26 10:12 ` Zbigniew Kempczyński
  2023-04-26 10:13 ` Zbigniew Kempczyński
  0 siblings, 2 replies; 5+ messages in thread
From: janga.rahul.kumar @ 2023-04-25 18:40 UTC (permalink / raw)
  To: igt-dev, ramadevi.gandi, janga.rahul.kumar

From: Janga Rahul Kumar <janga.rahul.kumar@intel.com>

Check query with invalid extension returns expected error code.

Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
---
 tests/xe/xe_query.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tests/xe/xe_query.c b/tests/xe/xe_query.c
index 3f038225..6c35730c 100644
--- a/tests/xe/xe_query.c
+++ b/tests/xe/xe_query.c
@@ -435,6 +435,23 @@ test_query_invalid_size(int fd)
 	igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), -1);
 }
 
+/**
+ * SUBTEST: query-invalid-extension
+ * Description: Check query with invalid extension returns expected error code.
+ */
+static void
+test_query_invalid_extension(int fd)
+{
+	struct drm_xe_device_query query = {
+		.extensions = -1,
+		.query = DRM_XE_DEVICE_QUERY_CONFIG,
+		.size = 0,
+		.data = 0,
+	};
+
+	igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), -1);
+}
+
 igt_main
 {
 	int xe;
@@ -468,6 +485,9 @@ igt_main
 	igt_subtest("query-invalid-size")
 		test_query_invalid_size(xe);
 
+	igt_subtest("query-invalid-extension")
+		test_query_invalid_extension(xe);
+
 	igt_fixture {
 		xe_device_put(xe);
 		close(xe);
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-26 20:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 18:40 [igt-dev] [PATCH] tests/xe/xe_query: Add subtest query-invalid-extension janga.rahul.kumar
2023-04-26 10:12 ` Zbigniew Kempczyński
2023-04-26 18:58   ` Kumar, Janga Rahul
2023-04-26 20:02     ` Zbigniew Kempczyński
2023-04-26 10:13 ` Zbigniew Kempczyński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox