1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-12-22 20:36:01 +01:00

Modify behaviour of QMCkl probes when VFC_CI is disabled

Now, probes witth absolute check and relative checks perform the
verification with the expected/actual value as expected and returns a
boolean to indicate the result.
This commit is contained in:
Aurelien Delval 2021-08-20 15:11:28 +00:00
parent f59a6385ee
commit 26ca2d3907

View File

@ -1,4 +1,5 @@
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef VFC_CI
@ -39,7 +40,7 @@ bool qmckl_probe_check(
#ifdef VFC_CI
return vfc_probe_check(&probes, testName, varName, value, accuracyTarget);
#else
return !(value == expectedValue);
return !(abs(value - expectedValue) < accuracyTarget);
#endif
}
@ -54,7 +55,7 @@ bool qmckl_probe_check_relative (
#ifdef VFC_CI
return vfc_probe_check_relative(&probes, testName, varName, value, accuracyTarget);
#else
return !(value <= expectedValue + accuracyTarget || value >= expectedValue - accuracyTarget);
return !(abs(value - expectedValue) / abs(expectedValue) < accuracyTarget);
#endif
}