Closed
Description
Description
Missed cluster comments in part of generated tests for ArraysQuickSort with disabled Fuzzer
Visual proofs (screenshots, logs, images)
To Reproduce
- Disable fuzzer
- Generate tests for the ArraysQuickSort
- It generates the bunch of tests clustered in a few clusters
- One cluster will contain 14 tests with the missed summaries or failed totally and form one unnamed cluster
Expected behavior
Cluster comments should be generated (or normal default summaries)
Actual behavior
package com.google.common.custom;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.DisplayName;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class ArraysQuickSortTest {
///region Test suites for executable com.google.common.custom.ArraysQuickSort.runDefaultQuickSort
///region SUCCESSFUL EXECUTIONS for method runDefaultQuickSort(int)
/**
* <pre>
* Test calls ArraysQuickSort::sort,
* there it calls ArraysQuickSort::sort,
* there it iterates the loop {@code for(int i = left, j = i; i < right; j = ++i) } once,
* inside this loop, the test executes conditions:
* {@code (j-- == left): True }
* Test afterwards does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, returns from: {@code return; }
*
* Test then returns from: {@code return; }
*
* Test afterwards returns from: {@code return a; }
* </pre>
*/
@Test
@DisplayName("runDefaultQuickSort: while(ai < a[j]) -> return")
public void testRunDefaultQuickSort_PostfixDecrementJEqualsLeft() {
int[] actual = ArraysQuickSort.runDefaultQuickSort(-232);
int[] expected = {-232, -132};
assertArrayEquals(expected, actual);
}
/**
* <pre>
* Test calls ArraysQuickSort::sort,
* there it calls ArraysQuickSort::sort,
* there it iterates the loop {@code for(int i = left, j = i; i < right; j = ++i) } once.
* Test next does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, returns from: {@code return; }
*
* Test next returns from: {@code return; }
*
* Test afterwards returns from: {@code return a; }
* </pre>
*/
@Test
@DisplayName("runDefaultQuickSort: while(ai < a[j]) -> return")
public void testRunDefaultQuickSort_AiGreaterOrEqualJOfA() {
int[] actual = ArraysQuickSort.runDefaultQuickSort(2147483584);
int[] expected = {-2147483612, 2147483584};
assertArrayEquals(expected, actual);
}
///endregion
///endregion
///region Test suites for executable com.google.common.custom.ArraysQuickSort.sort
///region
@Test
public void testSort1() {
int[] intArray = {
38, Integer.MIN_VALUE, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, Integer.MIN_VALUE, 38, 38, 38,
38, 38, Integer.MIN_VALUE, 38, 38, 38, 38, 38,
1, 38, 38, 38, 38, 38, 0, 38,
38, 38, 38, 38, Integer.MIN_VALUE, 38
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 47 */
ArraysQuickSort.sort(intArray, 1, 47, null, 0, 0);
int finalIntArray24 = intArray[24];
int finalIntArray36 = intArray[36];
assertEquals(Integer.MIN_VALUE, finalIntArray24);
assertEquals(1, finalIntArray36);
}
@Test
public void testSort2() {
int[] intArray = {
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, -2147352574, 49, 49, 49, 49, 49,
49, 131072, 49, 49, 49, 49, 49, 49,
1073741825, 49, 49, 49, 49, 49, 49, 0,
49, 49, 49, 49, 49, 49, Integer.MIN_VALUE, 49
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 48 */
ArraysQuickSort.sort(intArray, 0, 48, null, 0, 0);
int finalIntArray10 = intArray[10];
int finalIntArray17 = intArray[17];
int finalIntArray24 = intArray[24];
int finalIntArray31 = intArray[31];
int finalIntArray38 = intArray[38];
assertEquals(Integer.MIN_VALUE, finalIntArray10);
assertEquals(49, finalIntArray17);
assertEquals(0, finalIntArray24);
assertEquals(131072, finalIntArray31);
assertEquals(1073741825, finalIntArray38);
}
@Test
public void testSort3() {
int[] intArray = {
522, 522, 1, 522, 522, 522, 522, 522,
522, 4194304, 522, 522, 522, 522, 522, 522,
4194304, 522, 522, 522, 522, 522, 522, 0,
522, 522, 522, 522, 522, 522, 268435456, 522,
522, 522, 522, 522, 522, 522, 522
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -8 */
ArraysQuickSort.sort(intArray, -8, 40, null, 0, 0);
int finalIntArray2 = intArray[2];
int finalIntArray9 = intArray[9];
int finalIntArray23 = intArray[23];
assertEquals(0, finalIntArray2);
assertEquals(1, finalIntArray9);
assertEquals(4194304, finalIntArray23);
}
@Test
public void testSort4() {
int[] intArray = {
-7, 512, -7, -7, -7, -7, -7, -7,
-7, 0, -7, -7, -7, -7, -7, -7,
-7, 0, -7, -7, -7, -7, -7, -7,
-7, 1207959553, -7, -7, -7, -7, -7, -7,
-7, 1073741824
};
int[] intArray1 = {
-7, -7, -7, -7, -7, -7, -7, -7,
-7, -7, -7, -7, -7, -7, -7, -7
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -14 */
ArraysQuickSort.sort(intArray, -14, 48, intArray1, 0, 0);
int finalIntArray1 = intArray[1];
int finalIntArray17 = intArray[17];
int finalIntArray25 = intArray[25];
int finalIntArray33 = intArray[33];
assertEquals(0, finalIntArray1);
assertEquals(512, finalIntArray17);
assertEquals(1073741824, finalIntArray25);
assertEquals(1207959553, finalIntArray33);
}
@Test
public void testSort5() {
int[] intArray = {
37, 0, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 1, 37, 37, 37,
37, 37, 3, 37, 37, 37, 37, 37,
0, 37, 37, 37, 37, 37, 1, 37,
37, 37, 37, 37, 1073741824
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 47 */
ArraysQuickSort.sort(intArray, 1, 47, null, 0, 0);
int finalIntArray12 = intArray[12];
int finalIntArray18 = intArray[18];
int finalIntArray24 = intArray[24];
int finalIntArray30 = intArray[30];
assertEquals(0, finalIntArray12);
assertEquals(1, finalIntArray18);
assertEquals(1, finalIntArray24);
assertEquals(3, finalIntArray30);
}
@Test
public void testSort6() {
int[] intArray = {
-2097151998, -2147483392, -2147483392, -2147483392, -2147483392, -2147483392, -2147483392, 16777217,
-2147483392, -2147483392, -2147483392, -2147483392, -2147483392, -2147483392, 1, -2147483392,
-2147483392, -2147483392, -2147483392, -2147483392, -2147483392, 469762064, -2147483392, -2147483392,
-2147483392, -2147483392, -2147483392, -2147483392, Integer.MIN_VALUE, -2147483392, -2147483392, -2147483392,
-2147483392, -2147483392, -2147483392, -2147483392, -2147483392, -2147483392
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -13 */
ArraysQuickSort.sort(intArray, -13, 41, null, 0, 0);
int finalIntArray0 = intArray[0];
int finalIntArray7 = intArray[7];
int finalIntArray21 = intArray[21];
int finalIntArray28 = intArray[28];
assertEquals(Integer.MIN_VALUE, finalIntArray0);
assertEquals(-2097151998, finalIntArray7);
assertEquals(16777217, finalIntArray21);
assertEquals(469762064, finalIntArray28);
}
@Test
public void testSort7() {
int[] intArray = {
52, 52, 52, 52, 52, 52, -1878841242, 52,
52, 52, 52, 52, 52, 134350884, 52, 52,
52, 52, 52, 52, 9248, 52, 52, 52,
52, 52, 52, 134225960, 52, 52, 52, 52,
52, 52, 0, 52, 52, 52, 52
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -6 */
ArraysQuickSort.sort(intArray, -6, 46, null, 0, 0);
int finalIntArray13 = intArray[13];
int finalIntArray34 = intArray[34];
assertEquals(0, finalIntArray13);
assertEquals(134350884, finalIntArray34);
}
@Test
public void testSort8() {
int[] intArray = {
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, Integer.MIN_VALUE, 49, 49, 49, 49, 49,
49, 1, 49, 49, 49, 49, 49, 49,
0, 49, 49, 49, 49, 49, 49, -2147479552,
49, 49, 49, 49, 49, 49, 0
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 48 */
ArraysQuickSort.sort(intArray, 0, 48, null, 0, 0);
int finalIntArray17 = intArray[17];
int finalIntArray31 = intArray[31];
int finalIntArray38 = intArray[38];
assertEquals(-2147479552, finalIntArray17);
assertEquals(0, finalIntArray31);
assertEquals(1, finalIntArray38);
}
@Test
public void testSort9() {
int[] intArray = {
57, 57, 57, 57, 768, 57, 57, 57,
57, 57, 57, 57, 256, 57, 57, 57,
57, 57, 57, 57, 1075838977, 57, 57, 57,
57, 57, 57, 57, 536870912, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -8 */
ArraysQuickSort.sort(intArray, -8, 48, null, 0, 0);
int finalIntArray4 = intArray[4];
int finalIntArray20 = intArray[20];
int finalIntArray36 = intArray[36];
assertEquals(57, finalIntArray4);
assertEquals(768, finalIntArray20);
assertEquals(1075838977, finalIntArray36);
}
@Test
public void testSort10() {
int[] intArray = {
1024, 49, 49, 49, 49, 49, 49, 49,
49, 49, 1024, 49, 49, 49, 49, 49,
49, 0, 49, 49, 49, 49, 49, 49,
1024, 49, 49, 49, 49, 49, 49, 134217729,
49, 49, 49, 49, 49, 49, 1073741824
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 48 */
ArraysQuickSort.sort(intArray, 0, 48, null, 0, 0);
int finalIntArray0 = intArray[0];
int finalIntArray9 = intArray[9];
int finalIntArray10 = intArray[10];
int finalIntArray17 = intArray[17];
int finalIntArray24 = intArray[24];
int finalIntArray28 = intArray[28];
int finalIntArray29 = intArray[29];
int finalIntArray30 = intArray[30];
assertEquals(49, finalIntArray0);
assertEquals(0, finalIntArray9);
assertEquals(49, finalIntArray10);
assertEquals(49, finalIntArray17);
assertEquals(49, finalIntArray24);
assertEquals(1024, finalIntArray28);
assertEquals(1024, finalIntArray29);
assertEquals(1024, finalIntArray30);
}
@Test
public void testSort11() {
int[] intArray = {
9, 9, 9, 0, 9, 9, 9, 9,
9, Integer.MIN_VALUE, 9, 9, 9, 9, 9, 0,
9, 9, 9, 9, 9, Integer.MIN_VALUE, 9, 9,
9, 9, 9, 1073741824, 9, 9, 9, 9,
9
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -8 */
ArraysQuickSort.sort(intArray, -8, 38, null, 0, 0);
int finalIntArray3 = intArray[3];
int finalIntArray21 = intArray[21];
assertEquals(Integer.MIN_VALUE, finalIntArray3);
assertEquals(0, finalIntArray21);
}
@Test
public void testSort12() {
int[] intArray = {
-10, -10, -10, -10, -10, -2012969674, -10, -10,
-10, -10, -10, 1409418499, -10, -10, -10, -10,
-10, 1266, -10, -10, -10, -10, -10, 1266,
-10, -10, -10, -10, -10, 134217984, -10
};
ArraysQuickSort.sort(intArray, 2147483642, -2147483608, null, 0, 0);
int finalIntArray11 = intArray[11];
int finalIntArray23 = intArray[23];
int finalIntArray29 = intArray[29];
assertEquals(1266, finalIntArray11);
assertEquals(134217984, finalIntArray23);
assertEquals(1409418499, finalIntArray29);
}
@Test
public void testSort13() {
int[] intArray = {
-7, 1, -7, -7, -7, -7, -7, -7,
-7, 1, -7, -7, -7, -7, -7, -7,
-7, 1, -7, -7, -7, -7, -7, -7,
-7, 0, -7, -7, -7, -7, -7, -7,
-7, 0, -7, -7
};
ArraysQuickSort.sort(intArray, 2147483634, -2147483600, null, 0, 0);
int finalIntArray1 = intArray[1];
int finalIntArray9 = intArray[9];
int finalIntArray25 = intArray[25];
int finalIntArray33 = intArray[33];
assertEquals(0, finalIntArray1);
assertEquals(0, finalIntArray9);
assertEquals(1, finalIntArray25);
assertEquals(1, finalIntArray33);
}
@Test
public void testSort14() {
int[] intArray = {
49, 49, 49, 0, 49, 49, 49, 49,
49, 49, Integer.MIN_VALUE, 49, 49, 49, 49, 49,
49, 8, 49, 49, 49, 49, 49, 49,
Integer.MIN_VALUE, 49, 49, 49, 49, 49, 49, 0,
49, 49, 49, 49, 49, 49, 49, 49
};
ArraysQuickSort.sort(intArray, 2147483641, -2147483607, null, 0, 0);
int finalIntArray3 = intArray[3];
int finalIntArray17 = intArray[17];
int finalIntArray24 = intArray[24];
int finalIntArray31 = intArray[31];
assertEquals(Integer.MIN_VALUE, finalIntArray3);
assertEquals(0, finalIntArray17);
assertEquals(0, finalIntArray24);
assertEquals(8, finalIntArray31);
}
///endregion
///region SUCCESSFUL EXECUTIONS for method sort(int[], int, int, int[], int, int)
/**
* <pre>
* Test does not iterate {@code for(int k = left; k < right; run[count] = k) }, {@code for(int lo = run[count] - 1, hi = k; ++lo < --hi; ) }, {@code while(++k <= right && a[k - 1] >= a[k]) }, {@code while(++k <= right && a[k - 1] <= a[k]) }, {@code while(k < right && a[k] == a[k + 1]) }, executes conditions:
* {@code (right - left < 286): False },
* {@code (count == 0): True }
* returns from: {@code return; }
* </pre>
*/
@Test
@DisplayName("sort: right - left < 286 : False -> return")
public void testSort_CountEqualsZero() {
ArraysQuickSort.sort(null, 2146957440, -2147483647, null, 0, 32);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): True },
* {@code (leftmost): True }
* returns from: {@code return; }
*
* Test then returns from: {@code return; }
* </pre>
*/
@Test
@DisplayName("sort: length < 47 : True -> return")
public void testSort_Leftmost() {
ArraysQuickSort.sort(null, 2147479568, 2147475473, null, 1, 16);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it executes conditions:
* {@code (length < 47): True },
* {@code (leftmost): True }
* iterates the loop {@code for(int i = left, j = i; i < right; j = ++i) } once.
* Test then does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, returns from: {@code return; }
*
* Test then returns from: {@code return; }
* </pre>
*/
@Test
@DisplayName("sort: while(ai < a[j]) -> return")
public void testSort_AiGreaterOrEqualJOfA() {
int[] intArray = {
1, 1, -255, -255, -255, -255, -255, -255,
-255, -255, -255
};
ArraysQuickSort.sort(intArray, 0, 1, null, -255, -255);
}
///endregion
///region ERROR SUITE for method sort(int[], int, int, int[], int, int)
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): False }
* iterates the loop {@code while(k < right && a[k] == a[k + 1]) } once.
* Test throws ArrayIndexOutOfBoundsException in: while(k < right && a[k] == a[k + 1])
* </pre>
*/
@Test
@DisplayName("sort: while(k < right && a[k] == a[k + 1]) -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException() {
int[] intArray = {1};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -1073741792 */
ArraysQuickSort.sort(intArray, -1073741792, 37, null, -255, 32);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): False }
* iterates the loop {@code while(k < right && a[k] == a[k + 1]) } once.
* Test throws NullPointerException in: while(k < right && a[k] == a[k + 1])
* </pre>
*/
@Test
@DisplayName("sort: while(k < right && a[k] == a[k + 1]) -> ThrowNullPointerException")
public void testSort_ThrowNullPointerException() {
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.NullPointerException */
ArraysQuickSort.sort(null, -128, 256, null, 64, 16);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): False }
* iterates the loop {@code while(k < right && a[k] == a[k + 1]) } twice.
* Test throws ArrayIndexOutOfBoundsException in: while(k < right && a[k] == a[k + 1])
* </pre>
*/
@Test
@DisplayName("sort: while(k < right && a[k] == a[k + 1]) -> ThrowArrayIndexOutOfBoundsException")
public void testSort_KLessThanRightAndKOfAEqualsK1OfA() {
int[] intArray = {1, 1};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 2 */
ArraysQuickSort.sort(intArray, 0, 515, null, -255, -255);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException_1() {
int[] intArray = {};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 2147483437 */
ArraysQuickSort.sort(intArray, -256, -128, null, -255, -255);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException_2() {
int[] intArray = {1, 1};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -25 */
ArraysQuickSort.sort(intArray, -64, 119, null, -255, -255);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False }
*
* Test throws NullPointerException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowNullPointerException")
public void testSort_ThrowNullPointerException_1() {
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.NullPointerException */
ArraysQuickSort.sort(null, -160, -96, null, -255, -255);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it executes conditions:
* {@code (length < 47): True },
* {@code (leftmost): True }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException_3() {
int[] intArray = {1};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -2147483643 */
ArraysQuickSort.sort(intArray, -2147483644, 129, null, -255, -255);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it executes conditions:
* {@code (length < 47): True },
* {@code (leftmost): True }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException_4() {
int[] intArray = {1};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -1 */
ArraysQuickSort.sort(intArray, -1, 0, null, -255, -255);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): False },
* {@code (a[e3] < a[e2]): False },
* {@code (a[e4] < a[e3]): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException_5() {
int[] intArray = {
-255, -255, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
-255, -255, -255, 1, -255, -255, -255, -255,
-255, 0, -255, -255, -255, -255, -255, -255,
-255, -255, 0, 0, 0, 0, 0, 0
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 45 */
ArraysQuickSort.sort(intArray, -6, 57, null, 16, 8);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): False },
* {@code (a[e3] < a[e2]): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException_6() {
int[] intArray = {
1, 1, -255, -255, -255, -255, -255, -255,
-255, -255, 1, -255, -255, -255, -255, 1,
-255, 1, -255, 1, 1, 1, 1, 1,
1, 1, 1
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 31 */
ArraysQuickSort.sort(intArray, 0, 48, null, -224, 128);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code for(int k = less - 1; ++k <= great; ) }, {@code while(a[great] == pivot2) }, {@code while(a[less] == pivot1) }, {@code for(int k = less - 1; ++k <= great; ) }, {@code while(a[--great] > pivot2) }, {@code while(a[++less] < pivot1) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): False },
* {@code (a[e3] < a[e2]): False },
* {@code (a[e4] < a[e3]): False },
* {@code (a[e5] < a[e4]): True },
* {@code (t < a[e3]): False },
* {@code (a[e1] != a[e2]): True },
* {@code (a[e2] != a[e3]): False },
* {@code (a[k] == pivot): False },
* {@code (ak < pivot): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_E2OfAEqualsE3OfA() {
int[] intArray = {
-61, -255, -255, 16, -240, -192, 16, 0,
0, 0, 0, -255, 0, 0, 0, 0,
0, -66, 0, 64, 0, -248, -255, -66,
-255, -255, -255, -255, -255, 0, -255, -255,
-255, -255, -248, -66
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 46 */
ArraysQuickSort.sort(intArray, 0, 46, null, 1, 16);
int finalIntArray29 = intArray[29];
int finalIntArray35 = intArray[35];
assertEquals(-66, finalIntArray29);
assertEquals(0, finalIntArray35);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): False },
* {@code (a[e3] < a[e2]): False },
* {@code (a[e4] < a[e3]): False },
* {@code (a[e5] < a[e4]): False },
* {@code (a[e1] != a[e2]): True },
* {@code (a[e2] != a[e3]): True },
* {@code (a[e3] != a[e4]): True },
* {@code (a[e4] != a[e5]): True }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException_7() {
int[] intArray = {
1, 1, 1, -255, -255, -255, -255, -255,
8, -255, -255, -255, -255, -255, 9, -255,
-255, -255, -255, 1, 10, 1, 1, 1,
1, 1, 11, 1, 1, 1, 1, 1,
1, 1, -255
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: -9 */
ArraysQuickSort.sort(intArray, -9, 37, null, 0, 16);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): True },
* {@code (a[e3] < a[e2]): True },
* {@code (t < a[e1]): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException_8() {
int[] intArray = {
1, 1, -245, -255, -255, -255, -255, -255,
-255, -248, -255, -255, -255, -255, -255, -255,
-248, -255, -255, 1, 1
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 23 */
ArraysQuickSort.sort(intArray, -8, 40, null, 128, 1);
int finalIntArray2 = intArray[2];
int finalIntArray16 = intArray[16];
assertEquals(-248, finalIntArray2);
assertEquals(-245, finalIntArray16);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): True },
* {@code (a[e3] < a[e2]): True },
* {@code (t < a[e1]): False },
* {@code (a[e4] < a[e3]): True },
* {@code (t < a[e2]): True },
* {@code (if (t < a[e1]) {
* a[e2] = a[e1];
* a[e1] = t;
* }): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_TGreaterOrEqualE1OfA() {
int[] intArray = {
-255, -255, 32, 128, 16, 1, 0, 64,
-128, -225, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 32, 2, 1, -130,
0, -255, -255, -255
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 30 */
ArraysQuickSort.sort(intArray, -8, 40, null, 1, 16);
int finalIntArray2 = intArray[2];
int finalIntArray9 = intArray[9];
int finalIntArray23 = intArray[23];
assertEquals(-225, finalIntArray2);
assertEquals(-130, finalIntArray9);
assertEquals(32, finalIntArray23);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): True },
* {@code (a[e3] < a[e2]): True },
* {@code (t < a[e1]): False },
* {@code (a[e4] < a[e3]): True },
* {@code (t < a[e2]): True },
* {@code (if (t < a[e1]) {
* a[e2] = a[e1];
* a[e1] = t;
* }): True }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_TLessThanE1OfA() {
int[] intArray = {
-255, -255, -240, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, -256,
0, 0, -255, -255, -255, 2, -255, -1,
-255, -255, -255, 1, -255, -255, -255, -255,
1, 1, 2, 16, 0, 0, 0, 0
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 45 */
ArraysQuickSort.sort(intArray, 10, 56, null, 16, 128);
int finalIntArray21 = intArray[21];
int finalIntArray39 = intArray[39];
assertEquals(0, finalIntArray21);
assertEquals(2, finalIntArray39);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException_9() {
int[] intArray = {
2, 64, 0, 0, 0, 0, 0, 0,
0, 0, -255, -255, -255, 1, 1, 1,
-255, -252, -248, -255, -255, -255, -255, -255,
-255, 1, -255, 1, 1, 1, 1
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 45 */
ArraysQuickSort.sort(intArray, -7, 98, null, 0, 128);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): False },
* {@code (a[e3] < a[e2]): True },
* {@code (t < a[e1]): True }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_TLessThanE1OfA_1() {
int[] intArray = {
1, 1, -255, 2, -255, -255, -255, -255,
-255, 2, -255, -255, -255, -255, -255, 1,
-255
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 21 */
ArraysQuickSort.sort(intArray, -8, 38, null, 8, -255);
int finalIntArray3 = intArray[3];
int finalIntArray15 = intArray[15];
assertEquals(1, finalIntArray3);
assertEquals(2, finalIntArray15);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): False },
* {@code (a[e3] < a[e2]): True },
* {@code (t < a[e1]): False },
* {@code (a[e4] < a[e3]): False },
* {@code (a[e5] < a[e4]): False },
* {@code (a[e1] != a[e2]): True },
* {@code (a[e2] != a[e3]): True },
* {@code (a[e3] != a[e4]): True },
* {@code (a[e4] != a[e5]): True }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_ThrowArrayIndexOutOfBoundsException_10() {
int[] intArray = {
1, 1, 0, 16, 16, 8, 0, 4,
16, 128, 64, -254, 16, 4, -255, -256,
0, 0, -255, 0, 0, -255, 64, -128,
-252, 0, 32, 64, 0, 2, 1, 1,
-248, 1, 64, 256, 0, -255, 128, 64
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 46 */
ArraysQuickSort.sort(intArray, 0, 46, null, 1, 0);
int finalIntArray17 = intArray[17];
int finalIntArray23 = intArray[23];
assertEquals(1, finalIntArray17);
assertEquals(0, finalIntArray23);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code while(last < a[--right]) }, {@code for(int k = left; ++left <= right; k = ++left) }, {@code while(a2 < a[--k]) }, {@code while(a1 < a[--k]) }, {@code for(int i = left, j = i; i < right; j = ++i) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): True },
* {@code (a[e3] < a[e2]): False },
* {@code (a[e4] < a[e3]): True },
* {@code (t < a[e2]): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_TGreaterOrEqualE2OfA() {
int[] intArray = {
-254, -255, 128, 8, -248, -128, 128, 0,
0, 0, -256, 0, 0, 0, 0, 0,
0, 0, 0, 8, 1, -255, -255, -255,
-255, -255, -255, -255, -255, -255, 0, -255,
-255, -255, 32, -128, 4, 128, 0, 0
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 40 */
ArraysQuickSort.sort(intArray, -12, 52, null, 2, 8);
int finalIntArray0 = intArray[0];
int finalIntArray10 = intArray[10];
int finalIntArray20 = intArray[20];
int finalIntArray30 = intArray[30];
assertEquals(-256, finalIntArray0);
assertEquals(-254, finalIntArray10);
assertEquals(0, finalIntArray20);
assertEquals(1, finalIntArray30);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code for(int k = less - 1; ++k <= great; ) }, {@code while(a[great] == pivot2) }, {@code while(a[less] == pivot1) }, {@code for(int k = less - 1; ++k <= great; ) }, {@code while(a[--great] > pivot2) }, {@code while(a[++less] < pivot1) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): True },
* {@code (a[e3] < a[e2]): False },
* {@code (a[e4] < a[e3]): False },
* {@code (a[e5] < a[e4]): False },
* {@code (a[e1] != a[e2]): True },
* {@code (a[e2] != a[e3]): True },
* {@code (a[e3] != a[e4]): False },
* {@code (a[k] == pivot): False },
* {@code (ak < pivot): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_E3OfAEqualsE4OfA() {
int[] intArray = {
12, 1, -255, -255, -255, -255, -255, -255,
-255, -255, 4, -255, 1, -255, -255, -255,
-255, 3, -255, 1, 1, 1, 1, 1,
8, 1, 1, 1, 1, 1, 1, 8,
1, 1, -255, -255, -255, -255, 8
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 48 */
ArraysQuickSort.sort(intArray, 0, 48, null, 4, 32);
int finalIntArray10 = intArray[10];
int finalIntArray17 = intArray[17];
assertEquals(3, finalIntArray10);
assertEquals(4, finalIntArray17);
}
/**
* <pre>
* Test executes conditions:
* {@code (right - left < 286): True }
* calls ArraysQuickSort::sort,
* there it does not iterate {@code for(int k = less - 1; ++k <= great; ) }, {@code while(a[great] == pivot2) }, {@code while(a[less] == pivot1) }, {@code for(int k = less - 1; ++k <= great; ) }, {@code while(a[--great] > pivot2) }, {@code while(a[++less] < pivot1) }, executes conditions:
* {@code (length < 47): False },
* {@code (a[e2] < a[e1]): True },
* {@code (a[e3] < a[e2]): False },
* {@code (a[e4] < a[e3]): False },
* {@code (a[e5] < a[e4]): False },
* {@code (a[e1] != a[e2]): True },
* {@code (a[e2] != a[e3]): True },
* {@code (a[e3] != a[e4]): True },
* {@code (a[e4] != a[e5]): False },
* {@code (a[k] == pivot): False },
* {@code (ak < pivot): False }
*
* Test throws ArrayIndexOutOfBoundsException in: sort(a, left, right, true);
* </pre>
*/
@Test
@DisplayName("sort: sort(a, left, right, true) : True -> ThrowArrayIndexOutOfBoundsException")
public void testSort_E4OfAEqualsE5OfA() {
int[] intArray = {
1, 1, -255, -255, -255, -255, -255, -255,
-255, -255, -252, -254, -255, -255, -255, -255,
1, -255, -255, 1, 1, 1, 4, -253,
1, 1, 4, 1, 1, 0, 1, 1,
1, 1, -255, 0
};
/* This test fails because executable under testing com.google.common.custom.ArraysQuickSort.sort
produces Runtime exception java.lang.ArrayIndexOutOfBoundsException: 46 */
ArraysQuickSort.sort(intArray, 0, 46, null, 0, 64);
int finalIntArray11 = intArray[11];
int finalIntArray17 = intArray[17];
assertEquals(-255, finalIntArray11);
assertEquals(-254, finalIntArray17);
}
///endregion
///endregion
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done