diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 963dc230..c2f82852 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -44,10 +44,9 @@ jobs: cmake_args: "-DCODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug" run_coverage: true build_type: "Debug" - - name: "Coverage" + - name: "Test" os: macos-14 - cmake_args: "-DCODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug" - run_coverage: true # (this is breaking for some reason @TODO) + cmake_args: "-DCMAKE_BUILD_TYPE=Debug" build_type: "Debug" - name: "Live GUI Test" os: ubuntu-22.04 @@ -58,10 +57,8 @@ jobs: build_type: "Debug" exclude: # so we don't break GitHub Actions concurrency limit - - name: "Test" + - name: "Coverage" os: macos-14 -# - name: "Coverage" -# os: macos-14 - name: "Coverage" os: windows-2022 diff --git a/modules/common/chowdsp_data_structures/Structures/chowdsp_AbstractTree.cpp b/modules/common/chowdsp_data_structures/Structures/chowdsp_AbstractTree.cpp index 7ef98851..ed104136 100644 --- a/modules/common/chowdsp_data_structures/Structures/chowdsp_AbstractTree.cpp +++ b/modules/common/chowdsp_data_structures/Structures/chowdsp_AbstractTree.cpp @@ -170,9 +170,16 @@ OptionalRef AbstractTree::findElement (co } template -const OptionalRef AbstractTree::findElement (const ElementType& element) const +OptionalRef AbstractTree::findElement (const ElementType& element) const { - return const_cast (*this).findElement (element); // NOSONAR + OptionalRef result {}; + doForAllElements ( + [&result, element] (const ElementType& candidate) + { + if (element == candidate) + result = candidate; + }); + return result; } template diff --git a/modules/common/chowdsp_data_structures/Structures/chowdsp_AbstractTree.h b/modules/common/chowdsp_data_structures/Structures/chowdsp_AbstractTree.h index cb8cf0aa..7ef847dc 100644 --- a/modules/common/chowdsp_data_structures/Structures/chowdsp_AbstractTree.h +++ b/modules/common/chowdsp_data_structures/Structures/chowdsp_AbstractTree.h @@ -63,7 +63,7 @@ class AbstractTree [[nodiscard]] OptionalRef findElement (const ElementType& element); /** Checks if the tree currently contains an element. If true, then return the element, else return nullptr. */ - [[nodiscard]] const OptionalRef findElement (const ElementType& element) const; + [[nodiscard]] OptionalRef findElement (const ElementType& element) const; template void doForAllNodes (Callable&& callable);