@@ -102,7 +102,7 @@ INSTANTIATE_TEST_CASE_P(
102
102
clCreateBufferInValidFlagsTests,
103
103
testing::ValuesIn (inValidFlags));
104
104
105
- TEST_F (clCreateBufferTests, returnsSuccess ) {
105
+ TEST_F (clCreateBufferTests, GivenValidParametersWhenCreatingBufferThenSuccessIsReturned ) {
106
106
unsigned char *pHostMem = nullptr ;
107
107
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
108
108
static const unsigned int bufferSize = 16 ;
@@ -122,7 +122,7 @@ TEST_F(clCreateBufferTests, returnsSuccess) {
122
122
delete[] pHostMem;
123
123
}
124
124
125
- TEST_F (clCreateBufferTests, nullContextReturnsError ) {
125
+ TEST_F (clCreateBufferTests, GivenNullContextWhenCreatingBufferThenInvalidContextErrorIsReturned ) {
126
126
unsigned char *pHostMem = nullptr ;
127
127
cl_mem_flags flags = 0 ;
128
128
static const unsigned int bufferSize = 16 ;
@@ -131,38 +131,38 @@ TEST_F(clCreateBufferTests, nullContextReturnsError) {
131
131
ASSERT_EQ (CL_INVALID_CONTEXT, retVal);
132
132
}
133
133
134
- TEST_F (clCreateBufferTests, zeroSizeReturnsError ) {
134
+ TEST_F (clCreateBufferTests, GivenBufferSizeZeroWhenCreatingBufferThenInvalidBufferSizeErrorIsReturned ) {
135
135
uint8_t hostData = 0 ;
136
136
clCreateBuffer (pContext, CL_MEM_USE_HOST_PTR, 0 , &hostData, &retVal);
137
137
ASSERT_EQ (CL_INVALID_BUFFER_SIZE, retVal);
138
138
}
139
139
140
- TEST_F (clCreateBufferTests, wrongHostData ) {
140
+ TEST_F (clCreateBufferTests, GivenInvalidHostPointerWhenCreatingBufferThenInvalidHostPointerErrorIsReturned ) {
141
141
uint32_t hostData = 0 ;
142
142
cl_mem_flags flags = 0 ;
143
143
clCreateBuffer (pContext, flags, sizeof (uint32_t ), &hostData, &retVal);
144
144
ASSERT_EQ (CL_INVALID_HOST_PTR, retVal);
145
145
}
146
146
147
- TEST_F (clCreateBufferTests, wrongHostFlags1 ) {
147
+ TEST_F (clCreateBufferTests, GivenNullHostPointerAndMemCopyHostPtrFlagWhenCreatingBufferThenInvalidHostPointerErrorIsReturned ) {
148
148
cl_mem_flags flags = CL_MEM_COPY_HOST_PTR;
149
149
clCreateBuffer (pContext, flags, sizeof (uint32_t ), nullptr , &retVal);
150
150
ASSERT_EQ (CL_INVALID_HOST_PTR, retVal);
151
151
}
152
152
153
- TEST_F (clCreateBufferTests, wrongHostFlags2 ) {
153
+ TEST_F (clCreateBufferTests, GivenNullHostPointerAndMemUseHostPtrFlagWhenCreatingBufferThenInvalidHostPointerErrorIsReturned ) {
154
154
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
155
155
clCreateBuffer (pContext, flags, sizeof (uint32_t ), nullptr , &retVal);
156
156
ASSERT_EQ (CL_INVALID_HOST_PTR, retVal);
157
157
}
158
158
159
- TEST_F (clCreateBufferTests, wrongFlags ) {
159
+ TEST_F (clCreateBufferTests, GivenMemWriteOnlyFlagAndMemReadWriteFlagWhenCreatingBufferThenInvalidValueErrorIsReturned ) {
160
160
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_READ_WRITE;
161
161
clCreateBuffer (pContext, flags, 16 , nullptr , &retVal);
162
162
ASSERT_EQ (CL_INVALID_VALUE, retVal);
163
163
}
164
164
165
- TEST_F (clCreateBufferTests, noRet ) {
165
+ TEST_F (clCreateBufferTests, GivenNullHostPointerAndMemCopyHostPtrFlagWhenCreatingBufferThenNullIsReturned ) {
166
166
unsigned char *pHostMem = nullptr ;
167
167
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
168
168
static const unsigned int bufferSize = 16 ;
@@ -183,7 +183,7 @@ TEST_F(clCreateBufferTests, noRet) {
183
183
184
184
using clCreateBufferTestsWithRestrictions = api_test_using_aligned_memory_manager;
185
185
186
- TEST_F (clCreateBufferTestsWithRestrictions, givenMemoryManagerRestrictionsWhenMinIsLesserThanHostPtrThenUseZeroCopy ) {
186
+ TEST_F (clCreateBufferTestsWithRestrictions, GivenMemoryManagerRestrictionsWhenMinIsLessThanHostPtrThenUseZeroCopy ) {
187
187
std::unique_ptr<unsigned char []> hostMem (nullptr );
188
188
unsigned char *destMem = nullptr ;
189
189
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
@@ -214,7 +214,7 @@ TEST_F(clCreateBufferTestsWithRestrictions, givenMemoryManagerRestrictionsWhenMi
214
214
EXPECT_EQ (CL_SUCCESS, retVal);
215
215
}
216
216
217
- TEST_F (clCreateBufferTestsWithRestrictions, givenMemoryManagerRestrictionsWhenMinIsLesserThanHostPtrThenCreateCopy ) {
217
+ TEST_F (clCreateBufferTestsWithRestrictions, GivenMemoryManagerRestrictionsWhenMinIsLessThanHostPtrThenCreateCopy ) {
218
218
std::unique_ptr<unsigned char []> hostMem (nullptr );
219
219
unsigned char *destMem = nullptr ;
220
220
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
0 commit comments