From: Fabian Stemmler Date: Tue, 17 Sep 2019 23:19:07 +0000 (+0200) Subject: Adapted WordAddressableMemoryTest to work with binary vectors only X-Git-Url: https://mograsim.net/gitweb/?p=Mograsim.git;a=commitdiff_plain;h=ffe1e3ee3c275abb0eeabc7db38598f55fa67ac8 Adapted WordAddressableMemoryTest to work with binary vectors only --- diff --git a/tests/net.mograsim.machine.tests/src/net/mograsim/machine/standard/memory/WordAddressableMemoryTest.java b/tests/net.mograsim.machine.tests/src/net/mograsim/machine/standard/memory/WordAddressableMemoryTest.java index ae8e8153..74132188 100644 --- a/tests/net.mograsim.machine.tests/src/net/mograsim/machine/standard/memory/WordAddressableMemoryTest.java +++ b/tests/net.mograsim.machine.tests/src/net/mograsim/machine/standard/memory/WordAddressableMemoryTest.java @@ -45,11 +45,8 @@ class WordAddressableMemoryTest BitVector bAddress = BitVector.from(4096 + i + j, 64); addressI.feedSignals(bAddress); t.executeAll(); - String random = BigInteger.valueOf(Math.abs(r.nextInt())).toString(5); - random = random.substring(Integer.max(0, random.length() - 16)); - random = String.format("%16s", random).replace(' ', '0'); - random = random.replace('2', 'X').replace('3', 'Z').replace('4', 'U'); - BitVector vector = BitVector.parse(random); + BigInteger random = BigInteger.valueOf(Math.abs(r.nextInt())); + BitVector vector = BitVector.from(random, 16); dataI.feedSignals(vector); rWI.feedSignals(Bit.ZERO); t.executeAll();