Skip to content

Commit 9bb0ea3

Browse files
committed
feat(test):fix the coverage change of org.tron.core.capsule.utils.FastByteComparisons
1 parent 09573b7 commit 9bb0ea3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

framework/src/test/java/org/tron/core/tire/TrieTest.java

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.bouncycastle.util.Arrays;
2727
import org.junit.Assert;
2828
import org.junit.Test;
29+
import org.tron.core.capsule.utils.FastByteComparisons;
2930
import org.tron.core.capsule.utils.RLP;
3031
import org.tron.core.trie.TrieImpl;
3132
import org.tron.core.trie.TrieImpl.Node;
@@ -151,4 +152,11 @@ private void assertFalse(byte[] key1, byte[] key2, TrieImpl trieCopy) {
151152
Assert.assertFalse(trieCopy.verifyProof(trieCopy.getRootHash(), key2, trieCopy.prove(key1)));
152153
}
153154

155+
@Test
156+
public void testFastByteComparisons() {
157+
byte[] test1 = new byte[] {0x00, 0x00, 0x01, 0x02, 0x03, 0x04};
158+
byte[] test2 = new byte[] {0x00, 0x01, 0x02, 0x03, 0x04};
159+
Assert.assertEquals(0, FastByteComparisons.compareTo(test1, 1, 5, test2, 0, 5));
160+
}
161+
154162
}

0 commit comments

Comments
 (0)