diff options
author | Lim Siew Hoon <siew.hoon.lim@intel.com> | 2016-07-01 11:13:21 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2016-07-22 16:13:20 +0800 |
commit | 56f90c0dee7de287f9557c59d65f870240b3ada2 (patch) | |
tree | 59bc810f34012ed1b93364a218a69cbe91d23feb | |
parent | 1c2997307e007c9a999b33da9c237dda370d1990 (diff) |
add assert to check for potential NULL issue in test_XX
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
-rw-r--r-- | test/basic/test_05.c | 1 | ||||
-rw-r--r-- | test/basic/test_06.c | 1 | ||||
-rw-r--r-- | test/basic/test_09.c | 3 | ||||
-rw-r--r-- | test/basic/test_10.c | 1 | ||||
-rw-r--r-- | test/basic/test_11.c | 1 |
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); |