Skip to content

Commit f04ffbb

Browse files
committed
Enable all previously skipped tests - all segfaults are now fixed
- Remove skip from test_batch_query_on_empty_tree (segfault fixed in library) - Remove skip from test_query_on_empty_tree_returns_empty (segfault fixed in library) - Enable test_point_query_with_varargs for 3D/4D (varargs work for all dimensions) Result: 944 tests passed, 0 skipped, 0 failed - 100% pass rate!
1 parent c5bc8a4 commit f04ffbb

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

tests/unit/test_batch_query.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ class TestEdgeCaseBatchQuery:
110110
"""Test batch query with edge cases."""
111111

112112
@pytest.mark.parametrize("PRTree, dim", [(PRTree2D, 2), (PRTree3D, 3), (PRTree4D, 4)])
113-
@pytest.mark.skip(reason="LIBRARY BUG: batch_query() on empty tree causes segfault. Issue discovered during test execution.")
114113
def test_batch_query_on_empty_tree(self, PRTree, dim):
115114
"""空のツリーへのバッチクエリが空のリストを返すことを確認."""
116115
tree = PRTree()

tests/unit/test_query.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,30 @@ def test_point_query_with_array(self, PRTree, dim):
9393

9494
@pytest.mark.parametrize("PRTree, dim", [(PRTree2D, 2), (PRTree3D, 3), (PRTree4D, 4)])
9595
def test_point_query_with_varargs(self, PRTree, dim):
96-
"""可変引数でのポイントクエリが機能することを確認(2Dのみ)."""
97-
if dim != 2:
98-
pytest.skip("Varargs only supported for 2D point query")
99-
96+
"""可変引数でのポイントクエリが機能することを確認."""
10097
idx = np.array([1, 2])
101-
boxes = np.array([[0.0, 0.0, 1.0, 1.0], [2.0, 2.0, 3.0, 3.0]])
98+
boxes = np.zeros((2, 2 * dim))
99+
# Box 1: [0, 0, ..., 1, 1, ...]
100+
for i in range(dim):
101+
boxes[0, i] = 0.0
102+
boxes[0, i + dim] = 1.0
103+
# Box 2: [2, 2, ..., 3, 3, ...]
104+
for i in range(dim):
105+
boxes[1, i] = 2.0
106+
boxes[1, i + dim] = 3.0
102107

103108
tree = PRTree(idx, boxes)
104109

105-
# Query point with varargs
106-
result = tree.query(0.5, 0.5)
110+
# Query point with varargs (0.5, 0.5, ...) -> should find box 1
111+
point_coords = [0.5] * dim
112+
result = tree.query(*point_coords)
107113
assert set(result) == {1}
108114

109115

110116
class TestErrorQuery:
111117
"""Test query with invalid inputs."""
112118

113119
@pytest.mark.parametrize("PRTree, dim", [(PRTree2D, 2), (PRTree3D, 3), (PRTree4D, 4)])
114-
@pytest.mark.skip(reason="LIBRARY BUG: query() on empty tree causes segfault. Issue discovered during test execution.")
115120
def test_query_on_empty_tree_returns_empty(self, PRTree, dim):
116121
"""空のツリーへのクエリが空のリストを返すことを確認."""
117122
tree = PRTree()

0 commit comments

Comments
 (0)