diff --git a/src/test/java/org/solovyev/android/calculator/model/NumeralBaseTest.java b/src/test/java/org/solovyev/android/calculator/model/NumeralBaseTest.java index 8e7729b9..075a429b 100644 --- a/src/test/java/org/solovyev/android/calculator/model/NumeralBaseTest.java +++ b/src/test/java/org/solovyev/android/calculator/model/NumeralBaseTest.java @@ -5,7 +5,7 @@ import jscl.JsclMathEngine; import jscl.MathEngine; import jscl.math.Expression; import jscl.text.ParseException; -import jscl.util.ExpressionGenerator; +import jscl.util.ExpressionGeneratorWithInput; import org.jetbrains.annotations.NotNull; import org.junit.Assert; import org.junit.BeforeClass; @@ -37,7 +37,7 @@ public class NumeralBaseTest { try { final MathEngine me = JsclMathEngine.instance; - reader = new CSVReader(new InputStreamReader(NumeralBaseTest.class.getResourceAsStream("/jscl/math/nb_table.csv")), '\t'); + reader = new CSVReader(new InputStreamReader(NumeralBaseTest.class.getResourceAsStream("/org/solovyev/android/calculator/model/nb_table.csv")), '\t'); // skip first line reader.readNext(); @@ -62,7 +62,7 @@ public class NumeralBaseTest { System.out.println("Hex: " + hex); System.out.println("Bin: " + bin); - final ExpressionGenerator eg = new ExpressionGenerator(input, 20); + final ExpressionGeneratorWithInput eg = new ExpressionGeneratorWithInput(input, 20); final List expressions = eg.generate(); final String decExpression = expressions.get(0); diff --git a/src/test/resources/org/solovyev/android/calculator/model/nb_table.csv b/src/test/resources/org/solovyev/android/calculator/model/nb_table.csv new file mode 100644 index 00000000..98a0ed23 --- /dev/null +++ b/src/test/resources/org/solovyev/android/calculator/model/nb_table.csv @@ -0,0 +1,257 @@ +dec hex bin +0 0 0 +1 1 1 +2 2 10 +3 3 11 +4 4 100 +5 5 101 +6 6 110 +7 7 111 +8 8 1000 +9 9 1001 +10 a 1010 +11 b 1011 +12 c 1100 +13 d 1101 +14 e 1110 +15 f 1111 +16 10 10000 +17 11 10001 +18 12 10010 +19 13 10011 +20 14 10100 +21 15 10101 +22 16 10110 +23 17 10111 +24 18 11000 +25 19 11001 +26 1a 11010 +27 1b 11011 +28 1c 11100 +29 1d 11101 +30 1e 11110 +31 1f 11111 +32 20 100000 +33 21 100001 +34 22 100010 +35 23 100011 +36 24 100100 +37 25 100101 +38 26 100110 +39 27 100111 +40 28 101000 +41 29 101001 +42 2a 101010 +43 2b 101011 +44 2c 101100 +45 2d 101101 +46 2e 101110 +47 2f 101111 +48 30 110000 +49 31 110001 +50 32 110010 +51 33 110011 +52 34 110100 +53 35 110101 +54 36 110110 +55 37 110111 +56 38 111000 +57 39 111001 +58 3a 111010 +59 3b 111011 +60 3c 111100 +61 3d 111101 +62 3e 111110 +63 3f 111111 +64 40 1000000 +65 41 1000001 +66 42 1000010 +67 43 1000011 +68 44 1000100 +69 45 1000101 +70 46 1000110 +71 47 1000111 +72 48 1001000 +73 49 1001001 +74 4a 1001010 +75 4b 1001011 +76 4c 1001100 +77 4d 1001101 +78 4e 1001110 +79 4f 1001111 +80 50 1010000 +81 51 1010001 +82 52 1010010 +83 53 1010011 +84 54 1010100 +85 55 1010101 +86 56 1010110 +87 57 1010111 +88 58 1011000 +89 59 1011001 +90 5a 1011010 +91 5b 1011011 +92 5c 1011100 +93 5d 1011101 +94 5e 1011110 +95 5f 1011111 +96 60 1100000 +97 61 1100001 +98 62 1100010 +99 63 1100011 +100 64 1100100 +101 65 1100101 +102 66 1100110 +103 67 1100111 +104 68 1101000 +105 69 1101001 +106 6a 1101010 +107 6b 1101011 +108 6c 1101100 +109 6d 1101101 +110 6e 1101110 +111 6f 1101111 +112 70 1110000 +113 71 1110001 +114 72 1110010 +115 73 1110011 +116 74 1110100 +117 75 1110101 +118 76 1110110 +119 77 1110111 +120 78 1111000 +121 79 1111001 +122 7a 1111010 +123 7b 1111011 +124 7c 1111100 +125 7d 1111101 +126 7e 1111110 +127 7f 1111111 +128 80 10000000 +129 81 10000001 +130 82 10000010 +131 83 10000011 +132 84 10000100 +133 85 10000101 +134 86 10000110 +135 87 10000111 +136 88 10001000 +137 89 10001001 +138 8a 10001010 +139 8b 10001011 +140 8c 10001100 +141 8d 10001101 +142 8e 10001110 +143 8f 10001111 +144 90 10010000 +145 91 10010001 +146 92 10010010 +147 93 10010011 +148 94 10010100 +149 95 10010101 +150 96 10010110 +151 97 10010111 +152 98 10011000 +153 99 10011001 +154 9a 10011010 +155 9b 10011011 +156 9c 10011100 +157 9d 10011101 +158 9e 10011110 +159 9f 10011111 +160 a0 10100000 +161 a1 10100001 +162 a2 10100010 +163 a3 10100011 +164 a4 10100100 +165 a5 10100101 +166 a6 10100110 +167 a7 10100111 +168 a8 10101000 +169 a9 10101001 +170 aa 10101010 +171 ab 10101011 +172 ac 10101100 +173 ad 10101101 +174 ae 10101110 +175 af 10101111 +176 b0 10110000 +177 b1 10110001 +178 b2 10110010 +179 b3 10110011 +180 b4 10110100 +181 b5 10110101 +182 b6 10110110 +183 b7 10110111 +184 b8 10111000 +185 b9 10111001 +186 ba 10111010 +187 bb 10111011 +188 bc 10111100 +189 bd 10111101 +190 be 10111110 +191 bf 10111111 +192 c0 11000000 +193 c1 11000001 +194 c2 11000010 +195 c3 11000011 +196 c4 11000100 +197 c5 11000101 +198 c6 11000110 +199 c7 11000111 +200 c8 11001000 +201 c9 11001001 +202 ca 11001010 +203 cb 11001011 +204 cc 11001100 +205 cd 11001101 +206 ce 11001110 +207 cf 11001111 +208 d0 11010000 +209 d1 11010001 +210 d2 11010010 +211 d3 11010011 +212 d4 11010100 +213 d5 11010101 +214 d6 11010110 +215 d7 11010111 +216 d8 11011000 +217 d9 11011001 +218 da 11011010 +219 db 11011011 +220 dc 11011100 +221 dd 11011101 +222 de 11011110 +223 df 11011111 +224 e0 11100000 +225 e1 11100001 +226 e2 11100010 +227 e3 11100011 +228 e4 11100100 +229 e5 11100101 +230 e6 11100110 +231 e7 11100111 +232 e8 11101000 +233 e9 11101001 +234 ea 11101010 +235 eb 11101011 +236 ec 11101100 +237 ed 11101101 +238 ee 11101110 +239 ef 11101111 +240 f0 11110000 +241 f1 11110001 +242 f2 11110010 +243 f3 11110011 +244 f4 11110100 +245 f5 11110101 +246 f6 11110110 +247 f7 11110111 +248 f8 11111000 +249 f9 11111001 +250 fa 11111010 +251 fb 11111011 +252 fc 11111100 +253 fd 11111101 +254 fe 11111110 +255 ff 11111111