diff options
Diffstat (limited to 'render-test/metadata.hpp')
-rw-r--r-- | render-test/metadata.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/render-test/metadata.hpp b/render-test/metadata.hpp index c26fde1d19..20cc440fd4 100644 --- a/render-test/metadata.hpp +++ b/render-test/metadata.hpp @@ -49,12 +49,19 @@ struct FileSizeProbe { struct MemoryProbe { MemoryProbe() = default; - MemoryProbe(size_t peak_, size_t allocations_) - : peak(peak_) - , allocations(allocations_) {} + MemoryProbe(size_t peak_, size_t allocations_) : peak(peak_), allocations(allocations_), tolerance(0.0f) {} size_t peak; size_t allocations; + float tolerance; + + static std::tuple<bool, float> checkPeak(const MemoryProbe& expected, const MemoryProbe& actual) { + return checkValue(expected.peak, actual.peak, actual.tolerance); + } + + static std::tuple<bool, float> checkAllocations(const MemoryProbe& expected, const MemoryProbe& actual) { + return checkValue(expected.allocations, actual.allocations, actual.tolerance); + } }; struct NetworkProbe { |