Skip to content

Commit 9ee2408

Browse files
Merge pull request #125 from Geode-solutions/fix/nnsearch-log
fix(Test): no more guarantee on colocation issue order
2 parents e1b30fc + 9577f08 commit 9ee2408

File tree

8 files changed

+70
-42
lines changed

8 files changed

+70
-42
lines changed

bindings/python/tests/test-py-edgedcurve-colocation.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ def check_colocation2D():
6767
raise ValueError(
6868
"[Test] EdgedCurve has wrong number of colocated points groups.")
6969
first_colocated_points_group = [0, 1, 6]
70-
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group:
70+
second_colocated_points_group = [3, 5]
71+
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[0] == second_colocated_points_group:
7172
raise ValueError(
7273
"[Test] EdgedCurve has wrong first colocated points group.")
73-
second_colocated_points_group = [3, 5]
74-
if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
74+
if not colocation_inspector.colocated_points_groups().issues()[1] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
7575
raise ValueError(
7676
"[Test] EdgedCurve has wrong second colocated points group.")
7777

@@ -114,11 +114,11 @@ def check_colocation3D():
114114
raise ValueError(
115115
"[Test] (3D) EdgedCurve has wrong number ofgroup of colocated points.")
116116
first_colocated_points_group = [0, 1, 6]
117-
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group:
117+
second_colocated_points_group = [3, 5]
118+
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[0] == second_colocated_points_group:
118119
raise ValueError(
119120
"[Test] (3D) EdgedCurve has wrong first colocated points group.")
120-
second_colocated_points_group = [3, 5]
121-
if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
121+
if not colocation_inspector.colocated_points_groups().issues()[1] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
122122
raise ValueError(
123123
"[Test] (3D) EdgedCurve has wrong second colocated points group.")
124124

bindings/python/tests/test-py-pointset-colocation.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ def check_colocation2D():
6868
raise ValueError(
6969
"[Test] PointSet has wrong number of group of colocated points.")
7070
first_colocated_points_group = [0, 1, 6]
71-
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group:
71+
second_colocated_points_group = [3, 5]
72+
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[0] == second_colocated_points_group:
7273
raise ValueError(
7374
"[Test] PointSet has wrong first colocated points group.")
74-
second_colocated_points_group = [3, 5]
75-
if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
75+
if colocation_inspector.colocated_points_groups().issues()[1] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
7676
raise ValueError(
7777
"[Test] PointSet has wrong second colocated points group.")
7878

@@ -115,11 +115,11 @@ def check_colocation3D():
115115
raise ValueError(
116116
"[Test] (3D) PointSet has wrong number of colocated points.")
117117
first_colocated_points_group = [0, 1, 6]
118-
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group:
118+
second_colocated_points_group = [3, 5]
119+
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[0] == second_colocated_points_group:
119120
raise ValueError(
120121
"[Test] (3D) PointSet has wrong first colocated points group.")
121-
second_colocated_points_group = [3, 5]
122-
if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
122+
if not colocation_inspector.colocated_points_groups().issues()[1] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
123123
raise ValueError(
124124
"[Test] (3D) PointSet has wrong second colocated points group.")
125125

bindings/python/tests/test-py-solid-colocation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ def check_colocation():
6969
if not colocation_inspector.colocated_points_groups().nb_issues() == 2:
7070
raise ValueError("[Test] Solid has wrong number of colocated points.")
7171
first_colocated_points_group = [0, 1, 6]
72-
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group:
72+
second_colocated_points_group = [3, 5]
73+
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[0] == second_colocated_points_group:
7374
raise ValueError(
7475
"[Test] Solid has wrong first colocated points group.")
75-
second_colocated_points_group = [3, 5]
76-
if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
76+
if not colocation_inspector.colocated_points_groups().issues()[1] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
7777
raise ValueError(
7878
"[Test] Solid has wrong second colocated points group.")
7979

