Browse Source

Look up of constant value in test RESULT specification should allow imprecision for double values.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@7715 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 12 years ago
parent
commit
16015890dd
  1. 9
      prism/src/parser/ast/Property.java

9
prism/src/parser/ast/Property.java

@ -169,9 +169,14 @@ public class Property extends ASTElement
String constName = pair[0].trim();
String constVal = pair[1].trim();
Object constValToMatch = constValues.getValueOf(constName);
// Just check for exact string match for now
if (constValToMatch == null || !constValToMatch.toString().equals(constVal))
if (constValToMatch == null)
match = false;
// Check doubles numerically
else if (constValToMatch instanceof Double)
match = PrismUtils.doublesAreCloseRel(((Double) constValToMatch).doubleValue(), Double.parseDouble(constVal), 1e-10);
// Otherwise just check for exact string match for now
else
match = constValToMatch.toString().equals(constVal);
}
// Found it...
if (match) {

Loading…
Cancel
Save