NesLabelWatchTarget.java

1
package com.rox;
2
3
import com.rox.debug.labels.LabelWatchTarget;
4
5
import java.util.Map;
6
import java.util.function.IntUnaryOperator;
7
8
/** {@link LabelWatchTarget} over a live {@link NES}: its debugging edits, and {@link NesMemoryDebugSource}'s side-effect-free reads. */
9
final class NesLabelWatchTarget implements LabelWatchTarget {
10
    private final NES nes;
11
    private final NesMemoryDebugSource memory;
12
13
    NesLabelWatchTarget(final NES nes){
14
        this.nes = nes;
15
        this.memory = new NesMemoryDebugSource(nes);
16
    }
17
18
    @Override
19
    public IntUnaryOperator peek(){
20 1 1. peek : replaced return value with null for com/rox/NesLabelWatchTarget::peek → KILLED
        return memory.peek();
21
    }
22
23
    @Override
24
    public void poke(final int address, final int value){
25 1 1. poke : removed call to com/rox/NES::pokeMemory → KILLED
        nes.pokeMemory(address, value);
26
    }
27
28
    @Override
29
    public void lock(final int address, final int value){
30 1 1. lock : removed call to com/rox/NES::lockMemory → KILLED
        nes.lockMemory(address, value);
31
    }
32
33
    @Override
34
    public void unlock(final int address){
35 1 1. unlock : removed call to com/rox/NES::unlockMemory → KILLED
        nes.unlockMemory(address);
36
    }
37
38
    @Override
39
    public Map<Integer, Integer> locks(){
40 1 1. locks : replaced return value with Collections.emptyMap for com/rox/NesLabelWatchTarget::locks → KILLED
        return nes.lockedMemory();
41
    }
42
}

Mutations

20

1.1
Location : peek
Killed by : com.rox.NesLabelWatchTargetTest.[engine:junit-jupiter]/[class:com.rox.NesLabelWatchTargetTest]/[method:readsAndEditsTheNesMemory()]
replaced return value with null for com/rox/NesLabelWatchTarget::peek → KILLED

25

1.1
Location : poke
Killed by : com.rox.NesLabelWatchTargetTest.[engine:junit-jupiter]/[class:com.rox.NesLabelWatchTargetTest]/[method:readsAndEditsTheNesMemory()]
removed call to com/rox/NES::pokeMemory → KILLED

30

1.1
Location : lock
Killed by : com.rox.NesLabelWatchTargetTest.[engine:junit-jupiter]/[class:com.rox.NesLabelWatchTargetTest]/[method:locksGoThroughTheNes()]
removed call to com/rox/NES::lockMemory → KILLED

35

1.1
Location : unlock
Killed by : com.rox.NesLabelWatchTargetTest.[engine:junit-jupiter]/[class:com.rox.NesLabelWatchTargetTest]/[method:locksGoThroughTheNes()]
removed call to com/rox/NES::unlockMemory → KILLED

40

1.1
Location : locks
Killed by : com.rox.NesLabelWatchTargetTest.[engine:junit-jupiter]/[class:com.rox.NesLabelWatchTargetTest]/[method:locksGoThroughTheNes()]
replaced return value with Collections.emptyMap for com/rox/NesLabelWatchTarget::locks → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1