Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void testClearModifications() {

/** Test addModification with null. */
@Test
void testAddModificationWithNull() {
static void testAddModificationWithNull() {
ModifiableInteger integer = new ModifiableInteger();
integer.setOriginalValue(100);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public VariableModification<byte[]> createCopy() {
}

@Test
void testModifyWithNonNullInput() {
static void testModifyWithNonNullInput() {
VariableModification<String> modification = new TestModification();
String input = "test";
String result = modification.modify(input);
Expand All @@ -134,15 +134,15 @@ void testModifyWithNonNullInput() {
}

@Test
void testModifyWithNullInput() {
static void testModifyWithNullInput() {
VariableModification<String> modification = new TestModification();
String result = modification.modify(null);

assertNull(result);
}

@Test
void testModifyReturningNull() {
static void testModifyReturningNull() {
VariableModification<String> modification = new NullReturningModification();
String result = modification.modify("any input");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void testSetSummandWithNull() {

/** Test that constructor throws NullPointerException if given null */
@Test
void testConstructorWithNull() {
static void testConstructorWithNull() {
assertThrows(
NullPointerException.class, () -> new BigIntegerAddModification((BigInteger) null));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void testToString() {

/** Test constructor with null value */
@Test
void testConstructorWithNullValue() {
static void testConstructorWithNullValue() {
// Using try-catch because we expect an exception
try {
// Explicitly specify null as BigInteger to avoid ambiguity with copy constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void testToString() {

/** Test constructor with null value */
@Test
void testConstructorWithNullValue() {
static void testConstructorWithNullValue() {
// Using try-catch because we expect an exception
try {
// Explicitly specify null as BigInteger to avoid ambiguity with copy constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void testToString() {

/** Test constructor with null value */
@Test
void testConstructorWithNullValue() {
static void testConstructorWithNullValue() {
// Using try-catch because we expect an exception
try {
// Explicitly specify null as BigInteger to avoid ambiguity with copy constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void testEqualsWithDifferentModificationTypes() {

/** Test equals method with null values */
@Test
void testEqualsWithNullValues() {
static void testEqualsWithNullValues() {
// Equal objects with null values
ModifiableBigInteger nullInteger1 = new ModifiableBigInteger();
ModifiableBigInteger nullInteger2 = new ModifiableBigInteger();
Expand Down Expand Up @@ -364,7 +364,7 @@ void testEqualsWithChainedModifications() {

/** Test equals method with modified null and non-null original values */
@Test
void testEqualsWithMixedNullOriginalValues() {
static void testEqualsWithMixedNullOriginalValues() {
// Initialize with different original values (one null, one non-null)
ModifiableBigInteger nullOriginal = new ModifiableBigInteger();
ModifiableBigInteger nonNullOriginal = new ModifiableBigInteger(BigInteger.valueOf(5));
Expand Down Expand Up @@ -458,7 +458,7 @@ void testHashCodeWithExplicitValues() {

/** Test hashCode method with null value */
@Test
void testHashCodeWithNull() {
static void testHashCodeWithNull() {
// Null value handling
ModifiableBigInteger nullInteger = new ModifiableBigInteger();
int hashCode = nullInteger.hashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void testIsOriginalValueModifiedTrue() {

/** Test of isOriginalValueModified method with null original value */
@Test
void testIsOriginalValueModifiedNull() {
static void testIsOriginalValueModifiedNull() {
ModifiableBoolean nullBoolean = new ModifiableBoolean();
assertThrows(IllegalStateException.class, nullBoolean::isOriginalValueModified);
}
Expand Down Expand Up @@ -199,7 +199,7 @@ void testEqualsModifiedValues() {

/** Test equals with both null values */
@Test
void testEqualsWithNullValues() {
static void testEqualsWithNullValues() {
ModifiableBoolean nullBool1 = new ModifiableBoolean();
ModifiableBoolean nullBool2 = new ModifiableBoolean();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ void testSetBytesToAppend() {

/** Test setBytesToAppend with null value */
@Test
void testSetBytesToAppendNull() {
static void testSetBytesToAppendNull() {
ByteArrayAppendValueModification mod =
new ByteArrayAppendValueModification(new byte[] {0x01, 0x02});
assertThrows(NullPointerException.class, () -> mod.setBytesToAppend(null));
}

/** Test constructor with null value */
@Test
void testConstructorNull() {
static void testConstructorNull() {
assertThrows(
NullPointerException.class,
() -> new ByteArrayAppendValueModification((byte[]) null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void testModifyImplementationHookCountBeyondLength() {

/** Test of modifyImplementationHook method with null input */
@Test
void testModifyImplementationHookNullInput() {
static void testModifyImplementationHookNullInput() {
ByteArrayDeleteModification mod = new ByteArrayDeleteModification(0, 1);
assertNull(mod.modifyImplementationHook(null));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ void testSetExplicitValue() {

/** Test setExplicitValue with null value */
@Test
void testSetExplicitValueNull() {
static void testSetExplicitValueNull() {
ByteArrayExplicitValueModification mod =
new ByteArrayExplicitValueModification(new byte[] {0x01, 0x02});
assertThrows(NullPointerException.class, () -> mod.setExplicitValue(null));
}

/** Test constructor with null value */
@Test
void testConstructorNull() {
static void testConstructorNull() {
assertThrows(
NullPointerException.class,
() -> new ByteArrayExplicitValueModification((byte[]) null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ void testSetStartPosition() {

/** Test setBytesToInsert with null value */
@Test
void testSetBytesToInsertNull() {
static void testSetBytesToInsertNull() {
ByteArrayInsertValueModification mod =
new ByteArrayInsertValueModification(new byte[] {0x01, 0x02}, 1);
assertThrows(NullPointerException.class, () -> mod.setBytesToInsert(null));
}

/** Test constructor with null value */
@Test
void testConstructorNull() {
static void testConstructorNull() {
assertThrows(
NullPointerException.class,
() -> new ByteArrayInsertValueModification((byte[]) null, 1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ void testSetBytesToPrepend() {

/** Test setBytesToPrepend with null value */
@Test
void testSetBytesToPrependNull() {
static void testSetBytesToPrependNull() {
ByteArrayPrependValueModification mod =
new ByteArrayPrependValueModification(new byte[] {0x01, 0x02});
assertThrows(NullPointerException.class, () -> mod.setBytesToPrepend(null));
}

/** Test constructor with null value */
@Test
void testConstructorNull() {
static void testConstructorNull() {
assertThrows(
NullPointerException.class,
() -> new ByteArrayPrependValueModification((byte[]) null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void setUp() {
integer1.setOriginalValue(2);
integer2 = new ModifiableInteger();
integer2.setOriginalValue(2);
nullInteger = new ModifiableInteger();
this.nullInteger = new ModifiableInteger();
}

/** Test of default constructor, of class ModifiableInteger. */
Expand Down Expand Up @@ -76,7 +76,7 @@ void testCreateCopy() {
void testGetAssertEquals() {
integer1.setAssertEquals(2);
assertEquals(2, integer1.getAssertEquals());
assertNull(nullInteger.getAssertEquals());
assertNull(this.nullInteger.getAssertEquals());
}

/** Test of setAssertEquals method, of class ModifiableInteger. */
Expand Down Expand Up @@ -109,7 +109,7 @@ void testGetByteArray() {
void testValidateAssertions() {
// No assertions set - should be valid
assertTrue(integer1.validateAssertions());
assertTrue(nullInteger.validateAssertions());
assertTrue(this.nullInteger.validateAssertions());

// Set matching assertion
integer1.setAssertEquals(2);
Expand Down Expand Up @@ -148,7 +148,7 @@ void testIsOriginalValueModified() {
org.junit.jupiter.api.Assertions.assertThrows(
IllegalStateException.class,
() -> {
nullInteger.isOriginalValueModified();
this.nullInteger.isOriginalValueModified();
});

ModifiableInteger nullIntWithExplicit = new ModifiableInteger((Integer) null);
Expand All @@ -165,7 +165,7 @@ void testIsOriginalValueModified() {
@Test
void testGetOriginalValue() {
assertEquals(2, integer1.getOriginalValue());
assertNull(nullInteger.getOriginalValue());
assertNull(this.nullInteger.getOriginalValue());
}

/** Test of setOriginalValue method, of class ModifiableInteger. */
Expand All @@ -188,7 +188,7 @@ void testToString() {
integer1.setOriginalValue(4);
assertNotEquals(integer1.toString(), integer2.toString());

String nullString = nullInteger.toString();
String nullString = this.nullInteger.toString();
assertTrue(nullString.contains("originalValue=null"));

// Test with modification
Expand Down Expand Up @@ -250,7 +250,7 @@ void testHashCode() {
assertEquals(hash1, hash2);

// Test with null value
int nullHash = nullInteger.hashCode();
int nullHash = this.nullInteger.hashCode();
assertEquals(527, nullHash); // Expected value: 17 * 31 + 0 = 527
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void testMultiplyWithZero() {
}

@Test
void testMultiplyWithNull() {
static void testMultiplyWithNull() {
ModifiableLong nullStart = new ModifiableLong();
VariableModification<Long> modifier = new LongMultiplyModification(5L);
nullStart.setModifications(modifier);
Expand Down Expand Up @@ -127,7 +127,7 @@ void testShiftLeftWithLargeShift() {
}

@Test
void testShiftLeftWithNull() {
static void testShiftLeftWithNull() {
ModifiableLong nullStart = new ModifiableLong();
VariableModification<Long> modifier = new LongShiftLeftModification(2);
nullStart.setModifications(modifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void testEqualsCopyConstructor() {
}

@Test
void testEqualsWithNull() {
static void testEqualsWithNull() {
// Explicitly test the null case in equals
LongSubtractModification mod = new LongSubtractModification(42L);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void testHashCode() {
// Test with null value
ModifiableByte nullByte = new ModifiableByte();
// The actual hashCode implementation varies by JVM and implementation
int nullByteHash = nullByte.hashCode();
nullByte.hashCode();
}

/** Test of copy constructor and createCopy method. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void testAssertions() {

/** Test assertions with null values */
@Test
void testAssertionsWithNull() {
static void testAssertionsWithNull() {
// When original value is null and no assertion is set
ModifiableString nullString = new ModifiableString();
assertTrue(nullString.validateAssertions());
Expand All @@ -161,7 +161,7 @@ void testGetByteArray() {

/** Test getByteArray with null value */
@Test
void testGetByteArrayWithNull() {
static void testGetByteArrayWithNull() {
ModifiableString nullString = new ModifiableString();
assertThrows(NullPointerException.class, () -> nullString.getByteArray());
}
Expand Down Expand Up @@ -234,7 +234,7 @@ void testEqualsWithDifferentModificationTypes() {

/** Test equals method with null values */
@Test
void testEqualsWithNullValues() {
static void testEqualsWithNullValues() {
// Equal objects with null values
ModifiableString nullString1 = new ModifiableString();
ModifiableString nullString2 = new ModifiableString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void testAppendToNullString() {

/** Test that null append value is not allowed */
@Test
void testNullAppendValue() {
static void testNullAppendValue() {
assertThrows(
NullPointerException.class,
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void testDeleteFromEmptyString() {

/** Test with null input */
@Test
void testDeleteFromNullString() {
static void testDeleteFromNullString() {
ModifiableString nullString = new ModifiableString();
nullString.setOriginalValue(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void testExplicitValueOnNullString() {

/** Test that null explicit value is not allowed */
@Test
void testNullExplicitValue() {
static void testNullExplicitValue() {
assertThrows(
NullPointerException.class,
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void testInsertIntoNullString() {

/** Test that null insert value is not allowed */
@Test
void testNullInsertValue() {
static void testNullInsertValue() {
assertThrows(
NullPointerException.class,
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void testPrependToNullString() {

/** Test that null prepend value is not allowed */
@Test
void testNullPrependValue() {
static void testNullPrependValue() {
assertThrows(
NullPointerException.class,
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void testEqualsWithSameInstance() {
}

@Test
void testEqualsWithNull() {
static void testEqualsWithNull() {
byte[] array = new byte[] {1, 2, 3, 4, 5};
ComparableByteArray comparable = new ComparableByteArray(array);

Expand Down
Loading