mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
Add diagnostic mode to direct submission
Related-To: NEO-4338 Change-Id: Ibcdc1b6a1762827337e4ff5364a972702130195a Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
@@ -15,6 +15,7 @@ set(NEO_CORE_UTILITIES_TESTS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/destructor_counted.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/directory_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/heap_allocator_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/io_functions_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/numeric_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/perf_profiler.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/reference_tracked_object_tests.cpp
|
||||
|
||||
29
shared/test/unit_test/utilities/io_functions_tests.cpp
Normal file
29
shared/test/unit_test/utilities/io_functions_tests.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/mocks/mock_io_functions.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(IoFunctionTest, WhenMockFunctionsSelectedThenCorrectFunctionPointerUsed) {
|
||||
IoFunctions::mockFopenCalled = 0;
|
||||
IoFunctions::mockVfptrinfCalled = 0;
|
||||
IoFunctions::mockFcloseCalled = 0;
|
||||
|
||||
FILE *file = IoFunctions::fopenPtr("dummy file", "dummy mode");
|
||||
EXPECT_EQ(reinterpret_cast<FILE *>(0x40), file);
|
||||
int expectedPrintfRet = 0x10;
|
||||
int actualPrintfRet = IoFunctions::fprintf(file, "dummy format", "dummy string");
|
||||
EXPECT_EQ(expectedPrintfRet, actualPrintfRet);
|
||||
IoFunctions::fprintf(file, "another dummy format", "another dummy string");
|
||||
IoFunctions::fclosePtr(file);
|
||||
|
||||
EXPECT_EQ(1u, IoFunctions::mockFopenCalled);
|
||||
EXPECT_EQ(2u, IoFunctions::mockVfptrinfCalled);
|
||||
EXPECT_EQ(1u, IoFunctions::mockFcloseCalled);
|
||||
}
|
||||
Reference in New Issue
Block a user