You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/05/05 18:10:58 UTC
[commons-compress] 02/06: Format.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
commit 38877c9cb2502e5446a068569590332715552184
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu May 5 14:07:16 2022 -0400
Format.
---
.../compress/archivers/cpio/CpioUtilTest.java | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java b/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java
index 1147f22c..ad25e8b6 100644
--- a/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java
@@ -28,50 +28,38 @@ public class CpioUtilTest {
@Test
public void oldBinMagic2ByteArrayNotSwapped() {
- assertArrayEquals(new byte[] { (byte) 0xc7, 0x71 },
- CpioUtil.long2byteArray(CpioConstants.MAGIC_OLD_BINARY,
- 2, false));
+ assertArrayEquals(new byte[] {(byte) 0xc7, 0x71}, CpioUtil.long2byteArray(CpioConstants.MAGIC_OLD_BINARY, 2, false));
}
@Test
public void oldBinMagic2ByteArraySwapped() {
- assertArrayEquals(new byte[] { 0x71, (byte) 0xc7, },
- CpioUtil.long2byteArray(CpioConstants.MAGIC_OLD_BINARY,
- 2, true));
+ assertArrayEquals(new byte[] {0x71, (byte) 0xc7,}, CpioUtil.long2byteArray(CpioConstants.MAGIC_OLD_BINARY, 2, true));
}
@Test
public void oldBinMagicFromByteArrayNotSwapped() {
- assertEquals(CpioConstants.MAGIC_OLD_BINARY,
- CpioUtil.byteArray2long(new byte[] { (byte) 0xc7, 0x71 },
- false));
+ assertEquals(CpioConstants.MAGIC_OLD_BINARY, CpioUtil.byteArray2long(new byte[] {(byte) 0xc7, 0x71}, false));
}
@Test
public void oldBinMagicFromByteArraySwapped() {
- assertEquals(CpioConstants.MAGIC_OLD_BINARY,
- CpioUtil.byteArray2long(new byte[] { 0x71, (byte) 0xc7 },
- true));
+ assertEquals(CpioConstants.MAGIC_OLD_BINARY, CpioUtil.byteArray2long(new byte[] {0x71, (byte) 0xc7}, true));
}
-
@Test
public void testLong2byteArrayWithZeroThrowsUnsupportedOperationException() {
assertThrows(UnsupportedOperationException.class, () -> CpioUtil.long2byteArray(0L, 0, false));
}
-
@Test
public void testLong2byteArrayWithPositiveThrowsUnsupportedOperationException() {
assertThrows(UnsupportedOperationException.class, () -> CpioUtil.long2byteArray(0L, 1021, false));
}
-
@Test
public void testByteArray2longThrowsUnsupportedOperationException() {
assertThrows(UnsupportedOperationException.class, () -> CpioUtil.byteArray2long(new byte[1], true));
}
-
-}
\ No newline at end of file
+}