From ffe1e3ee3c275abb0eeabc7db38598f55fa67ac8 Mon Sep 17 00:00:00 2001 From: Fabian Stemmler Date: Wed, 18 Sep 2019 01:19:07 +0200 Subject: [PATCH] Adapted WordAddressableMemoryTest to work with binary vectors only --- .../machine/standard/memory/WordAddressableMemoryTest.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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(); -- 2.17.1