Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix still reachable leaks in loader tests. #234

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading