Skip to content

Commit

Permalink
Fix for issue #42
Browse files Browse the repository at this point in the history
  • Loading branch information
tzaeschke committed Jun 22, 2024
1 parent c6e775b commit 93df62c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [2.1.4 - Unreleased]

- Fixed tree corruption after remove() in QT2. [#40](https://github.com/tzaeschke/tinspin-indexes/issue/40)
- Fixed tree corruption after remove() in QT2. [#40](https://github.com/tzaeschke/tinspin-indexes/issues/40)
- Fixed tree consistency (single-entry leaf after remove)
- Fixed tree consistency (nValues) -> verify
- Fixed bug in qt2.contains()
TODO
- CLean up calls to checkMerge() -> call leaf-merge only in leaf!
- What is going on with root expansion? Why does it not fail in tests?
- check qt0
- Fixed tree inconsistency after root resizing after insert(). [#42](https://github.com/tzaeschke/tinspin-indexes/issues/42)
- CLean up calls to checkMerge() -> call leaf-merge only in leaf!
- What is going on with root expansion? Why does it not fail in tests?
- check qt0

## [2.1.3] - 2023-11-19

Expand Down
10 changes: 10 additions & 0 deletions src/test/java/org/tinspin/index/qt2/Quadtree2Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.tinspin.index.qt2;

import org.junit.Test;
import org.tinspin.index.Index;
import org.tinspin.index.qthypercube2.QuadTreeKD2;

import java.util.Arrays;
Expand Down Expand Up @@ -57,6 +58,15 @@ public void testIssue0040_remove() {
tree.remove(Arrays.copyOf(data[i], 2), (int)data[i][2]);
}
}

assertEquals(9, tree.size());
int n = 0;
double[] min = new double[]{-50, -3};
double[] max = new double[]{50, 113};
for (Index.PointIterator<Integer> it = tree.query(min, max); it.hasNext(); it.next()) {
n++;
}
assertEquals(9, n);
}

@Test
Expand Down

0 comments on commit 93df62c

Please sign in to comment.