AssembledProgram.java

1
package com.rox.cpu.mos6502.assembler;
2
3
import java.util.Map;
4
5
/**
6
 * The result of assembling 6502 source: the bytes to load into memory starting at {@code startAddress},
7
 * and the resolved label -> address symbol table (useful for debugging/test assertions).
8
 */
9
public record AssembledProgram(int startAddress, int[] bytes, Map<String, Integer> labels) {
10
    public AssembledProgram {
11
        bytes = bytes.clone();
12
        labels = Map.copyOf(labels);
13
    }
14
15
    public int[] bytes() {
16
        return bytes.clone();
17
    }
18
19
    public int length() {
20 1 1. length : replaced int return with 0 for com/rox/cpu/mos6502/assembler/AssembledProgram::length → KILLED
        return bytes.length;
21
    }
22
23
    public int endAddress() {
24 2 1. endAddress : replaced int return with 0 for com/rox/cpu/mos6502/assembler/AssembledProgram::endAddress → KILLED
2. endAddress : Replaced integer addition with subtraction → KILLED
        return startAddress + bytes.length;
25
    }
26
}

Mutations

20

1.1
Location : length
Killed by : com.rox.cpu.mos6502.assembler.AssemblerTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.AssemblerTest]/[method:branchOffsetOfExactlyNegative128Succeeds()]
replaced int return with 0 for com/rox/cpu/mos6502/assembler/AssembledProgram::length → KILLED

24

1.1
Location : endAddress
Killed by : com.rox.cpu.mos6502.assembler.AssemblerTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.AssemblerTest]/[method:assembleAMoreRealisticSmallProgram()]
replaced int return with 0 for com/rox/cpu/mos6502/assembler/AssembledProgram::endAddress → KILLED

2.2
Location : endAddress
Killed by : com.rox.cpu.mos6502.assembler.AssemblerTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.AssemblerTest]/[method:assembleAMoreRealisticSmallProgram()]
Replaced integer addition with subtraction → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1