Skip to content

Commit

Permalink
Swap parameters for assertArrayEquals
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Pupier <[email protected]>
  • Loading branch information
apupier committed Apr 19, 2024
1 parent 3cf854b commit 5ff88b0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public void findMethod() throws UaException {

UInteger[] expected0 = {dataItem.getMonitoredItem().getMonitoredItemId()};
UInteger[] expected1 = {dataItem.getMonitoredItem().getClientHandle()};
assertArrayEquals(expected0, (UInteger[]) outputs[0].getValue());
assertArrayEquals(expected1, (UInteger[]) outputs[1].getValue());
assertArrayEquals((UInteger[]) outputs[0].getValue(), expected0);
assertArrayEquals((UInteger[]) outputs[1].getValue(), expected1);
}

@Test
Expand All @@ -85,8 +85,8 @@ public void callMethod() throws UaException {

UInteger[] expected0 = {dataItem.getMonitoredItem().getMonitoredItemId()};
UInteger[] expected1 = {dataItem.getMonitoredItem().getClientHandle()};
assertArrayEquals(expected0, (UInteger[]) outputs[0].getValue());
assertArrayEquals(expected1, (UInteger[]) outputs[1].getValue());
assertArrayEquals((UInteger[]) outputs[0].getValue(), expected0);
assertArrayEquals((UInteger[]) outputs[1].getValue(), expected1);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void testCopyAndModify() {
assertEquals(uint(2), copy.getKeepAliveFailuresAllowed());
assertEquals(uint(10000), copy.getKeepAliveInterval());
assertEquals(uint(15000), copy.getKeepAliveTimeout());
assertArrayEquals(copy.getSessionLocaleIds(), new String[]{"en", "es"});
assertArrayEquals(new String[]{"en", "es"}, copy.getSessionLocaleIds());
assertEquals(3.0, copy.getSubscriptionWatchdogMultiplier());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void testEnumArray() {
writer.writeEnumArray(null, array);
ApplicationType[] decoded = (ApplicationType[]) reader.readEnumArray(null, ApplicationType.class);

assertArrayEquals(decoded, array);
assertArrayEquals(array, decoded);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public void testRoundTrip(Object array) throws Exception {
Object flattened = ArrayUtil.flatten(array);
Object unflattened = ArrayUtil.unflatten(flattened, ArrayUtil.getDimensions(array));
if (array instanceof Object[]) {
assertArrayEquals((Object[]) unflattened, (Object[]) array);
assertArrayEquals((Object[]) array, (Object[]) unflattened);
} else if (array instanceof int[]){
assertArrayEquals((int[]) unflattened, (int[]) array);
assertArrayEquals((int[]) array, (int[]) unflattened);
}
}

Expand Down Expand Up @@ -65,7 +65,7 @@ public static Object[][] getDimensions() {
@ParameterizedTest
@MethodSource("getDimensions")
public void testGetDimensions(Object array, int[] dimensions) throws Exception {
assertArrayEquals(ArrayUtil.getDimensions(array), dimensions);
assertArrayEquals(dimensions, ArrayUtil.getDimensions(array));
}

public static Object[][] getTypedArrays() {
Expand Down

0 comments on commit 5ff88b0

Please sign in to comment.