ControllerConfiguration.java

1
package com.rox.input;
2
3
/**
4
 * Bundles all 4 controller slots plus the Four Score enablement flag into the one parameter threaded
5
 * through {@link com.rox.NES}/{@link com.rox.mem.NESMemoryBus} - matches how
6
 * {@link com.rox.video.VideoOutput} was added as one bundled param per pluggable-device layer, not
7
 * one param per slot.
8
 */
9
public class ControllerConfiguration {
10
    /** All 4 slots absent, Four Score disabled - the default for callers that don't care about input. */
11
    public static final ControllerConfiguration NONE =
12
            new ControllerConfiguration(Controller.NONE, Controller.NONE, Controller.NONE, Controller.NONE, false);
13
14
    private final Controller player1;
15
    private final Controller player2;
16
    private final Controller player3;
17
    private final Controller player4;
18
    private final boolean fourScoreEnabled;
19
20
    public ControllerConfiguration(final Controller player1, final Controller player2,
21
                                    final Controller player3, final Controller player4,
22
                                    final boolean fourScoreEnabled){
23
        this.player1 = player1;
24
        this.player2 = player2;
25
        this.player3 = player3;
26
        this.player4 = player4;
27
        this.fourScoreEnabled = fourScoreEnabled;
28
    }
29
30
    /** 2-player setup, Four Score disabled - the common case. */
31
    public static ControllerConfiguration twoPlayers(final Controller player1, final Controller player2){
32 1 1. twoPlayers : replaced return value with null for com/rox/input/ControllerConfiguration::twoPlayers → KILLED
        return new ControllerConfiguration(player1, player2, Controller.NONE, Controller.NONE, false);
33
    }
34
35
    public Controller player1(){
36 1 1. player1 : replaced return value with null for com/rox/input/ControllerConfiguration::player1 → KILLED
        return player1;
37
    }
38
39
    public Controller player2(){
40 1 1. player2 : replaced return value with null for com/rox/input/ControllerConfiguration::player2 → KILLED
        return player2;
41
    }
42
43
    public Controller player3(){
44 1 1. player3 : replaced return value with null for com/rox/input/ControllerConfiguration::player3 → KILLED
        return player3;
45
    }
46
47
    public Controller player4(){
48 1 1. player4 : replaced return value with null for com/rox/input/ControllerConfiguration::player4 → KILLED
        return player4;
49
    }
50
51
    public boolean fourScoreEnabled(){
52 2 1. fourScoreEnabled : replaced boolean return with false for com/rox/input/ControllerConfiguration::fourScoreEnabled → KILLED
2. fourScoreEnabled : replaced boolean return with true for com/rox/input/ControllerConfiguration::fourScoreEnabled → KILLED
        return fourScoreEnabled;
53
    }
54
}

Mutations

32

1.1
Location : twoPlayers
Killed by : com.rox.input.ControllerConfigurationTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigurationTest]/[method:twoPlayersFillsOnlyTheFirstTwoSlotsAndDisablesFourScore()]
replaced return value with null for com/rox/input/ControllerConfiguration::twoPlayers → KILLED

36

1.1
Location : player1
Killed by : com.rox.input.ControllerConfigurationTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigurationTest]/[method:noneHasAllFourSlotsAbsentAndFourScoreDisabled()]
replaced return value with null for com/rox/input/ControllerConfiguration::player1 → KILLED

40

1.1
Location : player2
Killed by : com.rox.input.ControllerConfigurationTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigurationTest]/[method:noneHasAllFourSlotsAbsentAndFourScoreDisabled()]
replaced return value with null for com/rox/input/ControllerConfiguration::player2 → KILLED

44

1.1
Location : player3
Killed by : com.rox.input.ControllerConfigurationTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigurationTest]/[method:noneHasAllFourSlotsAbsentAndFourScoreDisabled()]
replaced return value with null for com/rox/input/ControllerConfiguration::player3 → KILLED

48

1.1
Location : player4
Killed by : com.rox.input.ControllerConfigurationTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigurationTest]/[method:noneHasAllFourSlotsAbsentAndFourScoreDisabled()]
replaced return value with null for com/rox/input/ControllerConfiguration::player4 → KILLED

52

1.1
Location : fourScoreEnabled
Killed by : com.rox.input.ControllerConfigurationTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigurationTest]/[method:eachAccessorReturnsItsOwnConstructorArgument()]
replaced boolean return with false for com/rox/input/ControllerConfiguration::fourScoreEnabled → KILLED

2.2
Location : fourScoreEnabled
Killed by : com.rox.input.ControllerConfigurationTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigurationTest]/[method:fourScoreEnabledCanBeFalse()]
replaced boolean return with true for com/rox/input/ControllerConfiguration::fourScoreEnabled → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1