restored the possibility of different writing modes in the FileLogger
mocked writeToFile in TestFileLogger
Related-To: NEO-7006
Signed-off-by: Marcel Skierkowski <marcel.skierkowski@intel.com>
reducing the number of tests that have interactions with filesystem.
writeDataToFile() saves filename and content in std::map.
fileExistsHasSize() checks if file was previously written to virtualFileSystem
loadDataFromVirtualFile() fetches data from std::map based on filename
Related-To: NEO-7006
Signed-off-by: Marcel Skierkowski <marcel.skierkowski@intel.com>
Fix the PAT-index reporting in logger as currently on Windows reported
values are simply wrong.
The changed logic dependends on `RootDeviceEnvironment` and in order to
avoid introducing such dependencies into logger.[ch] the
`logAllocation()` is no longer a member of `FileLogger` but
a free-function instead (and a separate .cpp file). This is important
because the source files `logger.[ch]` are also used by ocloc library
and there is no point to contaminate ocloc code structure with
unnecessary dependencies.
Related-To: NEO-9421
Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
gmm params: usage, cachable and resource info
should be set properly when override allocation type
Resolves: HSD-22020344331
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
- initialization of FileLogger always removed log file - this change only
removes old file when logging is enabled in current run
Resolves: NEO-7199
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
Historically, FileLogger was intended to work with scalar types.
Therefore, its member functions utilized parameter packs, which
copied the arguments. However, some time ago std::strings had
started to be passed to this function. The recursion was performing
multiple copies of the same std::string, which could cause
unneeded memory allocations.
This change:
- replaces copying with const references
- applies std::move() operator if possible
- replaces std::unique_lock with std::lock_guard
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
- Create new files for logger test in shared
- Reduce number of ULTs by converting parameterized tests into the normal
one.
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>