2020-03-17 19:19:38 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-03-27 23:32:07 +08:00
|
|
|
#include "shared/source/utilities/io_functions.h"
|
|
|
|
|
|
|
|
#include <cstdint>
|
2020-03-17 19:19:38 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
2020-03-27 23:32:07 +08:00
|
|
|
namespace IoFunctions {
|
2020-03-17 19:19:38 +08:00
|
|
|
extern uint32_t mockFopenCalled;
|
|
|
|
extern uint32_t mockVfptrinfCalled;
|
|
|
|
extern uint32_t mockFcloseCalled;
|
|
|
|
|
2020-03-19 17:53:05 +08:00
|
|
|
inline FILE *mockFopen(const char *filename, const char *mode) {
|
2020-03-17 19:19:38 +08:00
|
|
|
mockFopenCalled++;
|
|
|
|
return reinterpret_cast<FILE *>(0x40);
|
|
|
|
}
|
|
|
|
|
2020-03-19 17:53:05 +08:00
|
|
|
inline int mockVfptrinf(FILE *stream, const char *format, va_list arg) {
|
2020-03-17 19:19:38 +08:00
|
|
|
mockVfptrinfCalled++;
|
|
|
|
return 0x10;
|
|
|
|
}
|
|
|
|
|
2020-03-19 17:53:05 +08:00
|
|
|
inline int mockFclose(FILE *stream) {
|
2020-03-17 19:19:38 +08:00
|
|
|
mockFcloseCalled++;
|
|
|
|
return 0;
|
|
|
|
}
|
2020-03-27 23:32:07 +08:00
|
|
|
} // namespace IoFunctions
|
2020-03-17 19:19:38 +08:00
|
|
|
} // namespace NEO
|