Skip to content

Commit b307c07

Browse files
committed
Fixed test
1 parent c68114e commit b307c07

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/org/sosy_lab/java_smt/solvers/z3/Z3FloatingPointFormulaManager.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88

99
package org.sosy_lab.java_smt.solvers.z3;
1010

11-
import com.google.common.base.Preconditions;
1211
import com.google.common.collect.ImmutableList;
1312
import com.microsoft.z3.Native;
14-
import com.microsoft.z3.Z3Exception;
1513
import java.math.BigInteger;
1614
import org.sosy_lab.java_smt.api.FloatingPointRoundingMode;
1715
import org.sosy_lab.java_smt.api.FormulaType;
@@ -75,16 +73,15 @@ protected Long makeNumberImpl(double pN, FloatingPointType pType, Long pRounding
7573

7674
@Override
7775
protected Long makeNumberImpl(
78-
BigInteger exponent,
79-
BigInteger mantissa,
80-
boolean signBit,
81-
FloatingPointType type) {
82-
83-
long signBv = Native.mkBvNumeral(z3context, 1, new boolean[]{signBit});
84-
long expoBv = Native.mkNumeral(z3context, exponent.toString(), Native.mkBvSort(z3context,
85-
type.getExponentSize()));
86-
long mantBv = Native.mkNumeral(z3context, mantissa.toString(), Native.mkBvSort(z3context,
87-
type.getMantissaSize()));
76+
BigInteger exponent, BigInteger mantissa, boolean signBit, FloatingPointType type) {
77+
78+
long signBv = Native.mkBvNumeral(z3context, 1, new boolean[] {signBit});
79+
long expoBv =
80+
Native.mkNumeral(
81+
z3context, exponent.toString(), Native.mkBvSort(z3context, type.getExponentSize()));
82+
long mantBv =
83+
Native.mkNumeral(
84+
z3context, mantissa.toString(), Native.mkBvSort(z3context, type.getMantissaSize()));
8885

8986
assert Native.getSort(z3context, signBv) != Native.getSort(z3context, mantBv);
9087

src/org/sosy_lab/java_smt/test/FloatingPointFormulaManagerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -953,10 +953,10 @@ public void failOnInvalidString() {
953953

954954
@Test
955955
public void fpFromBitPattern() throws SolverException, InterruptedException {
956-
final FloatingPointFormula expr1 = fpmgr.makeNumber(-0.1, doublePrecType);
956+
final FloatingPointFormula expr1 = fpmgr.makeNumber(-0.1, singlePrecType);
957957
final FloatingPointFormula expr2 =
958958
fpmgr.makeNumber(
959-
BigInteger.valueOf(123), BigInteger.valueOf(5033165), true, doublePrecType);
959+
BigInteger.valueOf(123), BigInteger.valueOf(5033165), true, singlePrecType);
960960
assertThatFormula(fpmgr.assignment(expr1, expr2)).isTautological();
961961
}
962962
}

0 commit comments

Comments
 (0)