diff options
Diffstat (limited to 'chapter21/src/test/java/com')
3 files changed, 11 insertions, 11 deletions
diff --git a/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java b/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java index 856baac4..28111697 100644 --- a/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java +++ b/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java @@ -63,9 +63,9 @@ for( int pc = 0; pc < program#; pc++ ) { } return output; """; - Chapter21Test.testCPU(src,"x86_64_v2", "SystemV",28,null); - Chapter21Test.testCPU(src,"riscv" , "SystemV",12,null); - Chapter21Test.testCPU(src,"arm" , "SystemV",12,null); + Chapter21Test.testCPU(src,"x86_64_v2", "SystemV",40,null); + Chapter21Test.testCPU(src,"riscv" , "SystemV",30,null); + Chapter21Test.testCPU(src,"arm" , "SystemV",30,null); //assertEquals("Hello World!\n", Eval2.eval(code, 0, 10000)); } } diff --git a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java index 9d780b57..cb55c033 100644 --- a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java +++ b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java @@ -57,16 +57,16 @@ public class Chapter21Test { public void testString() throws IOException { String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/stringHash.smp")); testCPU(src,"x86_64_v2", "SystemV",18,null); - testCPU(src,"riscv" , "SystemV", 3,null); - testCPU(src,"arm" , "SystemV", 3,null); + testCPU(src,"riscv" , "SystemV",18,null); + testCPU(src,"arm" , "SystemV",17,null); } @Test public void testArray1() throws IOException { String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/array1.smp")); - testCPU(src,"x86_64_v2", "SystemV",3,"return .[];"); - testCPU(src,"riscv" , "SystemV",1,"return (add,.[],(mul,.[],1000));"); - testCPU(src,"arm" , "SystemV",1,"return (add,.[],(mul,.[],1000));"); + testCPU(src,"x86_64_v2", "SystemV",7,"return .[];"); + testCPU(src,"riscv" , "SystemV",9,"return (add,.[],(mul,.[],1000));"); + testCPU(src,"arm" , "SystemV",5,"return (add,.[],(mul,.[],1000));"); } diff --git a/chapter21/src/test/java/com/seaofnodes/simple/MergeSortTest.java b/chapter21/src/test/java/com/seaofnodes/simple/MergeSortTest.java index c83fe089..bf775b4f 100644 --- a/chapter21/src/test/java/com/seaofnodes/simple/MergeSortTest.java +++ b/chapter21/src/test/java/com/seaofnodes/simple/MergeSortTest.java @@ -58,9 +58,9 @@ merge_sort(a, b, a#); return a; """; - Chapter20Test.testCPU(src,"x86_64_v2", "SystemV",46,"Stop[ return mov(mov([int])); return 0; ]"); - Chapter20Test.testCPU(src,"riscv" , "SystemV",36,"Stop[ return mov(mov([int])); return 0; ]"); - Chapter20Test.testCPU(src,"arm" , "SystemV",37,"Stop[ return mov(mov([int])); return 0; ]"); + Chapter20Test.testCPU(src,"x86_64_v2", "SystemV",54,"Stop[ return mov(mov([int])); return 0; ]"); + Chapter20Test.testCPU(src,"riscv" , "SystemV",44,"Stop[ return mov(mov([int])); return 0; ]"); + Chapter20Test.testCPU(src,"arm" , "SystemV",44,"Stop[ return mov(mov([int])); return 0; ]"); //assertEquals("int[ 1,2,3,4,5,6,7,8,9,10,11]", Eval2.eval(code, 11)); } |
