From 82d6262655c1bc6023114853701ec58ebaa8fa96 Mon Sep 17 00:00:00 2001 From: Pierre Anquez Date: Thu, 13 Feb 2025 15:36:03 +0100 Subject: [PATCH 1/5] fix(Test): no more guarantee on colocation issue order --- tests/inspector/test-surface-colocation.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/inspector/test-surface-colocation.cpp b/tests/inspector/test-surface-colocation.cpp index b41f7652..5249db1f 100644 --- a/tests/inspector/test-surface-colocation.cpp +++ b/tests/inspector/test-surface-colocation.cpp @@ -139,12 +139,16 @@ void check_colocation3D() OPENGEODE_EXCEPTION( nb_colocated_points == 5, "[Test] (3D) Surface has wrong number of colocated points." ); const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 }; + const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[0] == first_colocated_points_group, + colocated_points_groups.issues()[0] == first_colocated_points_group + || colocated_points_groups.issues()[0] + == second_colocated_points_group, "[Test] (3D) Surface has wrong first colocated points group." ); - const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[1] == second_colocated_points_group, + colocated_points_groups.issues()[1] == first_colocated_points_group + || colocated_points_groups.issues()[1] + == second_colocated_points_group, "[Test] (3D) Surface has wrong second colocated points group." ); } From eaaa66253bb11aa5ac706277a4b2ceb76ddba9cd Mon Sep 17 00:00:00 2001 From: Pierre Anquez Date: Sat, 15 Feb 2025 20:52:34 +0100 Subject: [PATCH 2/5] fixing all tests --- .../tests/test-py-edgedcurve-colocation.py | 12 +++++------ .../tests/test-py-pointset-colocation.py | 12 +++++------ .../python/tests/test-py-solid-colocation.py | 6 +++--- .../tests/test-py-surface-colocation.py | 12 +++++------ .../inspector/test-edgedcurve-colocation.cpp | 20 +++++++++++++------ tests/inspector/test-pointset.cpp | 20 +++++++++++++------ tests/inspector/test-solid-colocation.cpp | 10 +++++++--- tests/inspector/test-surface-colocation.cpp | 10 +++++++--- 8 files changed, 63 insertions(+), 39 deletions(-) diff --git a/bindings/python/tests/test-py-edgedcurve-colocation.py b/bindings/python/tests/test-py-edgedcurve-colocation.py index 750eedf1..4bd4c58b 100644 --- a/bindings/python/tests/test-py-edgedcurve-colocation.py +++ b/bindings/python/tests/test-py-edgedcurve-colocation.py @@ -67,11 +67,11 @@ def check_colocation2D(): raise ValueError( "[Test] EdgedCurve has wrong number of colocated points groups.") first_colocated_points_group = [0, 1, 6] - if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group: + second_colocated_points_group = [3, 5] + 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: raise ValueError( "[Test] EdgedCurve has wrong first colocated points group.") - second_colocated_points_group = [3, 5] - if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group: + 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: raise ValueError( "[Test] EdgedCurve has wrong second colocated points group.") @@ -114,11 +114,11 @@ def check_colocation3D(): raise ValueError( "[Test] (3D) EdgedCurve has wrong number ofgroup of colocated points.") first_colocated_points_group = [0, 1, 6] - if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group: + second_colocated_points_group = [3, 5] + if not 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: raise ValueError( "[Test] (3D) EdgedCurve has wrong first colocated points group.") - second_colocated_points_group = [3, 5] - if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group: + if not 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: raise ValueError( "[Test] (3D) EdgedCurve has wrong second colocated points group.") diff --git a/bindings/python/tests/test-py-pointset-colocation.py b/bindings/python/tests/test-py-pointset-colocation.py index e59a0bcd..2232104e 100644 --- a/bindings/python/tests/test-py-pointset-colocation.py +++ b/bindings/python/tests/test-py-pointset-colocation.py @@ -68,11 +68,11 @@ def check_colocation2D(): raise ValueError( "[Test] PointSet has wrong number of group of colocated points.") first_colocated_points_group = [0, 1, 6] - if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group: + second_colocated_points_group = [3, 5] + 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: raise ValueError( "[Test] PointSet has wrong first colocated points group.") - second_colocated_points_group = [3, 5] - if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group: + 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: raise ValueError( "[Test] PointSet has wrong second colocated points group.") @@ -115,11 +115,11 @@ def check_colocation3D(): raise ValueError( "[Test] (3D) PointSet has wrong number of colocated points.") first_colocated_points_group = [0, 1, 6] - if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group: + second_colocated_points_group = [3, 5] + if not 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: raise ValueError( "[Test] (3D) PointSet has wrong first colocated points group.") - second_colocated_points_group = [3, 5] - if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group: + if not 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: raise ValueError( "[Test] (3D) PointSet has wrong second colocated points group.") diff --git a/bindings/python/tests/test-py-solid-colocation.py b/bindings/python/tests/test-py-solid-colocation.py index c38f2137..6f642dec 100644 --- a/bindings/python/tests/test-py-solid-colocation.py +++ b/bindings/python/tests/test-py-solid-colocation.py @@ -69,11 +69,11 @@ def check_colocation(): if not colocation_inspector.colocated_points_groups().nb_issues() == 2: raise ValueError("[Test] Solid has wrong number of colocated points.") first_colocated_points_group = [0, 1, 6] - if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group: + second_colocated_points_group = [3, 5] + 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: raise ValueError( "[Test] Solid has wrong first colocated points group.") - second_colocated_points_group = [3, 5] - if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group: + 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: raise ValueError( "[Test] Solid has wrong second colocated points group.") diff --git a/bindings/python/tests/test-py-surface-colocation.py b/bindings/python/tests/test-py-surface-colocation.py index 87305339..f32a54b9 100644 --- a/bindings/python/tests/test-py-surface-colocation.py +++ b/bindings/python/tests/test-py-surface-colocation.py @@ -67,11 +67,11 @@ def check_colocation2D(): raise ValueError( "[Test] Surface has wrong number of colocated points.") first_colocated_points_group = [0, 1, 6] - if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group: + second_colocated_points_group = [3, 5] + 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: raise ValueError( "[Test] Surface has wrong first colocated points group.") - second_colocated_points_group = [3, 5] - if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group: + 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: raise ValueError( "[Test] Surface has wrong second colocated points group.") @@ -114,11 +114,11 @@ def check_colocation3D(): raise ValueError( "[Test] (3D) Surface has wrong number of colocated points.") first_colocated_points_group = [0, 1, 6] - if not colocation_inspector.colocated_points_groups().issues()[0] == first_colocated_points_group: + second_colocated_points_group = [3, 5] + if not 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: raise ValueError( "[Test] (3D) Surface has wrong first colocated points group.") - second_colocated_points_group = [3, 5] - if not colocation_inspector.colocated_points_groups().issues()[1] == second_colocated_points_group: + if not 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: raise ValueError( "[Test] (3D) Surface has wrong second colocated points group.") diff --git a/tests/inspector/test-edgedcurve-colocation.cpp b/tests/inspector/test-edgedcurve-colocation.cpp index 083db8fe..cea110b9 100644 --- a/tests/inspector/test-edgedcurve-colocation.cpp +++ b/tests/inspector/test-edgedcurve-colocation.cpp @@ -79,12 +79,16 @@ void check_colocation2D() OPENGEODE_EXCEPTION( nb_colocated_points == 5, "[Test] EdgedCurve has wrong number of colocated points." ); const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 }; + const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[0] == first_colocated_points_group, + colocated_points_groups.issues()[0] == first_colocated_points_group + || colocated_points_groups.issues()[0] + == second_colocated_points_group, "[Test] EdgedCurve has wrong first colocated points group." ); - const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[1] == second_colocated_points_group, + colocated_points_groups.issues()[1] == second_colocated_points_group + || colocated_points_groups.issues()[1] + == first_colocated_points_group, "[Test] EdgedCurve has wrong second colocated points group." ); } @@ -139,12 +143,16 @@ void check_colocation3D() OPENGEODE_EXCEPTION( nb_colocated_points == 5, "[Test] (3D) EdgedCurve has wrong number of colocated points." ); const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 }; + const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[0] == first_colocated_points_group, + colocated_points_groups.issues()[0] == first_colocated_points_group + || colocated_points_groups.issues()[0] + == second_colocated_points_group, "[Test] (3D) EdgedCurve has wrong first colocated points group." ); - const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[1] == second_colocated_points_group, + colocated_points_groups.issues()[1] == first_colocated_points_group + || colocated_points_groups.issues()[1] + == second_colocated_points_group, "[Test] (3D) EdgedCurve has wrong second colocated points group." ); } diff --git a/tests/inspector/test-pointset.cpp b/tests/inspector/test-pointset.cpp index 1637032b..17a387c5 100644 --- a/tests/inspector/test-pointset.cpp +++ b/tests/inspector/test-pointset.cpp @@ -77,12 +77,16 @@ void check_colocation2D() OPENGEODE_EXCEPTION( nb_colocated_points == 5, "[Test] PointSet has wrong number of colocated points." ); const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 }; + const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[0] == first_colocated_points_group, + colocated_points_groups.issues()[0] == first_colocated_points_group + || colocated_points_groups.issues()[0] + == second_colocated_points_group, "[Test] PointSet has wrong first colocated points group." ); - const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[1] == second_colocated_points_group, + colocated_points_groups.issues()[1] == first_colocated_points_group + || colocated_points_groups.issues()[1] + == second_colocated_points_group, "[Test] PointSet has wrong second colocated points group." ); } @@ -135,12 +139,16 @@ void check_colocation3D() OPENGEODE_EXCEPTION( nb_colocated_points == 5, "[Test] (3D) PointSet has wrong number of colocated points." ); const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 }; + const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[0] == first_colocated_points_group, + colocated_points_groups.issues()[0] == first_colocated_points_group + || colocated_points_groups.issues()[0] + == second_colocated_points_group, "[Test] (3D) PointSet has wrong first colocated points group." ); - const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[1] == second_colocated_points_group, + colocated_points_groups.issues()[1] == first_colocated_points_group + || colocated_points_groups.issues()[1] + == second_colocated_points_group, "[Test] (3D) PointSet has wrong second colocated points group." ); } diff --git a/tests/inspector/test-solid-colocation.cpp b/tests/inspector/test-solid-colocation.cpp index 04dfd5b8..fece5619 100644 --- a/tests/inspector/test-solid-colocation.cpp +++ b/tests/inspector/test-solid-colocation.cpp @@ -80,12 +80,16 @@ void check_colocation() OPENGEODE_EXCEPTION( nb_colocated_points == 5, "[Test] Solid has wrong number of colocated points." ); const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 }; + const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[0] == first_colocated_points_group, + colocated_points_groups.issues()[0] == first_colocated_points_group + || colocated_points_groups.issues()[0] + == second_colocated_points_group, "[Test] Solid has wrong first colocated points group." ); - const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[1] == second_colocated_points_group, + colocated_points_groups.issues()[1] == second_colocated_points_group + || colocated_points_groups.issues()[1] + == first_colocated_points_group, "[Test] Solid has wrong second colocated points group." ); } diff --git a/tests/inspector/test-surface-colocation.cpp b/tests/inspector/test-surface-colocation.cpp index 5249db1f..2473ff76 100644 --- a/tests/inspector/test-surface-colocation.cpp +++ b/tests/inspector/test-surface-colocation.cpp @@ -80,12 +80,16 @@ void check_colocation2D() OPENGEODE_EXCEPTION( nb_colocated_points == 5, "[Test] Surface has wrong number of colocated points." ); const std::vector< geode::index_t > first_colocated_points_group{ 0, 1, 6 }; + const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[0] == first_colocated_points_group, + colocated_points_groups.issues()[0] == first_colocated_points_group + || colocated_points_groups.issues()[0] + == second_colocated_points_group, "[Test] Surface has wrong first colocated points group." ); - const std::vector< geode::index_t > second_colocated_points_group{ 3, 5 }; OPENGEODE_EXCEPTION( - colocated_points_groups.issues()[1] == second_colocated_points_group, + colocated_points_groups.issues()[1] == second_colocated_points_group + || colocated_points_groups.issues()[1] + == second_colocated_points_group, "[Test] Surface has wrong second colocated points group." ); } From 1a71340bab7c25370db2c20d6a4e840f28f08abb Mon Sep 17 00:00:00 2001 From: Pierre Anquez Date: Sat, 15 Feb 2025 20:56:49 +0100 Subject: [PATCH 3/5] fix copy paste --- bindings/python/tests/test-py-surface-colocation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/tests/test-py-surface-colocation.py b/bindings/python/tests/test-py-surface-colocation.py index f32a54b9..81a15eb9 100644 --- a/bindings/python/tests/test-py-surface-colocation.py +++ b/bindings/python/tests/test-py-surface-colocation.py @@ -115,10 +115,10 @@ def check_colocation3D(): "[Test] (3D) Surface has wrong number of colocated points.") first_colocated_points_group = [0, 1, 6] second_colocated_points_group = [3, 5] - if not 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: + 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: raise ValueError( "[Test] (3D) Surface has wrong first colocated points group.") - if not 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: + 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: raise ValueError( "[Test] (3D) Surface has wrong second colocated points group.") From b3a50807253e716a5116b694ca31ca14cd32daff Mon Sep 17 00:00:00 2001 From: Pierre Anquez Date: Sat, 15 Feb 2025 21:00:42 +0100 Subject: [PATCH 4/5] same --- bindings/python/tests/test-py-pointset-colocation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/tests/test-py-pointset-colocation.py b/bindings/python/tests/test-py-pointset-colocation.py index 2232104e..7e11d55b 100644 --- a/bindings/python/tests/test-py-pointset-colocation.py +++ b/bindings/python/tests/test-py-pointset-colocation.py @@ -116,10 +116,10 @@ def check_colocation3D(): "[Test] (3D) PointSet has wrong number of colocated points.") first_colocated_points_group = [0, 1, 6] second_colocated_points_group = [3, 5] - if not 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: + 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: raise ValueError( "[Test] (3D) PointSet has wrong first colocated points group.") - if not 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: + 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: raise ValueError( "[Test] (3D) PointSet has wrong second colocated points group.") From 9577f08e8ddba96a2bc01f0ca1f79cb6d1016d6c Mon Sep 17 00:00:00 2001 From: Pierre Anquez Date: Sat, 15 Feb 2025 21:04:24 +0100 Subject: [PATCH 5/5] same --- bindings/python/tests/test-py-edgedcurve-colocation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/tests/test-py-edgedcurve-colocation.py b/bindings/python/tests/test-py-edgedcurve-colocation.py index 4bd4c58b..b9310106 100644 --- a/bindings/python/tests/test-py-edgedcurve-colocation.py +++ b/bindings/python/tests/test-py-edgedcurve-colocation.py @@ -115,10 +115,10 @@ def check_colocation3D(): "[Test] (3D) EdgedCurve has wrong number ofgroup of colocated points.") first_colocated_points_group = [0, 1, 6] second_colocated_points_group = [3, 5] - if not 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: + 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: raise ValueError( "[Test] (3D) EdgedCurve has wrong first colocated points group.") - if not 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: + 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: raise ValueError( "[Test] (3D) EdgedCurve has wrong second colocated points group.")