From 77f31e1f821f48a72259fdbd9d285d1ce16956f5 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Fri, 6 Oct 2023 17:43:01 +0200 Subject: prog: test optional input resources are skipped This commit adds a unit test for getInputResources, to verify in particular that it doesn't return input resources that are optional. Note we can't test the built-in "optional[]" because that relies on unions and those aren't supported yet. Signed-off-by: Paul Chaignon --- sys/test/test.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'sys/test') diff --git a/sys/test/test.txt b/sys/test/test.txt index 86be743d1..85e3f4ac8 100644 --- a/sys/test/test.txt +++ b/sys/test/test.txt @@ -866,3 +866,28 @@ syz_r103_r104_s { opt0 r103 (out) opt1 r104 (in) } + +# Optional resources + +resource optional_res1[int32] +resource optional_res2[int32] +resource required_res1[int32] + +test_args2 { + a array[optional_res2] +} + +test_args1 { + a1 ptr64[in, array[optional_res1], opt] + a2 ptr64[in, test_args2, opt] + a3 ptr64[in, required_res1] +} + +test_args0 { + a1 optional_res1 + a2 optional_res2 + a3 required_res1 +} + +test$output_res(arg ptr[out, test_args0]) +test$optional_res(arg ptr[in, test_args1]) -- cgit mrf-deployment