/* * Copyright (C) 2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once #include "shared/source/utilities/io_functions.h" #include #include namespace NEO { namespace IoFunctions { extern uint32_t mockFopenCalled; extern uint32_t mockVfptrinfCalled; extern uint32_t mockFcloseCalled; extern bool returnMockEnvValue; extern std::string mockEnvValue; inline FILE *mockFopen(const char *filename, const char *mode) { mockFopenCalled++; return reinterpret_cast(0x40); } inline int mockVfptrinf(FILE *stream, const char *format, va_list arg) { mockVfptrinfCalled++; return 0x10; } inline int mockFclose(FILE *stream) { mockFcloseCalled++; return 0; } inline char *mockGetenv(const char *name) noexcept { if (returnMockEnvValue) { return const_cast(mockEnvValue.c_str()); } return getenv(name); } } // namespace IoFunctions } // namespace NEO