From cae3c26048694ffe038b4ac84e351686e7b5b1a9 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Fri, 1 Aug 2014 09:11:39 +0200 Subject: tests: free resources in ilm_getNumberOfHardwareLayers Signed-off-by: Marcus Fritzsch --- ivi-layermanagement-api/test/ilm_control_test.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/ivi-layermanagement-api/test/ilm_control_test.cpp b/ivi-layermanagement-api/test/ilm_control_test.cpp index 6dcf320..a4a4974 100644 --- a/ivi-layermanagement-api/test/ilm_control_test.cpp +++ b/ivi-layermanagement-api/test/ilm_control_test.cpp @@ -1045,16 +1045,21 @@ TEST_F(IlmCommandTest, ilm_getNumberOfHardwareLayers) { t_ilm_uint numberOfScreens = 0; t_ilm_uint* screenIDs = NULL; ASSERT_EQ(ILM_SUCCESS, ilm_getScreenIDs(&numberOfScreens, &screenIDs)); - ASSERT_TRUE(numberOfScreens>0); + EXPECT_TRUE(numberOfScreens>0); - t_ilm_display screen = screenIDs[0]; - t_ilm_uint numberOfHardwareLayers; + if (numberOfScreens > 0) + { + t_ilm_display screen = screenIDs[0]; + t_ilm_uint numberOfHardwareLayers; + + // Depends on the platform the test is executed on - just check if the + // function doesn't fail. The ilm_getPropertiesOfScreen test does a more + // comprehensive verification. + EXPECT_EQ(ILM_SUCCESS, ilm_getNumberOfHardwareLayers(screen, &numberOfHardwareLayers)); + EXPECT_GT(numberOfHardwareLayers, 0u); + } - // Depends on the platform the test is executed on - just check if the - // function doesn't fail. The ilm_getPropertiesOfScreen test does a more - // comprehensive verification. - ASSERT_EQ(ILM_SUCCESS, ilm_getNumberOfHardwareLayers(screen, &numberOfHardwareLayers)); - ASSERT_GT(numberOfHardwareLayers, 0u); + free(screenIDs); } TEST_F(IlmCommandTest, ilm_getPropertiesOfScreen) { -- cgit v1.2.1