ULT renaming: CreateContextFromType tests
Change-Id: Id5866f83c4ed30270eb7ee17201db208f29c1c12 Signed-off-by: Cetnerowski, Adam <adam.cetnerowski@intel.com>
This commit is contained in:
parent
ac1d2b9901
commit
06a9e46777
|
@ -31,7 +31,7 @@ void CL_CALLBACK contextCallBack(const char *, const void *,
|
|||
size_t, void *) {
|
||||
}
|
||||
|
||||
TEST_F(clCreateContextFromTypeTests, returnsSuccess) {
|
||||
TEST_F(clCreateContextFromTypeTests, GivenOnlyGpuDeviceTypeAndReturnValueWhenCreatingContextFromTypeThenCallSucceeds) {
|
||||
auto context =
|
||||
clCreateContextFromType(nullptr, CL_DEVICE_TYPE_GPU, nullptr, nullptr, &retVal);
|
||||
|
||||
|
@ -44,22 +44,22 @@ TEST_F(clCreateContextFromTypeTests, returnsSuccess) {
|
|||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
TEST_F(clCreateContextFromTypeTests, returnsFailOnCpuType) {
|
||||
TEST_F(clCreateContextFromTypeTests, GivenCpuTypeWhenCreatingContextFromTypeThenInvalidValueErrorIsReturned) {
|
||||
auto context =
|
||||
clCreateContextFromType(nullptr, CL_DEVICE_TYPE_CPU, nullptr, nullptr, &retVal);
|
||||
ASSERT_EQ(nullptr, context);
|
||||
ASSERT_EQ(CL_DEVICE_NOT_FOUND, retVal);
|
||||
}
|
||||
|
||||
TEST_F(clCreateContextFromTypeTests, returnsFailOnWrongData) {
|
||||
TEST_F(clCreateContextFromTypeTests, GivenNullCallbackFunctionAndNotNullUserDataWhenCreatingContextFromTypeThenInvalidValueErrorIsReturned) {
|
||||
cl_int a;
|
||||
auto context =
|
||||
clCreateContextFromType(nullptr, CL_DEVICE_TYPE_CPU, nullptr, &a, &retVal);
|
||||
clCreateContextFromType(nullptr, CL_DEVICE_TYPE_GPU, nullptr, &a, &retVal);
|
||||
ASSERT_EQ(nullptr, context);
|
||||
ASSERT_EQ(CL_INVALID_VALUE, retVal);
|
||||
}
|
||||
|
||||
TEST_F(clCreateContextFromTypeTests, nullUserData) {
|
||||
TEST_F(clCreateContextFromTypeTests, GivenCallbackFunctionWhenCreatingContextFromTypeThenCallSucceeds) {
|
||||
auto context = clCreateContextFromType(nullptr, CL_DEVICE_TYPE_GPU, contextCallBack, nullptr, &retVal);
|
||||
ASSERT_NE(nullptr, context);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
@ -68,7 +68,7 @@ TEST_F(clCreateContextFromTypeTests, nullUserData) {
|
|||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
TEST_F(clCreateContextFromTypeTests, noRet) {
|
||||
TEST_F(clCreateContextFromTypeTests, GivenOnlyGpuDeviceTypeWhenCreatingContextFromTypeThenCallSucceeds) {
|
||||
auto context =
|
||||
clCreateContextFromType(nullptr, CL_DEVICE_TYPE_GPU, nullptr, nullptr, nullptr);
|
||||
|
||||
|
@ -80,7 +80,7 @@ TEST_F(clCreateContextFromTypeTests, noRet) {
|
|||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
TEST_F(clCreateContextFromTypeTests, givenInvalidContextCreationPropertiesThenContextCreationFails) {
|
||||
TEST_F(clCreateContextFromTypeTests, GivenInvalidContextCreationPropertiesWhenCreatingContextFromTypeThenInvalidPlatformErrorIsReturned) {
|
||||
cl_context_properties invalidProperties[3] = {CL_CONTEXT_PLATFORM, (cl_context_properties) nullptr, 0};
|
||||
auto context = clCreateContextFromType(invalidProperties, CL_DEVICE_TYPE_GPU, nullptr, nullptr, &retVal);
|
||||
EXPECT_EQ(CL_INVALID_PLATFORM, retVal);
|
||||
|
|
Loading…
Reference in New Issue