MemoryBus8Bit.java

1
package com.rox.mem;
2
3
public class MemoryBus8Bit implements MemoryBus {
4
    private final Memory memory;
5
6
    public final static int ADDRESS_MASK = 0xFFFF;
7
    public final static int DATA_MASK = 0xFF;
8
9
    public MemoryBus8Bit(final Memory memory){
10
        this.memory = memory;
11
    }
12
13
    @Override
14
    public int read(int address) {
15 2 1. read : Replaced bitwise AND with OR → KILLED
2. read : replaced int return with 0 for com/rox/mem/MemoryBus8Bit::read → KILLED
        return memory.read(ADDRESS_MASK & address);
16
    }
17
18
    @Override
19
    public void write(int address, int value) {
20 3 1. write : removed call to com/rox/mem/Memory::write → KILLED
2. write : Replaced bitwise AND with OR → KILLED
3. write : Replaced bitwise AND with OR → KILLED
        memory.write(address & ADDRESS_MASK, value & DATA_MASK);
21
    }
22
}

Mutations

15

1.1
Location : read
Killed by : com.rox.cpu.mos6502.MOS6502MicroOpTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.MOS6502MicroOpTest]/[method:dummyWriteMemWritesBackTheSameValue()]
Replaced bitwise AND with OR → KILLED

2.2
Location : read
Killed by : com.rox.cpu.mos6502.MOS6502MicroOpTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.MOS6502MicroOpTest]/[method:dummyWriteMemWritesBackTheSameValue()]
replaced int return with 0 for com/rox/mem/MemoryBus8Bit::read → KILLED

20

1.1
Location : write
Killed by : com.rox.mem.MemoryBus8BitTest.[engine:jqwik]/[class:com.rox.mem.MemoryBus8BitTest]/[property:writeValidValueToValidAddress(int, int)]
removed call to com/rox/mem/Memory::write → KILLED

2.2
Location : write
Killed by : com.rox.mem.MemoryBus8BitTest.[engine:jqwik]/[class:com.rox.mem.MemoryBus8BitTest]/[property:writeValidValueToValidAddress(int, int)]
Replaced bitwise AND with OR → KILLED

3.3
Location : write
Killed by : com.rox.mem.MemoryBus8BitTest.[engine:jqwik]/[class:com.rox.mem.MemoryBus8BitTest]/[property:writeValidValueToValidAddress(int, int)]
Replaced bitwise AND with OR → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1