bindings/python/tests/test-py-surface-colocation.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ def check_colocation2D():
6767
raise ValueError(
6868
"[Test] Surface has wrong number of colocated points.")
6969
first_colocated_points_group = [0, 1, 6]
70-
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group:
70+
second_colocated_points_group = [3, 5]
71+
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[0] == second_colocated_points_group:
7172
raise ValueError(
7273
"[Test] Surface has wrong first colocated points group.")
73-
second_colocated_points_group = [3, 5]
74-
if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
74+
if not colocation_inspector.colocated_points_groups().issues()[1] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
7575
raise ValueError(
7676
"[Test] Surface has wrong second colocated points group.")
7777

@@ -114,11 +114,11 @@ def check_colocation3D():
114114
raise ValueError(
115115
"[Test] (3D) Surface has wrong number of colocated points.")
116116
first_colocated_points_group = [0, 1, 6]
117-
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group:
117+
second_colocated_points_group = [3, 5]
118+
if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[0] == second_colocated_points_group:
118119
raise ValueError(
119120
"[Test] (3D) Surface has wrong first colocated points group.")
120-
second_colocated_points_group = [3, 5]
121-
if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
121+
if not colocation_inspector.colocated_points_groups().issues()[1] == first_colocated_points_group and not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group:
122122
raise ValueError(
123123
"[Test] (3D) Surface has wrong second colocated points group.")
124124

tests/inspector/test-edgedcurve-colocation.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,16 @@ void check_colocation2D()
7979
OPENGEODE_EXCEPTION( nb_colocated_points == 5,
8080
"[Test] EdgedCurve has wrong number of colocated points." );
8181
const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 };
82+
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
8283
OPENGEODE_EXCEPTION(
83-
colocated_points_groups.issues()[0] == first_colocated_points_group,
84+
colocated_points_groups.issues()[0] == first_colocated_points_group
85+
|| colocated_points_groups.issues()[0]
86+
== second_colocated_points_group,
8487
"[Test] EdgedCurve has wrong first colocated points group." );
85-
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
8688
OPENGEODE_EXCEPTION(
87-
colocated_points_groups.issues()[1] == second_colocated_points_group,
89+
colocated_points_groups.issues()[1] == second_colocated_points_group
90+
|| colocated_points_groups.issues()[1]
91+
== first_colocated_points_group,
8892
"[Test] EdgedCurve has wrong second colocated points group." );
8993
}
9094

@@ -139,12 +143,16 @@ void check_colocation3D()
139143
OPENGEODE_EXCEPTION( nb_colocated_points == 5,
140144
"[Test] (3D) EdgedCurve has wrong number of colocated points." );
141145
const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 };
146+
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
142147
OPENGEODE_EXCEPTION(
143-
colocated_points_groups.issues()[0] == first_colocated_points_group,
148+
colocated_points_groups.issues()[0] == first_colocated_points_group
149+
|| colocated_points_groups.issues()[0]
150+
== second_colocated_points_group,
144151
"[Test] (3D) EdgedCurve has wrong first colocated points group." );
145-
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
146152
OPENGEODE_EXCEPTION(
147-
colocated_points_groups.issues()[1] == second_colocated_points_group,
153+
colocated_points_groups.issues()[1] == first_colocated_points_group
154+
|| colocated_points_groups.issues()[1]
155+
== second_colocated_points_group,
148156
"[Test] (3D) EdgedCurve has wrong second colocated points group." );
149157
}
150158

tests/inspector/test-pointset.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,16 @@ void check_colocation2D()
7777
OPENGEODE_EXCEPTION( nb_colocated_points == 5,
7878
"[Test] PointSet has wrong number of colocated points." );
7979
const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 };
80+
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
8081
OPENGEODE_EXCEPTION(
81-
colocated_points_groups.issues()[0] == first_colocated_points_group,
82+
colocated_points_groups.issues()[0] == first_colocated_points_group
83+
|| colocated_points_groups.issues()[0]
84+
== second_colocated_points_group,
8285
"[Test] PointSet has wrong first colocated points group." );
83-
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
8486
OPENGEODE_EXCEPTION(
85-
colocated_points_groups.issues()[1] == second_colocated_points_group,
87+
colocated_points_groups.issues()[1] == first_colocated_points_group
88+
|| colocated_points_groups.issues()[1]
89+
== second_colocated_points_group,
8690
"[Test] PointSet has wrong second colocated points group." );
8791
}
8892

