summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLim Siew Hoon <siew.hoon.lim@intel.com>2016-07-01 11:13:21 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2016-08-22 13:04:29 +0800
commit466dde116b125a368fc216af6b488d4d92baf948 (patch)
tree74dde70d960b1f39ae54b36378032b510df2e866
parent1aa71317e9d904ed630714388986f316d9fc2567 (diff)
add assert to check for potential NULL issue in test_XX
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com> (cherry picked from commit 56f90c0dee7de287f9557c59d65f870240b3ada2)
-rw-r--r--test/basic/test_05.c1
-rw-r--r--test/basic/test_06.c1
-rw-r--r--test/basic/test_09.c3
-rw-r--r--test/basic/test_10.c1
-rw-r--r--test/basic/test_11.c1
5 files changed, 7 insertions, 0 deletions
diff --git a/test/basic/test_05.c b/test/basic/test_05.c
index 233aa01..a05100d 100644
--- a/test/basic/test_05.c
+++ b/test/basic/test_05.c
@@ -44,6 +44,7 @@ void test()
ASSERT(entrypoints);
VAConfigID *configs = malloc(max_entrypoints * num_profiles * sizeof(VAConfigID));
+ ASSERT(configs);
for(i = 0; i < num_profiles; i++)
{
diff --git a/test/basic/test_06.c b/test/basic/test_06.c
index 0dfdee5..e782d81 100644
--- a/test/basic/test_06.c
+++ b/test/basic/test_06.c
@@ -74,6 +74,7 @@ void test()
ASSERT(max_attribs > 0);
VAConfigAttrib *attrib_list = malloc(max_attribs * sizeof(VAConfigAttrib));
+ ASSERT(attrib_list);
config_count = 0;
for(i = 0; i < num_profiles; i++)
diff --git a/test/basic/test_09.c b/test/basic/test_09.c
index 0decc06..897d6fc 100644
--- a/test/basic/test_09.c
+++ b/test/basic/test_09.c
@@ -44,7 +44,9 @@ void test()
ASSERT(entrypoints);
VAConfigID *configs = malloc(max_entrypoints * num_profiles * sizeof(VAConfigID));
+ ASSERT(configs);
VAContextID *contexts = malloc(max_entrypoints * num_profiles * sizeof(VAContextID));
+ ASSERT(contexts);
for(i = 0; i < num_profiles; i++)
{
@@ -67,6 +69,7 @@ void test()
int total_surfaces = config_count * surface_count;
VASurfaceID *surfaces = malloc(total_surfaces * sizeof(VASurfaceID));
+ ASSERT(surfaces);
// TODO: Don't assume VA_RT_FORMAT_YUV420 is supported / needed for each config
va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, width, height, surfaces, total_surfaces, NULL, 0);
diff --git a/test/basic/test_10.c b/test/basic/test_10.c
index 9c7c566..e79debc 100644
--- a/test/basic/test_10.c
+++ b/test/basic/test_10.c
@@ -45,6 +45,7 @@ void pre()
total_surfaces = surface_count;
surfaces = malloc(total_surfaces * sizeof(VASurfaceID));
+ assert(surfaces);
// TODO: Don't assume VA_RT_FORMAT_YUV420 is supported / needed for each config
va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, width, height, surfaces, total_surfaces, NULL, 0);
diff --git a/test/basic/test_11.c b/test/basic/test_11.c
index 99c8785..143d084 100644
--- a/test/basic/test_11.c
+++ b/test/basic/test_11.c
@@ -45,6 +45,7 @@ void pre()
total_surfaces = surface_count;
surfaces = malloc(total_surfaces * sizeof(VASurfaceID));
+ assert(surfaces);
// TODO: Don't assume VA_RT_FORMAT_YUV420 is supported / needed for each config
va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, width, height, surfaces, total_surfaces, NULL, 0);