Skip to content

Commit

Permalink
Fix still reachable leaks in loader tests. (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerilk committed Feb 15, 2024
1 parent 932d826 commit 861b68b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/loader_test/test_create_calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

extern void CL_CALLBACK createcontext_callback(const char* a, const void* b, size_t c, void* d);

cl_platform_id* all_platforms;
cl_platform_id platform;
cl_uint num_platforms;
cl_context context;
Expand Down Expand Up @@ -96,10 +95,17 @@ struct clReleaseMemObject_st clReleaseMemObjectData[NUM_ITEMS_clReleaseMemObject
{NULL}
};

struct clReleaseMemObject_st clReleaseMemObjectDataSubBuffer[NUM_ITEMS_clReleaseMemObject] =
{
{NULL}
};

struct clReleaseMemObject_st clReleaseMemObjectDataImage[NUM_ITEMS_clReleaseMemObject] =
{
{NULL}
};const struct clCreateProgramWithSource_st clCreateProgramWithSourceData[NUM_ITEMS_clCreateProgramWithSource] =
};

const struct clCreateProgramWithSource_st clCreateProgramWithSourceData[NUM_ITEMS_clCreateProgramWithSource] =
{
{NULL, 0, NULL, NULL, NULL}
};
Expand Down Expand Up @@ -151,6 +157,7 @@ int test_clGetPlatformIDs(const struct clGetPlatformIDs_st* data)
#define PLATFORM_NAME_SIZE 80
char platform_name[PLATFORM_NAME_SIZE];
cl_uint i;
cl_platform_id *all_platforms;

#if ENABLE_MISMATCHING_PRINTS
test_icd_app_log("clGetPlatformIDs(%u, %p, %p)\n",
Expand Down Expand Up @@ -192,6 +199,7 @@ int test_clGetPlatformIDs(const struct clGetPlatformIDs_st* data)
}
}
}
free(all_platforms);

#if ENABLE_MISMATCHING_PRINTS
test_icd_app_log("Value returned: %d\n", ret_val);
Expand Down Expand Up @@ -351,7 +359,7 @@ int test_clCreateSubBuffer(const struct clCreateSubBuffer_st *data)
data->buffer_create_info,
data->errcode_ret);

clReleaseMemObjectData->memobj = buffer;
clReleaseMemObjectDataSubBuffer->memobj = subBuffer;

test_icd_app_log("Value returned: %p\n", subBuffer);

Expand Down Expand Up @@ -828,6 +836,8 @@ int test_release_calls()

test_clReleaseMemObject(clReleaseMemObjectData);

test_clReleaseMemObject(clReleaseMemObjectDataSubBuffer);

test_clReleaseMemObject(clReleaseMemObjectDataImage);

test_clReleaseEvent(clReleaseEventData);
Expand Down

0 comments on commit 861b68b

Please sign in to comment.