/** * Returns the index to the first instruction on which this mutation occurs. * This index is specific to how ASM represents the bytecode. * * @return the zero based index to the instruction */ public int getFirstIndex() { return this.id.getFirstIndex(); }
/** * Returns true if this mutation has a matching identifier * * @param id * the MutationIdentifier to match * @return true if the MutationIdentifier matches otherwise false */ public boolean matches(final MutationIdentifier id) { return this.location.equals(id.location) && this.mutator.equals(id.mutator) && this.indexes.contains(id.getFirstIndex()); }
@Test public void shouldScopeMutationIndexesByInstructionCounter() { createTesteeWith(Mutator.byName("RETURN_VALS")); final List<MutationDetails> actualDetails = findMutationsFor(HasTwoMutableMethods.class); assertEquals(2, actualDetails.size()); assertEquals(4, actualDetails.get(0).getId().getFirstIndex()); assertEquals(15, actualDetails.get(1).getId().getFirstIndex()); // differs // by // target? }
/** * Returns the index to the first instruction on which this mutation occurs. * This index is specific to how ASM represents the bytecode. * * @return the zero based index to the instruction */ public int getFirstIndex() { return this.id.getFirstIndex(); }
/** * Returns true if this mutation has a matching identifier * * @param id * the MutationIdentifier to match * @return true if the MutationIdentifier matches otherwise false */ public boolean matches(final MutationIdentifier id) { return this.location.equals(id.location) && this.mutator.equals(id.mutator) && this.indexes.contains(id.getFirstIndex()); }