summaryrefslogtreecommitdiff
path: root/chapter12/src/test/java/com/seaofnodes
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2024-07-24 21:45:22 +0300
committerDibyendu Majumdar <dibyendumajumdar@users.noreply.github.com>2024-08-05 23:28:33 +0100
commitd719b190c29b5f603cb19a29e3585b8d84cb51fc (patch)
tree9a190bf655c930da9395606f7878f5dc94c8097b /chapter12/src/test/java/com/seaofnodes
parenta0d2771819f04b609ba0ea9c664471587e4754d5 (diff)
downloadSimple-d719b190c29b5f603cb19a29e3585b8d84cb51fc.tar.gz
Simple-d719b190c29b5f603cb19a29e3585b8d84cb51fc.zip
more fp bugfixes
Diffstat (limited to 'chapter12/src/test/java/com/seaofnodes')
-rw-r--r--chapter12/src/test/java/com/seaofnodes/simple/Chapter09Test.java1
-rw-r--r--chapter12/src/test/java/com/seaofnodes/simple/Chapter12Test.java4
2 files changed, 2 insertions, 3 deletions
diff --git a/chapter12/src/test/java/com/seaofnodes/simple/Chapter09Test.java b/chapter12/src/test/java/com/seaofnodes/simple/Chapter09Test.java
index d29de3e3..dba40b8a 100644
--- a/chapter12/src/test/java/com/seaofnodes/simple/Chapter09Test.java
+++ b/chapter12/src/test/java/com/seaofnodes/simple/Chapter09Test.java
@@ -5,7 +5,6 @@ import com.seaofnodes.simple.node.*;
import com.seaofnodes.simple.type.Type;
import com.seaofnodes.simple.type.TypeInteger;
import org.junit.Assert;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Ignore;
diff --git a/chapter12/src/test/java/com/seaofnodes/simple/Chapter12Test.java b/chapter12/src/test/java/com/seaofnodes/simple/Chapter12Test.java
index c5ea883e..bfd6c309 100644
--- a/chapter12/src/test/java/com/seaofnodes/simple/Chapter12Test.java
+++ b/chapter12/src/test/java/com/seaofnodes/simple/Chapter12Test.java
@@ -32,7 +32,7 @@ while( 1 ) {
return guess;
""");
StopNode stop = parser.parse(false).iterate(true);
- assertEquals("return Phi(Loop9,(flt)arg,(((ToFloat*Phi_guess)+Phi_guess)*2.0));", stop.toString());
+ assertEquals("return Phi(Loop9,(flt)arg,(((ToFloat/Phi_guess)+Phi_guess)/2.0));", stop.toString());
assertEquals(3.0, Evaluator.evaluate(stop, 9));
assertEquals(1.414213562373095, Evaluator.evaluate(stop, 2));
}
@@ -46,7 +46,7 @@ return x+1==x;
""");
StopNode stop = parser.parse(false).iterate(true);
assertEquals("return (((flt)arg+1.0)==ToFloat);", stop.toString());
- assertEquals(0, Evaluator.evaluate(stop, 1));
+ assertEquals(0L, Evaluator.evaluate(stop, 1));
}
}