diff options
author | Alexander Kurtakov | 2014-01-13 13:51:08 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2014-01-13 13:51:08 +0000 |
commit | 6d1773a3a9771263ff81f0263e12eee082bb7a2f (patch) | |
tree | 2090833cd34b104abac37a2ee820c9dec81a508e /tests | |
parent | d3553c533461a8253fca0af1fda8bb9189ab1260 (diff) | |
download | eclipse.platform.swt-6d1773a3a9771263ff81f0263e12eee082bb7a2f.tar.gz eclipse.platform.swt-6d1773a3a9771263ff81f0263e12eee082bb7a2f.tar.xz eclipse.platform.swt-6d1773a3a9771263ff81f0263e12eee082bb7a2f.zip |
Bug 425544 - Phase out SwtTestCase.
Remove SwtTestCase.assertSame(int[], int[]). It's the same as
assertArrayEquals(int[], int[]) from JUnit itself.
Change-Id: I1895413a38e495ad17734a6415ba5031d06af200
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'tests')
3 files changed, 88 insertions, 116 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java index 711f4d8acc..e732b3a3a1 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestCase.java @@ -98,35 +98,7 @@ static public void assertSame(String message, Object expected[], Object actual[] static public void assertSame(Object expected[], Object actual[]) { assertSame(null, expected, actual); } -static public void assertSame(String message, int expected[], int actual[]) { - if (expected == null && actual == null) return; - boolean same = false; - if (expected != null && actual != null && expected.length == actual.length) { - if (expected.length == 0) return; - same = true; - boolean[] matched = new boolean[expected.length]; - for (int i = 0; i < actual.length; i++) { - boolean match = false; - for (int j = 0; j < expected.length; j++) { - if (!matched[j] && actual[i] == expected[j]) { - match = true; - matched[j] = true; - break; - } - } - if (!match) { - same = false; - break; - } - } - } - if (!same) { - failNotEquals(message, expected, actual); - } -} -static public void assertSame(int expected[], int actual[]) { - assertSame(null, expected, actual); -} + static public void assertEquals(String message, int expectedCode, Throwable actualThrowable) { if (actualThrowable instanceof SWTError) { SWTError error = (SWTError) actualThrowable; diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java index 4141286985..e8771095c1 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java @@ -235,7 +235,7 @@ public void test_deselect$I() { assertEquals(list.isSelected(0), false); assertTrue(list.isSelected(1)); list.deselect(new int[] { 2, 0, 0 }); - assertSame(list.getSelectionIndices(), new int[] { 1, 3 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 1, 3 }); /* assert(":d:", !list.isSelected(0)); assert(":dd:", !list.isSelected(2)); assert(":ddd:", list.isSelected(1)); @@ -353,9 +353,9 @@ public void test_deselectII() { list.setSelection(items2); assertSame(":a:", items2, list.getSelection()); list.deselect(0, 0); - assertSame(":b:", list.getSelectionIndices(), new int[] { 1, 2, 3 }); + assertArrayEquals(":b:", list.getSelectionIndices(), new int[] { 1, 2, 3 }); list.deselect(0, 0); - assertSame(":bbb:", list.getSelectionIndices(), new int[] { 1, 2, 3 }); + assertArrayEquals(":bbb:", list.getSelectionIndices(), new int[] { 1, 2, 3 }); list.deselect(2, 3); assertArrayEquals(":bb:", list.getSelectionIndices(), new int[] { 1 }); @@ -365,7 +365,7 @@ public void test_deselectII() { list.setSelection(items2); list.deselect(2, 0); - assertSame( + assertArrayEquals( ":ddddd:", list.getSelectionIndices(), new int[] { 0, 1, 2, 3 }); @@ -652,34 +652,34 @@ public void test_getSelectionIndices() { list.setSelection(items); int[] sel = { 0, 1, 2 }; - assertSame(sel, list.getSelectionIndices()); + assertArrayEquals(sel, list.getSelectionIndices()); list.setSelection(sel); - assertSame(sel, list.getSelectionIndices()); + assertArrayEquals(sel, list.getSelectionIndices()); sel = new int[] { 0 }; list.setSelection(sel); - assertSame(sel, list.getSelectionIndices()); + assertArrayEquals(sel, list.getSelectionIndices()); sel = new int[] { 1 }; list.setSelection(sel); - assertSame(sel, list.getSelectionIndices()); + assertArrayEquals(sel, list.getSelectionIndices()); sel = new int[] { 2 }; list.setSelection(sel); - assertSame(sel, list.getSelectionIndices()); + assertArrayEquals(sel, list.getSelectionIndices()); sel = new int[] { 3 }; list.setSelection(sel); - assertSame(new int[] {}, list.getSelectionIndices()); + assertArrayEquals(new int[] {}, list.getSelectionIndices()); sel = new int[] { -1, 0, 1, 2, 3 }; list.setSelection(sel); - assertSame(new int[] { 0, 1, 2 }, list.getSelectionIndices()); + assertArrayEquals(new int[] { 0, 1, 2 }, list.getSelectionIndices()); sel = new int[] { 1, 1, 2, 2 }; list.setSelection(sel); - assertSame(new int[] { 1, 2 }, list.getSelectionIndices()); + assertArrayEquals(new int[] { 1, 2 }, list.getSelectionIndices()); setSingleList(); @@ -688,19 +688,19 @@ public void test_getSelectionIndices() { sel = new int[] { 0 }; list.setSelection(sel); - assertSame(sel, list.getSelectionIndices()); + assertArrayEquals(sel, list.getSelectionIndices()); sel = new int[] { 1 }; list.setSelection(sel); - assertSame(sel, list.getSelectionIndices()); + assertArrayEquals(sel, list.getSelectionIndices()); sel = new int[] { 2 }; list.setSelection(sel); - assertSame(sel, list.getSelectionIndices()); + assertArrayEquals(sel, list.getSelectionIndices()); sel = new int[] { 3 }; list.setSelection(sel); - assertSame(new int[] {}, list.getSelectionIndices()); + assertArrayEquals(new int[] {}, list.getSelectionIndices()); } public void test_getTopIndex() { @@ -1242,30 +1242,30 @@ public void test_select$I() { list.setItems(items); list.select(new int[] { 0, 2 }); - assertSame(list.getSelectionIndices(), new int[] { 0, 2 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 0, 2 }); list.select(new int[] { 1, 3 }); - assertSame(list.getSelectionIndices(), new int[] { 0, 1, 2, 3 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 0, 1, 2, 3 }); list.select(new int[] { 1, 3 }); - assertSame(list.getSelectionIndices(), new int[] { 0, 1, 2, 3 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 0, 1, 2, 3 }); list.select(new int[] { 1 }); - assertSame(list.getSelectionIndices(), new int[] { 0, 1, 2, 3 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 0, 1, 2, 3 }); list.add("item4"); list.select(new int[] { -1, 0, 1, 2, 3 }); - assertSame(list.getSelectionIndices(), new int[] { 0, 1, 2, 3 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 0, 1, 2, 3 }); list.deselectAll(); list.select(new int[] { 1, 2, 3 }); - assertSame(list.getSelectionIndices(), new int[] { 1, 2, 3 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 1, 2, 3 }); int[] ind = new int[32]; for (int i = 0; i < ind.length; i++) ind[i] = i; list.select(ind); - assertSame(list.getSelectionIndices(), new int[] { 0, 1, 2, 3, 4 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 0, 1, 2, 3, 4 }); list.setSelection(new int[] {}); list.select(new int[] { 1 }); @@ -1357,15 +1357,15 @@ public void test_selectI() { assertArrayEquals("select(2):", list.getSelectionIndices(), new int[] { 2 }); list.select(1); - assertSame("select(1):", list.getSelectionIndices(), new int[] { 1, 2 }); + assertArrayEquals("select(1):", list.getSelectionIndices(), new int[] { 1, 2 }); list.select(3); - assertSame( + assertArrayEquals( "select(3):", list.getSelectionIndices(), new int[] { 1, 2, 3 }); list.select(5); - assertSame( + assertArrayEquals( "select(5):", list.getSelectionIndices(), new int[] { 1, 2, 3 }); @@ -1459,16 +1459,16 @@ public void test_selectII() { list.deselectAll(); list.select(1, 2); - assertSame(list.getSelectionIndices(), new int[] { 1, 2 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 1, 2 }); list.select(1, 3); - assertSame(list.getSelectionIndices(), new int[] { 1, 2, 3 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 1, 2, 3 }); list.select(2, 2); - assertSame(list.getSelectionIndices(), new int[] { 1, 2, 3 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 1, 2, 3 }); list.select(3, 5); - assertSame(list.getSelectionIndices(), new int[] { 1, 2, 3, 4 }); + assertArrayEquals(list.getSelectionIndices(), new int[] { 1, 2, 3, 4 }); setSingleList(); @@ -1710,10 +1710,10 @@ public void test_setSelection$I() { assertArrayEquals("MULTI: setSelection(new int [] {number})", list.getSelectionIndices(), new int[0]); list.setSelection(new int [] {3, 1, 5, 2}); - assertSame("MULTI: setSelection(new int [] {3, 1, 5, 2})", list.getSelectionIndices(), new int[] {1, 2, 3, 5}); + assertArrayEquals("MULTI: setSelection(new int [] {3, 1, 5, 2})", list.getSelectionIndices(), new int[] {1, 2, 3, 5}); list.setSelection(new int [] {1, 0}); - assertSame("MULTI: setSelection(new int [] {1, 0})", list.getSelectionIndices(), new int[] {0, 1}); + assertArrayEquals("MULTI: setSelection(new int [] {1, 0})", list.getSelectionIndices(), new int[] {0, 1}); list.setSelection(new int [] {-1, number}); assertArrayEquals("MULTI: setSelection(new int [] {-1, number})", list.getSelectionIndices(), new int[0]); @@ -1726,14 +1726,14 @@ public void test_setSelection$I() { assertArrayEquals("MULTI: setSelection(new int [] {-1, 0})", list.getSelectionIndices(), new int[] {0}); list.setSelection(new int [] {0, 1, 2, 3, 5}); - assertSame("MULTI: setSelection(new int [] {0, 1, 2, 3, 5})", list.getSelectionIndices(), new int [] {0, 1, 2, 3, 5}); + assertArrayEquals("MULTI: setSelection(new int [] {0, 1, 2, 3, 5})", list.getSelectionIndices(), new int [] {0, 1, 2, 3, 5}); int[] indices = new int [number]; for (int i = 0; i < number; i++) { indices[i] = i; } list.setSelection(indices); - assertSame("MULTI: setSelection(indices)", indices, list.getSelectionIndices()); + assertArrayEquals("MULTI: setSelection(indices)", indices, list.getSelectionIndices()); list.setSelection(new int [] {number, number}); assertArrayEquals("MULTI: setSelection(new int [] {number, number})", new int[0], list.getSelectionIndices()); @@ -1743,10 +1743,10 @@ public void test_setSelection$I() { assertEquals("MULTI: setSelection(new int [] {number - 1, number - 1}) getFocusIndex()", list.getFocusIndex(), number - 1); list.setSelection(new int [] {0, number, 1}); - assertSame("MULTI: setSelection(new int [] {0, number, 1})", list.getSelectionIndices(), new int[] {0, 1}); + assertArrayEquals("MULTI: setSelection(new int [] {0, number, 1})", list.getSelectionIndices(), new int[] {0, 1}); list.setSelection(new int [] {number - 1, 0, number - 2}); - assertSame("MULTI: setSelection(new int [] {number - 1, 0, number - 2})", list.getSelectionIndices(), new int[] {0, number - 2, number - 1}); + assertArrayEquals("MULTI: setSelection(new int [] {number - 1, 0, number - 2})", list.getSelectionIndices(), new int[] {0, number - 2, number - 1}); list.removeAll(); @@ -2098,19 +2098,19 @@ public void test_setSelectionII() { list.setItems(items); list.setSelection(1, 2); - assertSame(list.getSelectionIndices(), new int[] {1, 2}); + assertArrayEquals(list.getSelectionIndices(), new int[] {1, 2}); list.setSelection(-3, -2); assertArrayEquals(list.getSelectionIndices(), new int[0]); list.setSelection(0, 1); - assertSame(list.getSelectionIndices(), new int[] {0, 1}); + assertArrayEquals(list.getSelectionIndices(), new int[] {0, 1}); list.setSelection(-2, -1); assertArrayEquals(list.getSelectionIndices(), new int[0]); list.setSelection(number - 2, number - 1); - assertSame(list.getSelectionIndices(), new int[] {number - 2, number - 1}); + assertArrayEquals(list.getSelectionIndices(), new int[] {number - 2, number - 1}); list.setSelection(number - 1, number); assertArrayEquals(list.getSelectionIndices(), new int[] {number - 1}); @@ -2375,7 +2375,7 @@ protected void deselectII_helper( list.setSelection(items); list.deselect(start, end); - assertSame( + assertArrayEquals( ":(" + start + ", " + end + "):", expectedIndices, list.getSelectionIndices()); @@ -2387,7 +2387,7 @@ protected void deselectII_helper( for (int i = start; i <= end; ++i) { list.deselect(i); } - assertSame( + assertArrayEquals( ":(" + start + ", " + end + "):", expectedIndices, list.getSelectionIndices()); @@ -2413,7 +2413,7 @@ protected void selectII_helper( int[] expectedIndices) { list.setItems(items); list.select(start, end); - assertSame( + assertArrayEquals( ":(" + start + ", " + end + "):", expectedIndices, list.getSelectionIndices()); @@ -2423,7 +2423,7 @@ protected void selectII_helper( for (int i = start; i <= end; i++) // <= on purpose list.select(i); - assertSame(":(" + start + ", " + end + "):", + assertArrayEquals(":(" + start + ", " + end + "):", expectedIndices, list.getSelectionIndices()); list.deselectAll(); @@ -2445,7 +2445,7 @@ protected void select$I_helper( list.select(selection); - assertSame( + assertArrayEquals( ":(" + start + ", " + end + "):", expectedIndices, list.getSelectionIndices()); @@ -2455,7 +2455,7 @@ protected void select$I_helper( for (int i = start; i <= end; i++) // <= on purpose list.select(i); - assertSame( + assertArrayEquals( ":(" + start + ", " + end + "):", expectedIndices, list.getSelectionIndices()); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java index 480bb7e4b9..6d56840c29 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java @@ -562,13 +562,13 @@ public void test_getSelectionIndices() { assertArrayEquals(new int[]{}, table.getSelectionIndices()); table.setSelection(new TableItem[]{items[2], items[number-1], items[10]}); - assertSame(new int[]{2, 10, number-1}, table.getSelectionIndices()); // 10 < number + assertArrayEquals(new int[]{2, 10, number-1}, table.getSelectionIndices()); // 10 < number int[] all = new int[number]; for (int i = 0; i<number; i++) all[i]=i; table.setSelection(items); - assertSame(all, table.getSelectionIndices()); + assertArrayEquals(all, table.getSelectionIndices()); // note: SWT.SINGLE makeCleanEnvironment(true); @@ -992,42 +992,42 @@ public void test_select$I() { items[i] = new TableItem(table, 0); table.select(new int[] {2, 10, 14}); - assertSame(new int[] {2, 10, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[] {2, 10, 14}, table.getSelectionIndices()); table.deselectAll(); table.select(new int[] {10, 2, 14}); - assertSame(new int[] {2, 10, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[] {2, 10, 14}, table.getSelectionIndices()); table.deselectAll(); table.select(new int[] {number, 0, number-1}); - assertSame(new int[] {0, number-1}, table.getSelectionIndices()); + assertArrayEquals(new int[] {0, number-1}, table.getSelectionIndices()); table.deselectAll(); table.select(new int[] {number, 0, -1}); - assertSame(new int[] {0}, table.getSelectionIndices()); + assertArrayEquals(new int[] {0}, table.getSelectionIndices()); table.deselectAll(); table.select(new int[] {0}); - assertSame(new int[] {0}, table.getSelectionIndices()); + assertArrayEquals(new int[] {0}, table.getSelectionIndices()); table.select(new int[] {10}); - assertSame(new int[] {0, 10}, table.getSelectionIndices()); + assertArrayEquals(new int[] {0, 10}, table.getSelectionIndices()); table.select(new int[] {2}); - assertSame(new int[] {0, 2, 10}, table.getSelectionIndices()); + assertArrayEquals(new int[] {0, 2, 10}, table.getSelectionIndices()); table.select(new int[] {14}); - assertSame(new int[] {0, 2, 10, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[] {0, 2, 10, 14}, table.getSelectionIndices()); table.deselectAll(); table.select(new int[] {15}); - assertSame(new int[] {}, table.getSelectionIndices()); + assertArrayEquals(new int[] {}, table.getSelectionIndices()); table.select(new int[] {-1}); - assertSame(new int[] {}, table.getSelectionIndices()); + assertArrayEquals(new int[] {}, table.getSelectionIndices()); table.select(new int[] {4, 4, 4}); - assertSame(new int[] {4}, table.getSelectionIndices()); + assertArrayEquals(new int[] {4}, table.getSelectionIndices()); // note: SWT.SINGLE makeCleanEnvironment(true); @@ -1047,29 +1047,29 @@ public void test_select$I() { } table.select(new int[] {0}); - assertSame(new int[] {0}, table.getSelectionIndices()); + assertArrayEquals(new int[] {0}, table.getSelectionIndices()); table.select(new int[] {10}); - assertSame(new int[] {10}, table.getSelectionIndices()); + assertArrayEquals(new int[] {10}, table.getSelectionIndices()); table.select(new int[] {2}); - assertSame(new int[] {2}, table.getSelectionIndices()); + assertArrayEquals(new int[] {2}, table.getSelectionIndices()); table.select(new int[] {14}); - assertSame(new int[] {14}, table.getSelectionIndices()); + assertArrayEquals(new int[] {14}, table.getSelectionIndices()); table.deselectAll(); table.select(new int[] {15}); - assertSame(new int[] {}, table.getSelectionIndices()); + assertArrayEquals(new int[] {}, table.getSelectionIndices()); table.select(new int[] {-1}); - assertSame(new int[] {}, table.getSelectionIndices()); + assertArrayEquals(new int[] {}, table.getSelectionIndices()); table.select(new int[] {10, 2, 14}); - assertSame(new int[] {}, table.getSelectionIndices()); + assertArrayEquals(new int[] {}, table.getSelectionIndices()); table.select(new int[] {4, 4, 4}); - assertSame(new int[] {}, table.getSelectionIndices()); + assertArrayEquals(new int[] {}, table.getSelectionIndices()); } public void test_selectAll() { @@ -1080,7 +1080,7 @@ public void test_selectAll() { assertArrayEquals(new int[]{}, table.getSelectionIndices()); table.selectAll(); - assertSame(new int[]{0, 1, 2, 3, 4}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 1, 2, 3, 4}, table.getSelectionIndices()); // test single-selection table makeCleanEnvironment(true); @@ -1099,13 +1099,13 @@ public void test_selectI() { items[i] = new TableItem(table, 0); table.select(new int[] {10, 2, 14}); - assertSame(new int[] {2, 10, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[] {2, 10, 14}, table.getSelectionIndices()); table.select(7); - assertSame(new int[]{2, 7, 10, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[]{2, 7, 10, 14}, table.getSelectionIndices()); table.select(0); - assertSame(new int[]{0, 2, 7, 10, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 2, 7, 10, 14}, table.getSelectionIndices()); // note: SWT.SINGLE makeCleanEnvironment(true); @@ -1141,25 +1141,25 @@ public void test_selectII() { items[i] = new TableItem(table, 0); table.select(new int[] {10, 2, 14}); - assertSame(new int[] {2, 10, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[] {2, 10, 14}, table.getSelectionIndices()); table.select(7); - assertSame(new int[]{2, 7, 10, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[]{2, 7, 10, 14}, table.getSelectionIndices()); table.select(0); - assertSame(new int[]{0, 2, 7, 10, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 2, 7, 10, 14}, table.getSelectionIndices()); table.select(4, 10); - assertSame(new int[]{0, 2, 4, 5, 6, 7, 8, 9, 10, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 2, 4, 5, 6, 7, 8, 9, 10, 14}, table.getSelectionIndices()); table.select(4, 14); - assertSame(new int[]{0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, table.getSelectionIndices()); table.select(0, 7); - assertSame(new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, table.getSelectionIndices()); table.select(9, 5); - assertSame(new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, table.getSelectionIndices()); makeCleanEnvironment(false); @@ -1345,19 +1345,19 @@ public void test_setSelection$I() { assertArrayEquals(new int[]{}, table.getSelectionIndices()); table.setSelection(new int[]{0, 3, 2}); - assertSame(new int[]{0, 2, 3}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 2, 3}, table.getSelectionIndices()); table.setSelection(new int[]{3, 2, 1}); - assertSame(new int[]{1, 2, 3}, table.getSelectionIndices()); + assertArrayEquals(new int[]{1, 2, 3}, table.getSelectionIndices()); table.setSelection(new int[]{1, 4, 0}); - assertSame(new int[]{0, 1, 4}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 1, 4}, table.getSelectionIndices()); table.setSelection(new int[]{0, 4, 0}); - assertSame(new int[]{0, 4}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 4}, table.getSelectionIndices()); table.setSelection(new int[]{2, 3, 4}); - assertSame(new int[]{2, 3, 4}, table.getSelectionIndices()); + assertArrayEquals(new int[]{2, 3, 4}, table.getSelectionIndices()); table.setSelection(new int[]{4, 4, 4, 4, 4, 4, 4}); assertArrayEquals(new int[]{4}, table.getSelectionIndices()); @@ -1574,13 +1574,13 @@ public void test_setSelectionII() { items[i] = new TableItem(table, 0); table.setSelection(0, 1); - assertSame(new int[]{0, 1}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 1}, table.getSelectionIndices()); table.setSelection(2, 4); - assertSame(new int[]{2, 3, 4}, table.getSelectionIndices()); + assertArrayEquals(new int[]{2, 3, 4}, table.getSelectionIndices()); table.setSelection(3, 4); - assertSame(new int[]{3, 4}, table.getSelectionIndices()); + assertArrayEquals(new int[]{3, 4}, table.getSelectionIndices()); table.setSelection(5, 4); assertArrayEquals(new int[]{}, table.getSelectionIndices()); @@ -1589,10 +1589,10 @@ public void test_setSelectionII() { assertArrayEquals(new int[]{2}, table.getSelectionIndices()); table.setSelection(1, 4); - assertSame(new int[]{1, 2, 3, 4}, table.getSelectionIndices()); + assertArrayEquals(new int[]{1, 2, 3, 4}, table.getSelectionIndices()); table.setSelection(0, 4); - assertSame(new int[]{0, 1, 2, 3, 4}, table.getSelectionIndices()); + assertArrayEquals(new int[]{0, 1, 2, 3, 4}, table.getSelectionIndices()); // test single-selection table makeCleanEnvironment(true); |