Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exec function TestSorting()
- {
- local array<int> TestArray;
- local int i, j, last;
- local bool escaped;
- j = 0;
- escaped = false;
- while (!escaped)
- {
- TestArray.Length = 0;
- for (i = 0; i < j; i++)
- {
- TestArray.AddItem(i);
- }
- TestArray.Sort(SortDesc);
- // validate that the array is descending now
- last = MaxInt;
- for (i = 0; i < TestArray.Length && !escaped; i++)
- {
- escaped = escaped || TestArray[i] > last;
- last = TestArray[i];
- }
- j++;
- }
- `log("It all went bad at length" @ j);
- }
- function int SortDesc(int A, int B)
- {
- `log("A:" @ A $ ", B:" @ B);
- return A - B;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement