diff mbox

[libdrm,14/17] tests/amdgpu: ensure tests work by using c99 initializers

Message ID 1440434060-31347-14-git-send-email-emil.l.velikov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emil Velikov Aug. 24, 2015, 4:34 p.m. UTC
In the latest version of CUnit the fourth parameter of the CU_SuiteInfo
struct is pSetUpFunc rather than *pTests.

Seems like the CUnit ABI broke at some point, so let's the the robust
thing and use c99 designated initializers to correctly populate the
struct(s).

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Leo Liu <leo.liu@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 tests/amdgpu/amdgpu_test.c | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

Comments

Alex Deucher Aug. 24, 2015, 5:08 p.m. UTC | #1
On Mon, Aug 24, 2015 at 12:34 PM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> In the latest version of CUnit the fourth parameter of the CU_SuiteInfo
> struct is pSetUpFunc rather than *pTests.
>
> Seems like the CUnit ABI broke at some point, so let's the the robust
> thing and use c99 designated initializers to correctly populate the
> struct(s).
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Leo Liu <leo.liu@amd.com>
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  tests/amdgpu/amdgpu_test.c | 32 ++++++++++++++++++++++++--------
>  1 file changed, 24 insertions(+), 8 deletions(-)
>
> diff --git a/tests/amdgpu/amdgpu_test.c b/tests/amdgpu/amdgpu_test.c
> index 6568990..71f357c 100644
> --- a/tests/amdgpu/amdgpu_test.c
> +++ b/tests/amdgpu/amdgpu_test.c
> @@ -58,14 +58,30 @@ int drm_amdgpu[MAX_CARDS_SUPPORTED];
>
>  /** The table of all known test suites to run */
>  static CU_SuiteInfo suites[] = {
> -       { "Basic Tests", suite_basic_tests_init,
> -         suite_basic_tests_clean, basic_tests },
> -       { "BO Tests", suite_bo_tests_init,
> -         suite_bo_tests_clean, bo_tests },
> -       { "CS Tests", suite_cs_tests_init,
> -         suite_cs_tests_clean, cs_tests },
> -       { "VCE Tests", suite_vce_tests_init,
> -         suite_vce_tests_clean, vce_tests },
> +       {
> +               .pName = "Basic Tests",
> +               .pInitFunc = suite_basic_tests_init,
> +               .pCleanupFunc = suite_basic_tests_clean,
> +               .pTests = basic_tests,
> +       },
> +       {
> +               .pName = "BO Tests",
> +               .pInitFunc = suite_bo_tests_init,
> +               .pCleanupFunc = suite_bo_tests_clean,
> +               .pTests = bo_tests,
> +       },
> +       {
> +               .pName = "CS Tests",
> +               .pInitFunc = suite_cs_tests_init,
> +               .pCleanupFunc = suite_cs_tests_clean,
> +               .pTests = cs_tests,
> +       },
> +       {
> +               .pName = "VCE Tests",
> +               .pInitFunc = suite_vce_tests_init,
> +               .pCleanupFunc = suite_vce_tests_clean,
> +               .pTests = vce_tests,
> +       },
>         CU_SUITE_INFO_NULL,
>  };
>
> --
> 2.5.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher Sept. 4, 2015, 4:33 p.m. UTC | #2
On Mon, Aug 24, 2015 at 1:08 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Mon, Aug 24, 2015 at 12:34 PM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
>> In the latest version of CUnit the fourth parameter of the CU_SuiteInfo
>> struct is pSetUpFunc rather than *pTests.
>>
>> Seems like the CUnit ABI broke at some point, so let's the the robust
>> thing and use c99 designated initializers to correctly populate the
>> struct(s).
>>
>> Cc: Alex Deucher <alexander.deucher@amd.com>
>> Cc: Leo Liu <leo.liu@amd.com>
>> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

Any plans to push this?

Thanks,

Alex

