mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Move api tests to single cpp
Change-Id: Ie591e4680cfdeb68f47c7d16b5977bd03202c997
This commit is contained in:
committed by
sys_ocldev
parent
8c0aa92048
commit
83dc651d3c
66
unit_tests/api/cl_enqueue_write_buffer_tests.inl
Normal file
66
unit_tests/api/cl_enqueue_write_buffer_tests.inl
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "cl_api_tests.h"
|
||||
#include "runtime/command_queue/command_queue.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
typedef api_tests clEnqueueWriteBufferTests;
|
||||
|
||||
namespace ULT {
|
||||
|
||||
TEST_F(clEnqueueWriteBufferTests, nullCommandQueueReturnsError) {
|
||||
auto buffer = (cl_mem)ptrGarbage;
|
||||
|
||||
retVal = clEnqueueWriteBuffer(
|
||||
nullptr,
|
||||
buffer,
|
||||
CL_FALSE, //blocking write
|
||||
0, //offset
|
||||
0, //sb
|
||||
nullptr,
|
||||
0, //numEventsInWaitList
|
||||
nullptr,
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_COMMAND_QUEUE, retVal);
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueWriteBufferTests, nullBufferReturnsError) {
|
||||
void *ptr = nullptr;
|
||||
|
||||
retVal = clEnqueueWriteBuffer(
|
||||
pCommandQueue,
|
||||
nullptr,
|
||||
CL_FALSE, //blocking write
|
||||
0, //offset
|
||||
0, //cb
|
||||
ptr,
|
||||
0,
|
||||
nullptr,
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CL_INVALID_MEM_OBJECT, retVal);
|
||||
}
|
||||
} // namespace ULT
|
||||
Reference in New Issue
Block a user