ULT renaming: clCreateBuffer tests

Change-Id: I084d9c0b80779b22d88fbe25aacb1affed38e0e2
Signed-off-by: Cetnerowski <adam.cetnerowski@intel.com>
This commit is contained in:
Cetnerowski 2018-09-12 13:44:05 -07:00 committed by sys_ocldev
parent bfb1c5c19e
commit a416b0a382
1 changed files with 10 additions and 10 deletions

View File

@ -102,7 +102,7 @@ INSTANTIATE_TEST_CASE_P(
clCreateBufferInValidFlagsTests,
testing::ValuesIn(inValidFlags));
TEST_F(clCreateBufferTests, returnsSuccess) {
TEST_F(clCreateBufferTests, GivenValidParametersWhenCreatingBufferThenSuccessIsReturned) {
unsigned char *pHostMem = nullptr;
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
static const unsigned int bufferSize = 16;
@ -122,7 +122,7 @@ TEST_F(clCreateBufferTests, returnsSuccess) {
delete[] pHostMem;
}
TEST_F(clCreateBufferTests, nullContextReturnsError) {
TEST_F(clCreateBufferTests, GivenNullContextWhenCreatingBufferThenInvalidContextErrorIsReturned) {
unsigned char *pHostMem = nullptr;
cl_mem_flags flags = 0;
static const unsigned int bufferSize = 16;
@ -131,38 +131,38 @@ TEST_F(clCreateBufferTests, nullContextReturnsError) {
ASSERT_EQ(CL_INVALID_CONTEXT, retVal);
}
TEST_F(clCreateBufferTests, zeroSizeReturnsError) {
TEST_F(clCreateBufferTests, GivenBufferSizeZeroWhenCreatingBufferThenInvalidBufferSizeErrorIsReturned) {
uint8_t hostData = 0;
clCreateBuffer(pContext, CL_MEM_USE_HOST_PTR, 0, &hostData, &retVal);
ASSERT_EQ(CL_INVALID_BUFFER_SIZE, retVal);
}
TEST_F(clCreateBufferTests, wrongHostData) {
TEST_F(clCreateBufferTests, GivenInvalidHostPointerWhenCreatingBufferThenInvalidHostPointerErrorIsReturned) {
uint32_t hostData = 0;
cl_mem_flags flags = 0;
clCreateBuffer(pContext, flags, sizeof(uint32_t), &hostData, &retVal);
ASSERT_EQ(CL_INVALID_HOST_PTR, retVal);
}
TEST_F(clCreateBufferTests, wrongHostFlags1) {
TEST_F(clCreateBufferTests, GivenNullHostPointerAndMemCopyHostPtrFlagWhenCreatingBufferThenInvalidHostPointerErrorIsReturned) {
cl_mem_flags flags = CL_MEM_COPY_HOST_PTR;
clCreateBuffer(pContext, flags, sizeof(uint32_t), nullptr, &retVal);
ASSERT_EQ(CL_INVALID_HOST_PTR, retVal);
}
TEST_F(clCreateBufferTests, wrongHostFlags2) {
TEST_F(clCreateBufferTests, GivenNullHostPointerAndMemUseHostPtrFlagWhenCreatingBufferThenInvalidHostPointerErrorIsReturned) {
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
clCreateBuffer(pContext, flags, sizeof(uint32_t), nullptr, &retVal);
ASSERT_EQ(CL_INVALID_HOST_PTR, retVal);
}
TEST_F(clCreateBufferTests, wrongFlags) {
TEST_F(clCreateBufferTests, GivenMemWriteOnlyFlagAndMemReadWriteFlagWhenCreatingBufferThenInvalidValueErrorIsReturned) {
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_READ_WRITE;
clCreateBuffer(pContext, flags, 16, nullptr, &retVal);
ASSERT_EQ(CL_INVALID_VALUE, retVal);
}
TEST_F(clCreateBufferTests, noRet) {
TEST_F(clCreateBufferTests, GivenNullHostPointerAndMemCopyHostPtrFlagWhenCreatingBufferThenNullIsReturned) {
unsigned char *pHostMem = nullptr;
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
static const unsigned int bufferSize = 16;
@ -183,7 +183,7 @@ TEST_F(clCreateBufferTests, noRet) {
using clCreateBufferTestsWithRestrictions = api_test_using_aligned_memory_manager;
TEST_F(clCreateBufferTestsWithRestrictions, givenMemoryManagerRestrictionsWhenMinIsLesserThanHostPtrThenUseZeroCopy) {
TEST_F(clCreateBufferTestsWithRestrictions, GivenMemoryManagerRestrictionsWhenMinIsLessThanHostPtrThenUseZeroCopy) {
std::unique_ptr<unsigned char[]> hostMem(nullptr);
unsigned char *destMem = nullptr;
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
@ -214,7 +214,7 @@ TEST_F(clCreateBufferTestsWithRestrictions, givenMemoryManagerRestrictionsWhenMi
EXPECT_EQ(CL_SUCCESS, retVal);
}
TEST_F(clCreateBufferTestsWithRestrictions, givenMemoryManagerRestrictionsWhenMinIsLesserThanHostPtrThenCreateCopy) {
TEST_F(clCreateBufferTestsWithRestrictions, GivenMemoryManagerRestrictionsWhenMinIsLessThanHostPtrThenCreateCopy) {
std::unique_ptr<unsigned char[]> hostMem(nullptr);
unsigned char *destMem = nullptr;
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;