MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / Validate

Function Validate

IntelPresentMon/PresentMonAPI2Tests/CsvHelper.h:398–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396
397template<typename T>
398bool Validate(const T& param1, const T& param2) {
399 if constexpr (std::is_same<T, double>::value) {
400 auto min = std::min(countDecimalPlaces(param1), countDecimalPlaces(param2));
401 double threshold = pow(0.1, min);
402 double difference = param1 - param2;
403 if (difference > -threshold && difference < threshold) {
404 return true;
405 }
406 else
407 {
408 return false;
409 }
410 }
411 else {
412 return param1 == param2;
413 }
414
415}
416
417
418

Callers 2

ValidateMetricValueFunction · 0.85
VerifyBlobAgainstCsvMethod · 0.85

Calls 1

countDecimalPlacesFunction · 0.85

Tested by

no test coverage detected