當前位置: 首頁>>代碼示例>>Java>>正文


Java Assertions.assertArrayEquals方法代碼示例

本文整理匯總了Java中org.junit.jupiter.api.Assertions.assertArrayEquals方法的典型用法代碼示例。如果您正苦於以下問題:Java Assertions.assertArrayEquals方法的具體用法?Java Assertions.assertArrayEquals怎麽用?Java Assertions.assertArrayEquals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.junit.jupiter.api.Assertions的用法示例。


在下文中一共展示了Assertions.assertArrayEquals方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: verifyCompression

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
void verifyCompression(long[] input, int expectedAmount) {
    long[] compressed = new long[input.length];
    long[] uncompressed = new long[input.length];

    int amount = Simple8.compress(input, compressed);
    if(expectedAmount > 0) {
        assertEquals(expectedAmount, amount);
    }

    Simple8.decompress(compressed, 0, amount, uncompressed, 0);
    Assertions.assertArrayEquals(input, uncompressed);

    Arrays.fill(compressed, 0);
    Arrays.fill(uncompressed, 0);

    amount = Simple8RLE.compress(input, compressed);
    if(expectedAmount > 0) {
        assertEquals(expectedAmount, amount);
    }

    Simple8RLE.decompress(compressed, 0, amount, uncompressed, 0);
    Assertions.assertArrayEquals(input, uncompressed);
}
 
開發者ID:burmanm,項目名稱:compression-int,代碼行數:24,代碼來源:Simple8EncodeTest.java

示例2: assertEncodeDecodeEquals

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
private void assertEncodeDecodeEquals(ChunkClusterTranscoder transcoder, ChunkCluster chunkCluster)
{
	byte[] encoded = transcoder.encode(chunkCluster);
	ChunkCluster decoded = transcoder.decode(encoded);
	assertEqualsChunkCluster(chunkCluster, decoded);

	byte[] encodedAgain = transcoder.encode(decoded);
	Assertions.assertArrayEquals(encoded, encodedAgain, "encodedAgain not equal to first encoded");
}
 
開發者ID:domisum,項目名稱:ExZiff,代碼行數:10,代碼來源:ChunkClusterTranscoderTest.java

示例3: nenc

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void nenc() throws IOException {
    byte[] encoded = SphinxClient.Nenc(8);
    Assertions.assertArrayEquals(
            encoded,
            new byte[]{(byte) 0x92, (byte) 0xc4, 0x01, (byte) 0xf0, 0x08});
}
 
開發者ID:cheahjs,項目名稱:JLoopix,代碼行數:8,代碼來源:SphinxClientTest.java

示例4: testClassArrayMethodInvoke

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void testClassArrayMethodInvoke() throws Exception {
    ClassWrapper<TestClassFour> cw = Reflect.wrapClass(TestClassFour.class);
    Double[] expected = new Double[]{-1D, -1D, -1D};
    Double[] actual = cw.invokeMethod("get2", Double[].class);
    Assertions.assertArrayEquals(expected, actual);
}
 
開發者ID:mikroskeem,項目名稱:Shuriken,代碼行數:8,代碼來源:MethodReflectionTester.java

示例5: testClassPrimitiveArrayMethodInvoke

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void testClassPrimitiveArrayMethodInvoke() throws Exception {
    ClassWrapper<TestClassFour> cw = Reflect.wrapClass(TestClassFour.class);
    double[] expected = new double[]{-1, -1, -1};
    double[] actual = cw.invokeMethod("get", double[].class);
    Assertions.assertArrayEquals(expected, actual);
}
 
開發者ID:mikroskeem,項目名稱:Shuriken,代碼行數:8,代碼來源:MethodReflectionTester.java

示例6: testArrayMethodReflector

import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void testArrayMethodReflector() {
    ClassWrapper<TestClass5> tc = wrapClass(TestClass5.class).construct();
    MethodReflector<TestClass5Reflector> reflector = newInstance(tc, TestClass5Reflector.class);

    TestClass5Reflector reflectorImpl = reflector.getReflector();
    byte[] EXPECTED = new byte[] { 0, 1, 0, 1, 1 };
    Assertions.assertArrayEquals(EXPECTED, reflectorImpl.a());
}
 
開發者ID:mikroskeem,項目名稱:Shuriken,代碼行數:10,代碼來源:MethodReflectorTester.java


注:本文中的org.junit.jupiter.api.Assertions.assertArrayEquals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。