From 7a37a856ee96b38caadf32ddf8745b1c7c87e115 Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Thu, 26 Sep 2024 16:52:29 -0700 Subject: [PATCH 01/10] bug on cellsToLinkedMultiPolygon for children of pentagon --- .../testapps/testCellsToLinkedMultiPolygon.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/apps/testapps/testCellsToLinkedMultiPolygon.c b/src/apps/testapps/testCellsToLinkedMultiPolygon.c index 5c903386e6..9476d1a831 100644 --- a/src/apps/testapps/testCellsToLinkedMultiPolygon.c +++ b/src/apps/testapps/testCellsToLinkedMultiPolygon.c @@ -72,6 +72,24 @@ SUITE(cellsToLinkedMultiPolygon) { H3_EXPORT(destroyLinkedMultiPolygon)(&polygon); } + TEST(pentagonChldren) { + // children of pentagon 0x80ebfffffffffff + H3Index kids[] = {0x81ea3ffffffffff, 0x81eabffffffffff, + 0x81eafffffffffff, 0x81eb3ffffffffff, + 0x81eb7ffffffffff, 0x81ebbffffffffff}; + int numCells = ARRAY_SIZE(set); + + LinkedGeoPolygon polygon; + t_assertSuccess( + H3_EXPORT(cellsToLinkedMultiPolygon)(kids, numCells, &polygon)); + + // Since these are the children of a cell, we exepect a single loop with + // no holes. + t_assert(countLinkedLoops(&polygon) == 2, "1 loop added to polygon"); + + H3_EXPORT(destroyLinkedMultiPolygon)(&polygon); + } + // TODO: This test asserts incorrect behavior - we should be creating // multiple polygons, each with their own single loop. Update when the // algorithm is corrected. From 6eca1ab5efa84b41db3de17c01749b1e63affadd Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Thu, 26 Sep 2024 16:55:13 -0700 Subject: [PATCH 02/10] bah --- src/apps/testapps/testCellsToLinkedMultiPolygon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/testapps/testCellsToLinkedMultiPolygon.c b/src/apps/testapps/testCellsToLinkedMultiPolygon.c index 9476d1a831..5d04480bf7 100644 --- a/src/apps/testapps/testCellsToLinkedMultiPolygon.c +++ b/src/apps/testapps/testCellsToLinkedMultiPolygon.c @@ -77,7 +77,7 @@ SUITE(cellsToLinkedMultiPolygon) { H3Index kids[] = {0x81ea3ffffffffff, 0x81eabffffffffff, 0x81eafffffffffff, 0x81eb3ffffffffff, 0x81eb7ffffffffff, 0x81ebbffffffffff}; - int numCells = ARRAY_SIZE(set); + int numCells = ARRAY_SIZE(kids); LinkedGeoPolygon polygon; t_assertSuccess( From dc7b15ada651fd0edc5a89426a77a5243159eb38 Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Thu, 26 Sep 2024 17:03:00 -0700 Subject: [PATCH 03/10] we expect 1 loop, no holes --- src/apps/testapps/testCellsToLinkedMultiPolygon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/testapps/testCellsToLinkedMultiPolygon.c b/src/apps/testapps/testCellsToLinkedMultiPolygon.c index 5d04480bf7..b5f00a7b5d 100644 --- a/src/apps/testapps/testCellsToLinkedMultiPolygon.c +++ b/src/apps/testapps/testCellsToLinkedMultiPolygon.c @@ -85,7 +85,7 @@ SUITE(cellsToLinkedMultiPolygon) { // Since these are the children of a cell, we exepect a single loop with // no holes. - t_assert(countLinkedLoops(&polygon) == 2, "1 loop added to polygon"); + t_assert(countLinkedLoops(&polygon) == 1, "1 loop added to polygon"); H3_EXPORT(destroyLinkedMultiPolygon)(&polygon); } From 68b8d848e1521593f0e9d63447f86fe1eeb52be1 Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Thu, 26 Sep 2024 17:18:40 -0700 Subject: [PATCH 04/10] test (incorrectly) for 2 loops --- src/apps/testapps/testCellsToLinkedMultiPolygon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/testapps/testCellsToLinkedMultiPolygon.c b/src/apps/testapps/testCellsToLinkedMultiPolygon.c index b5f00a7b5d..5d04480bf7 100644 --- a/src/apps/testapps/testCellsToLinkedMultiPolygon.c +++ b/src/apps/testapps/testCellsToLinkedMultiPolygon.c @@ -85,7 +85,7 @@ SUITE(cellsToLinkedMultiPolygon) { // Since these are the children of a cell, we exepect a single loop with // no holes. - t_assert(countLinkedLoops(&polygon) == 1, "1 loop added to polygon"); + t_assert(countLinkedLoops(&polygon) == 2, "1 loop added to polygon"); H3_EXPORT(destroyLinkedMultiPolygon)(&polygon); } From 87b70148aebee1cf770afbff40d0efacddd084f0 Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Thu, 26 Sep 2024 17:26:36 -0700 Subject: [PATCH 05/10] back to expecting (correctly) 1 loop --- src/apps/testapps/testCellsToLinkedMultiPolygon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/testapps/testCellsToLinkedMultiPolygon.c b/src/apps/testapps/testCellsToLinkedMultiPolygon.c index 5d04480bf7..b5f00a7b5d 100644 --- a/src/apps/testapps/testCellsToLinkedMultiPolygon.c +++ b/src/apps/testapps/testCellsToLinkedMultiPolygon.c @@ -85,7 +85,7 @@ SUITE(cellsToLinkedMultiPolygon) { // Since these are the children of a cell, we exepect a single loop with // no holes. - t_assert(countLinkedLoops(&polygon) == 2, "1 loop added to polygon"); + t_assert(countLinkedLoops(&polygon) == 1, "1 loop added to polygon"); H3_EXPORT(destroyLinkedMultiPolygon)(&polygon); } From b7978f362ba74dcce484e35d8936941bd8c4e2ca Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Thu, 26 Sep 2024 17:30:28 -0700 Subject: [PATCH 06/10] try to test on both x86_64 and Apple Silicon --- .github/workflows/test-macos.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index b46d154c04..f197bf3aec 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -8,11 +8,12 @@ on: jobs: tests: - name: Test Compile ${{ matrix.build_type }} - runs-on: macos-latest + name: Test Compile ${{ matrix.build_type }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: matrix: + os: [macos-12, macos-13, macos-latest] build_type: ["Debug", "Release"] steps: From c30fb5ce9db45db5b68cc4a7980bb3383515300f Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Thu, 26 Sep 2024 17:58:05 -0700 Subject: [PATCH 07/10] for now, ensure all macos jobs run, even if one fails --- .github/workflows/test-macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index f197bf3aec..d86b1e5f58 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -12,6 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [macos-12, macos-13, macos-latest] build_type: ["Debug", "Release"] From e9a50e7b3921a8b33a8463776df4fa4a652552ac Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Thu, 26 Sep 2024 18:17:44 -0700 Subject: [PATCH 08/10] shorter name so we can see the OS version --- .github/workflows/test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index d86b1e5f58..c12e21d950 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -8,7 +8,7 @@ on: jobs: tests: - name: Test Compile ${{ matrix.build_type }} on ${{ matrix.os }} + name: ${{ matrix.build_type }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: From 8aed51348f20b4f65c402b490a8b31276e888974 Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Thu, 26 Sep 2024 19:44:37 -0700 Subject: [PATCH 09/10] Update src/apps/testapps/testCellsToLinkedMultiPolygon.c Co-authored-by: Isaac Brodsky --- src/apps/testapps/testCellsToLinkedMultiPolygon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/testapps/testCellsToLinkedMultiPolygon.c b/src/apps/testapps/testCellsToLinkedMultiPolygon.c index b5f00a7b5d..acb0003ed1 100644 --- a/src/apps/testapps/testCellsToLinkedMultiPolygon.c +++ b/src/apps/testapps/testCellsToLinkedMultiPolygon.c @@ -83,7 +83,7 @@ SUITE(cellsToLinkedMultiPolygon) { t_assertSuccess( H3_EXPORT(cellsToLinkedMultiPolygon)(kids, numCells, &polygon)); - // Since these are the children of a cell, we exepect a single loop with + // Since these are the children of a cell, we expect a single loop with // no holes. t_assert(countLinkedLoops(&polygon) == 1, "1 loop added to polygon"); From 61fc849c0aa1ea80f5e2660d0d6e75ac5218e043 Mon Sep 17 00:00:00 2001 From: AJ Friend Date: Thu, 26 Sep 2024 19:44:42 -0700 Subject: [PATCH 10/10] Update src/apps/testapps/testCellsToLinkedMultiPolygon.c Co-authored-by: Isaac Brodsky --- src/apps/testapps/testCellsToLinkedMultiPolygon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/testapps/testCellsToLinkedMultiPolygon.c b/src/apps/testapps/testCellsToLinkedMultiPolygon.c index acb0003ed1..7917fcc8f8 100644 --- a/src/apps/testapps/testCellsToLinkedMultiPolygon.c +++ b/src/apps/testapps/testCellsToLinkedMultiPolygon.c @@ -72,7 +72,7 @@ SUITE(cellsToLinkedMultiPolygon) { H3_EXPORT(destroyLinkedMultiPolygon)(&polygon); } - TEST(pentagonChldren) { + TEST(pentagonChildren) { // children of pentagon 0x80ebfffffffffff H3Index kids[] = {0x81ea3ffffffffff, 0x81eabffffffffff, 0x81eafffffffffff, 0x81eb3ffffffffff,