Correct printf formatting for %%
https://github.com/intel/compute-runtime/issues/536 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
2285772c7e
commit
20bb97ece3
|
@ -11,7 +11,6 @@ set(IGDRCL_SRCS_tests_program
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info_from_patchtokens_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/printf_handler_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/printf_helper_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/process_debug_data_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/process_elf_binary_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/process_spir_binary_tests.cpp
|
||||
|
@ -28,10 +27,5 @@ set(IGDRCL_SRCS_tests_program
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/program_with_zebin_tests.cpp
|
||||
)
|
||||
|
||||
get_property(NEO_CORE_SRCS_tests_program GLOBAL PROPERTY NEO_CORE_SRCS_tests_program)
|
||||
list(APPEND IGDRCL_SRCS_tests_program
|
||||
${NEO_CORE_SRCS_tests_program}
|
||||
)
|
||||
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_program})
|
||||
add_subdirectories()
|
||||
|
|
|
@ -63,6 +63,7 @@ void PrintFormatter::printString(const char *formatString, const std::function<v
|
|||
size_t end = i;
|
||||
if (end + 1 <= length && formatString[end + 1] == '%') {
|
||||
output[cursor++] = '%';
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
#
|
||||
# Copyright (C) 2020-2021 Intel Corporation
|
||||
# Copyright (C) 2020-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(NEO_CORE_SRCS_tests_program
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/program_info_from_patchtokens_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/program_info_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/program_initialization_tests.cpp
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/printf_helper_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/program_info_from_patchtokens_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/program_info_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/program_initialization_tests.cpp
|
||||
)
|
||||
|
||||
set_property(GLOBAL PROPERTY NEO_CORE_SRCS_tests_program ${NEO_CORE_SRCS_tests_program})
|
||||
add_subdirectories()
|
||||
|
|
|
@ -8,12 +8,8 @@
|
|||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
#include "shared/source/program/print_formatter.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_program.h"
|
||||
#include "shared/test/common/mocks/mock_kernel_info.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
|
@ -34,7 +30,6 @@ class PrintFormatterTest : public testing::Test {
|
|||
|
||||
MockGraphicsAllocation *data;
|
||||
std::unique_ptr<MockKernelInfo> kernelInfo;
|
||||
ClDevice *device;
|
||||
|
||||
uint8_t underlyingBuffer[maxPrintfOutputLength];
|
||||
uint32_t offset;
|
||||
|
@ -406,6 +401,7 @@ INSTANTIATE_TEST_CASE_P(PrintfDoubleTest,
|
|||
|
||||
std::pair<std::string, std::string> specialValues[] = {
|
||||
{"%%", "%"},
|
||||
{"%% ", "% "},
|
||||
{"nothing%", "nothing"},
|
||||
};
|
||||
|
Loading…
Reference in New Issue