@@ -135,12 +139,16 @@ void check_colocation3D()
135139
OPENGEODE_EXCEPTION( nb_colocated_points == 5,
136140
"[Test] (3D) PointSet has wrong number of colocated points." );
137141
const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 };
142+
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
138143
OPENGEODE_EXCEPTION(
139-
colocated_points_groups.issues()[0] == first_colocated_points_group,
144+
colocated_points_groups.issues()[0] == first_colocated_points_group
145+
|| colocated_points_groups.issues()[0]
146+
== second_colocated_points_group,
140147
"[Test] (3D) PointSet has wrong first colocated points group." );
141-
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
142148
OPENGEODE_EXCEPTION(
143-
colocated_points_groups.issues()[1] == second_colocated_points_group,
149+
colocated_points_groups.issues()[1] == first_colocated_points_group
150+
|| colocated_points_groups.issues()[1]
151+
== second_colocated_points_group,
144152
"[Test] (3D) PointSet has wrong second colocated points group." );
145153
}
146154

tests/inspector/test-solid-colocation.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,16 @@ void check_colocation()
8080
OPENGEODE_EXCEPTION( nb_colocated_points == 5,
8181
"[Test] Solid has wrong number of colocated points." );
8282
const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 };
83+
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
8384
OPENGEODE_EXCEPTION(
84-
colocated_points_groups.issues()[0] == first_colocated_points_group,
85+
colocated_points_groups.issues()[0] == first_colocated_points_group
86+
|| colocated_points_groups.issues()[0]
87+
== second_colocated_points_group,
8588
"[Test] Solid has wrong first colocated points group." );
86-
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
8789
OPENGEODE_EXCEPTION(
88-
colocated_points_groups.issues()[1] == second_colocated_points_group,
90+
colocated_points_groups.issues()[1] == second_colocated_points_group
91+
|| colocated_points_groups.issues()[1]
92+
== first_colocated_points_group,
8993
"[Test] Solid has wrong second colocated points group." );
9094
}
9195

tests/inspector/test-surface-colocation.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,16 @@ void check_colocation2D()
8080
OPENGEODE_EXCEPTION( nb_colocated_points == 5,
8181
"[Test] Surface has wrong number of colocated points." );
8282
const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 };
83+
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
8384
OPENGEODE_EXCEPTION(
84-
colocated_points_groups.issues()[0] == first_colocated_points_group,
85+
colocated_points_groups.issues()[0] == first_colocated_points_group
86+
|| colocated_points_groups.issues()[0]
87+
== second_colocated_points_group,
8588
"[Test] Surface has wrong first colocated points group." );
86-
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
8789
OPENGEODE_EXCEPTION(
88-
colocated_points_groups.issues()[1] == second_colocated_points_group,
90+
colocated_points_groups.issues()[1] == second_colocated_points_group
91+
|| colocated_points_groups.issues()[1]
92+
== second_colocated_points_group,
8993
"[Test] Surface has wrong second colocated points group." );
9094
}
9195

@@ -139,12 +143,16 @@ void check_colocation3D()
139143
OPENGEODE_EXCEPTION( nb_colocated_points == 5,
140144
"[Test] (3D) Surface has wrong number of colocated points." );
141145
const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 };
146+
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
142147
OPENGEODE_EXCEPTION(
143-
colocated_points_groups.issues()[0] == first_colocated_points_group,
148+
colocated_points_groups.issues()[0] == first_colocated_points_group
149+
|| colocated_points_groups.issues()[0]
150+
== second_colocated_points_group,
144151
"[Test] (3D) Surface has wrong first colocated points group." );
145-
const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 };
146152
OPENGEODE_EXCEPTION(
147-
colocated_points_groups.issues()[1] == second_colocated_points_group,
153+
colocated_points_groups.issues()[1] == first_colocated_points_group
154+
|| colocated_points_groups.issues()[1]
155+
== second_colocated_points_group,
148156
"[Test] (3D) Surface has wrong second colocated points group." );
149157
}
150158

0 commit comments

Comments
 (0)