>
>> ---
>>  tests/amdgpu/amdgpu_test.c | 32 ++++++++++++++++++++++++--------
>>  1 file changed, 24 insertions(+), 8 deletions(-)
>>
>> diff --git a/tests/amdgpu/amdgpu_test.c b/tests/amdgpu/amdgpu_test.c
>> index 6568990..71f357c 100644
>> --- a/tests/amdgpu/amdgpu_test.c
>> +++ b/tests/amdgpu/amdgpu_test.c
>> @@ -58,14 +58,30 @@ int drm_amdgpu[MAX_CARDS_SUPPORTED];
>>
>>  /** The table of all known test suites to run */
>>  static CU_SuiteInfo suites[] = {
>> -       { "Basic Tests", suite_basic_tests_init,
>> -         suite_basic_tests_clean, basic_tests },
>> -       { "BO Tests", suite_bo_tests_init,
>> -         suite_bo_tests_clean, bo_tests },
>> -       { "CS Tests", suite_cs_tests_init,
>> -         suite_cs_tests_clean, cs_tests },
>> -       { "VCE Tests", suite_vce_tests_init,
>> -         suite_vce_tests_clean, vce_tests },
>> +       {
>> +               .pName = "Basic Tests",
>> +               .pInitFunc = suite_basic_tests_init,
>> +               .pCleanupFunc = suite_basic_tests_clean,
>> +               .pTests = basic_tests,
>> +       },
>> +       {
>> +               .pName = "BO Tests",
>> +               .pInitFunc = suite_bo_tests_init,
>> +               .pCleanupFunc = suite_bo_tests_clean,
>> +               .pTests = bo_tests,
>> +       },
>> +       {
>> +               .pName = "CS Tests",
>> +               .pInitFunc = suite_cs_tests_init,
>> +               .pCleanupFunc = suite_cs_tests_clean,
>> +               .pTests = cs_tests,
>> +       },
>> +       {
>> +               .pName = "VCE Tests",
>> +               .pInitFunc = suite_vce_tests_init,
>> +               .pCleanupFunc = suite_vce_tests_clean,
>> +               .pTests = vce_tests,
>> +       },
>>         CU_SUITE_INFO_NULL,
>>  };
>>
>> --
>> 2.5.0
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Emil Velikov Sept. 4, 2015, 8:45 p.m. UTC | #3
On 4 September 2015 at 17:33, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Mon, Aug 24, 2015 at 1:08 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
>> On Mon, Aug 24, 2015 at 12:34 PM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
>>> In the latest version of CUnit the fourth parameter of the CU_SuiteInfo
>>> struct is pSetUpFunc rather than *pTests.
>>>
>>> Seems like the CUnit ABI broke at some point, so let's the the robust
>>> thing and use c99 designated initializers to correctly populate the
>>> struct(s).
>>>
>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>> Cc: Leo Liu <leo.liu@amd.com>
>>> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
>>
>> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>
> Any plans to push this?
>
Oops, I thought I did just after Chris's feedback.
Thanks for the reminder, they're in definitely in master now.

-Emil
diff mbox

Patch

diff --git a/tests/amdgpu/amdgpu_test.c b/tests/amdgpu/amdgpu_test.c
index 6568990..71f357c 100644
--- a/tests/amdgpu/amdgpu_test.c
+++ b/tests/amdgpu/amdgpu_test.c
@@ -58,14 +58,30 @@  int drm_amdgpu[MAX_CARDS_SUPPORTED];
 
 /** The table of all known test suites to run */
 static CU_SuiteInfo suites[] = {
-	{ "Basic Tests", suite_basic_tests_init,
-	  suite_basic_tests_clean, basic_tests },
-	{ "BO Tests", suite_bo_tests_init,
-	  suite_bo_tests_clean, bo_tests },
-	{ "CS Tests", suite_cs_tests_init,
-	  suite_cs_tests_clean, cs_tests },
-	{ "VCE Tests", suite_vce_tests_init,
-	  suite_vce_tests_clean, vce_tests },
+	{
+		.pName = "Basic Tests",
+		.pInitFunc = suite_basic_tests_init,
+		.pCleanupFunc = suite_basic_tests_clean,
+		.pTests = basic_tests,
+	},
+	{
+		.pName = "BO Tests",
+		.pInitFunc = suite_bo_tests_init,
+		.pCleanupFunc = suite_bo_tests_clean,
+		.pTests = bo_tests,
+	},
+	{
+		.pName = "CS Tests",
+		.pInitFunc = suite_cs_tests_init,
+		.pCleanupFunc = suite_cs_tests_clean,
+		.pTests = cs_tests,
+	},
+	{
+		.pName = "VCE Tests",
+		.pInitFunc = suite_vce_tests_init,
+		.pCleanupFunc = suite_vce_tests_clean,
+		.pTests = vce_tests,
+	},
 	CU_SUITE_INFO_NULL,
 };