LOG4J2-1412 update Unbox test for new ringbuffer size
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/5714affd Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5714affd Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5714affd Branch: refs/heads/LOG4J2-1395 Commit: 5714affda8b22caf7642dfbd2f8df6b8d036708c Parents: 80e0717 Author: rpopma <[email protected]> Authored: Mon Jun 6 22:01:52 2016 +0900 Committer: rpopma <[email protected]> Committed: Mon Jun 6 22:01:52 2016 +0900 ---------------------------------------------------------------------- .../java/org/apache/logging/log4j/util/UnboxTest.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5714affd/log4j-api/src/test/java/org/apache/logging/log4j/util/UnboxTest.java ---------------------------------------------------------------------- diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/UnboxTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/UnboxTest.java index 784fbe8..3480081 100644 --- a/log4j-api/src/test/java/org/apache/logging/log4j/util/UnboxTest.java +++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/UnboxTest.java @@ -25,8 +25,9 @@ import static org.junit.Assert.*; public class UnboxTest { @Test - public void testBoxHas16Slots() throws Exception { - final StringBuilder[] probe = new StringBuilder[16 * 3]; + public void testBoxHas32Slots() throws Exception { + final int MAX = 32; + final StringBuilder[] probe = new StringBuilder[MAX * 3]; for (int i = 0; i <= probe.length - 8; ) { probe[i++] = Unbox.box(true); probe[i++] = Unbox.box('c'); @@ -37,9 +38,9 @@ public class UnboxTest { probe[i++] = Unbox.box(Long.MAX_VALUE); probe[i++] = Unbox.box(Short.MAX_VALUE); } - for (int i = 0; i < probe.length - 16; i++) { - assertSame("probe[" + i +"], probe[" + (i + 16) +"]", probe[i], probe[i + 16]); - for (int j = 1; j < 15; j++) { + for (int i = 0; i < probe.length - MAX; i++) { + assertSame("probe[" + i +"], probe[" + (i + MAX) +"]", probe[i], probe[i + MAX]); + for (int j = 1; j < MAX - 1; j++) { assertNotSame("probe[" + i +"], probe[" + (i + j) +"]", probe[i], probe[i + j]); } }
