Skip to content

Commit a0fca2d

Browse files
Fix Coverity issues in acl_program_test.cpp
A couple of function calls' return values where not being checked. FIxes: ``` test/acl_program_test.cpp:133:3: Type: Unchecked return value (CHECKED_RETURN) test/acl_program_test.cpp:133:3: Unchecked call to function 1. check_return: Calling "acl_program_is_valid" without checking return value (as is done elsewhere 35 out of 36 times). src/acl_kernel.cpp:2326:3: Examples where return value from this function is checked 2. example_checked: Example 1: "acl_program_is_valid(kernel->program)" has its value checked in "acl_program_is_valid(kernel->program)". src/acl_kernel.cpp:199:3: Examples where return value from this function is checked 3. example_checked: Example 2: "acl_program_is_valid(program)" has its value checked in "acl_program_is_valid(program)". src/acl_profiler.cpp:592:3: Examples where return value from this function is checked 4. example_checked: Example 3: "acl_program_is_valid(program)" has its value checked in "acl_program_is_valid(program)". src/acl_program.cpp:131:3: Examples where return value from this function is checked 5. example_checked: Example 4: "acl_program_is_valid(program)" has its value checked in "acl_program_is_valid(program)". src/acl_program.cpp:1463:3: Examples where return value from this function is checked 6. example_checked: Example 5: "acl_program_is_valid(program)" has its value checked in "acl_program_is_valid(program)". test/acl_program_test.cpp:132:3: Type: Unchecked return value (CHECKED_RETURN) test/acl_program_test.cpp:132:3: Unchecked call to function 1. check_return: Calling "acl_is_valid_ptr" without checking return value (as is done elsewhere 6 out of 7 times). src/acl_program.cpp:1239:3: Examples where return value from this function is checked 2. example_checked: Example 1: "acl_is_valid_ptr(program)" has its value checked in "acl_is_valid_ptr(program)". test/acl_program_test.cpp:148:3: Examples where return value from this function is checked 3. example_checked: Example 2: "acl_is_valid_ptr(cl_program const(NULL))" has its value checked in "acl_is_valid_ptr(cl_program const(NULL))". test/acl_program_test.cpp:348:3: Examples where return value from this function is checked 4. example_checked: Example 3: "acl_is_valid_ptr(program)" has its value checked in "acl_is_valid_ptr(program)". test/acl_program_test.cpp:239:3: Examples where return value from this function is checked 5. example_checked: Example 4: "acl_is_valid_ptr(program)" has its value checked in "acl_is_valid_ptr(program)". test/acl_program_test.cpp:270:3: Examples where return value from this function is checked 6. example_checked: Example 5: "acl_is_valid_ptr(cl_program const(&fake_program))" has its value checked in "acl_is_valid_ptr(cl_program const(&fake_program))". ```
1 parent 73b9fe7 commit a0fca2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/acl_program_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ MT_TEST_GROUP(acl_program) {
129129
MT_TEST(acl_program, link) {
130130
clRetainProgram(0);
131131
clReleaseProgram(0);
132-
ACL_LOCKED(acl_is_valid_ptr<cl_program>(0));
133-
ACL_LOCKED(acl_program_is_valid(0));
132+
ACL_LOCKED(CHECK(0 == acl_is_valid_ptr<cl_program>(0)));
133+
ACL_LOCKED(CHECK(0 == acl_program_is_valid(0)));
134134
CHECK_EQUAL(CL_SUCCESS, clUnloadCompiler());
135135
clCreateProgramWithSource(0, 0, 0, 0, 0);
136136
clCreateProgramWithBinary(0, 0, 0, 0, 0, 0, 0);

0 commit comments

Comments
 (0)