Files
compute-runtime/unit_tests/helpers/queue_helpers_tests.cpp
Maciej Plewka 9e52684f5b Change namespace from OCLRT to NEO
Change-Id: If965c79d70392db26597aea4c2f3b7ae2820fe96
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2019-03-26 15:48:19 +01:00

32 lines
822 B
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/helpers/queue_helpers.h"
#include "unit_tests/mocks/mock_command_queue.h"
#include "unit_tests/mocks/mock_context.h"
#include "unit_tests/mocks/mock_event.h"
#include "gtest/gtest.h"
using namespace NEO;
TEST(ReleaseQueueTest, givenCommandQueueWithoutVirtualEventWhenReleaseQueueIsCalledThenCmdQInternalRefCountIsNotDecremented) {
cl_int retVal = CL_SUCCESS;
MockCommandQueue *cmdQ = new MockCommandQueue;
EXPECT_EQ(1, cmdQ->getRefInternalCount());
EXPECT_EQ(1, cmdQ->getRefInternalCount());
cmdQ->incRefInternal();
EXPECT_EQ(2, cmdQ->getRefInternalCount());
releaseQueue<CommandQueue>(cmdQ, retVal);
EXPECT_EQ(1, cmdQ->getRefInternalCount());
cmdQ->decRefInternal();
}