... | ... | @@ -11,15 +11,19 @@ For each file, there is a field "method" that is used to define how to compare t |
|
|
##### "method": "absolute"
|
|
|
|
|
|
This method compares the absolute difference between two values: `|base-test|`.
|
|
|
The field "tolerance": [float] contains the maximum-allowed difference between two values. If `|base-test| > diff`, the test fails.
|
|
|
The field `"tolerance": [float]` contains the maximum-allowed difference between two values. If `|base-test| <= tolerance`, the test succeeds.
|
|
|
|
|
|
##### "method": "relative"
|
|
|
|
|
|
This method compares the relative difference between two values: `|(test-base)/base|` or `|(test-base)/test|` if `base=0`. The field "tolerance": [float] contains the maximum-allowed difference.
|
|
|
This method compares the relative difference between two values: `|(test-base)/base| <= tolerance` or `|(test-base)/test| <= tolerance` if `base=0`. The field `"tolerance": [float]` contains the maximum-allowed difference.
|
|
|
|
|
|
##### "method": "power"
|
|
|
|
|
|
This method is a bit more tricky. It determines approximately the number of significant digits that are taken into account when doing the comparison. This number is defined by the field "tolerance" : [integer]. More exactly, the formula is the following: `diff=base*10^-tolerance` and diff used as the method `absolute` tolerance, except if `tolerance=0`. In this case, no difference is allowed at all.
|
|
|
This method is a bit more tricky. It determines approximately the number of significant digits that are taken into account when doing the comparison. This number is defined by the field `"tolerance" : [integer]`. Higher is this number, more accurate is the test. More exactly, the formula is the following: `-log10(|(base/int(log10(base))-(ref/int(log10(base))|<=tolerance` except if `tolerance=0`. In this case, no difference is allowed at all.
|
|
|
|
|
|
##### "method": "diff"
|
|
|
|
|
|
This method is not recommended. It performs a simple unix `diff` and fails if differences are detected. It does not return any metadata about the element number of the file or the nature of the differences that are observed. It fails if the formatting is different, which can be a problem because it depends on the standard followed by the compiler.
|
|
|
|
|
|
##### Choose the right values
|
|
|
|
... | ... | |