From 5d6be83499257aed725681df6e2f68b53ee778ca Mon Sep 17 00:00:00 2001 From: Karol Stasiak Date: Sat, 20 Jan 2018 22:43:12 +0100 Subject: [PATCH] Fix tests running in headless JVMs --- src/test/java/com/grapeshot/halfnes/CPURAM.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/com/grapeshot/halfnes/CPURAM.java b/src/test/java/com/grapeshot/halfnes/CPURAM.java index 1227b5a4..6281a3b3 100644 --- a/src/test/java/com/grapeshot/halfnes/CPURAM.java +++ b/src/test/java/com/grapeshot/halfnes/CPURAM.java @@ -3,6 +3,8 @@ package com.grapeshot.halfnes; import com.grapeshot.halfnes.mappers.Mapper; import millfork.output.MemoryBank; +import java.util.prefs.Preferences; + /** * Since the original CPURAM class was a convoluted mess of dependencies, * I overrode it with mine that has only few pieces of junk glue to make it work @@ -11,6 +13,11 @@ import millfork.output.MemoryBank; @SuppressWarnings("unused") public class CPURAM { + static { + Preferences preferences = Preferences.userNodeForPackage(NES.class); + preferences.putBoolean("soundEnable", false); + } + private final MemoryBank mem; // required by the CPU class for some reason