diff options
Diffstat (limited to 'test/de/lmu/ifi/dbs/elki/utilities/datastructures')
3 files changed, 77 insertions, 7 deletions
diff --git a/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestHeap.java b/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestHeap.java index 44c84f83..fcdc28d2 100644 --- a/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestHeap.java +++ b/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestHeap.java @@ -1,5 +1,28 @@ package de.lmu.ifi.dbs.elki.utilities.datastructures; +/* + This file is part of ELKI: + Environment for Developing KDD-Applications Supported by Index-Structures + + Copyright (C) 2011 + Ludwig-Maximilians-Universität München + Lehr- und Forschungseinheit für Datenbanksysteme + ELKI Development Team + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + import static org.junit.Assert.assertEquals; import java.util.Collections; @@ -31,11 +54,11 @@ public class TestHeap { } for(int i = 0; i < asc.length; i++) { final Integer gota = hasc.poll(); - assertEquals("Objects sorted incorrectly at ascending position "+i, asc[i], gota); + assertEquals("Objects sorted incorrectly at ascending position " + i, asc[i], gota); } for(int i = 0; i < desc.length; i++) { final Integer gotd = hdesc.poll(); - assertEquals("Objects sorted incorrectly at descending position "+i, desc[i], gotd); + assertEquals("Objects sorted incorrectly at descending position " + i, desc[i], gotd); } } } diff --git a/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestTiedTopBoundedHeap.java b/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestTiedTopBoundedHeap.java index 829c5880..cb4492b8 100644 --- a/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestTiedTopBoundedHeap.java +++ b/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestTiedTopBoundedHeap.java @@ -1,5 +1,28 @@ package de.lmu.ifi.dbs.elki.utilities.datastructures; +/* + This file is part of ELKI: + Environment for Developing KDD-Applications Supported by Index-Structures + + Copyright (C) 2011 + Ludwig-Maximilians-Universität München + Lehr- und Forschungseinheit für Datenbanksysteme + ELKI Development Team + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + import static org.junit.Assert.assertEquals; import java.util.Collections; @@ -29,18 +52,19 @@ public class TestTiedTopBoundedHeap { hasc.add(i); hdesc.add(i); } - //LoggingUtil.warning("Heap: "+hasc.toString()+ " -- "+hdesc.toString()); + // LoggingUtil.warning("Heap: "+hasc.toString()+ " -- "+hdesc.toString()); assertEquals("Ascending heap size doesn't match", asc.length, hasc.size()); assertEquals("Descending heap size doesn't match", desc.length, hdesc.size()); for(int i = 0; i < asc.length; i++) { final Integer gota = hasc.poll(); - assertEquals("Objects sorted incorrectly at ascending position "+i, asc[i], gota); + assertEquals("Objects sorted incorrectly at ascending position " + i, asc[i], gota); } for(int i = 0; i < desc.length; i++) { final Integer gotd = hdesc.poll(); - assertEquals("Objects sorted incorrectly at descending position "+i, desc[i], gotd); + assertEquals("Objects sorted incorrectly at descending position " + i, desc[i], gotd); } } + /** * Test bounded heap */ diff --git a/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestTopBoundedHeap.java b/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestTopBoundedHeap.java index c1fc3a66..f0160d5e 100644 --- a/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestTopBoundedHeap.java +++ b/test/de/lmu/ifi/dbs/elki/utilities/datastructures/TestTopBoundedHeap.java @@ -1,5 +1,28 @@ package de.lmu.ifi.dbs.elki.utilities.datastructures; +/* + This file is part of ELKI: + Environment for Developing KDD-Applications Supported by Index-Structures + + Copyright (C) 2011 + Ludwig-Maximilians-Universität München + Lehr- und Forschungseinheit für Datenbanksysteme + ELKI Development Team + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + import static org.junit.Assert.assertEquals; import java.util.Collections; @@ -31,11 +54,11 @@ public class TestTopBoundedHeap { } for(int i = 0; i < asc.length; i++) { final Integer gota = hasc.poll(); - assertEquals("Objects sorted incorrectly at ascending position "+i, asc[i], gota); + assertEquals("Objects sorted incorrectly at ascending position " + i, asc[i], gota); } for(int i = 0; i < desc.length; i++) { final Integer gotd = hdesc.poll(); - assertEquals("Objects sorted incorrectly at descending position "+i, desc[i], gotd); + assertEquals("Objects sorted incorrectly at descending position " + i, desc[i], gotd); } } } |