From 364d1b62ae91fd7ae5cdd2c6c1563d5d68435a10 Mon Sep 17 00:00:00 2001 From: Joe Rivera Date: Fri, 1 May 2026 16:40:28 -0500 Subject: [PATCH] voxels_test: switch from cvcapp singleton to fixture-local ctx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test fixture already exposes a local cvc::app member named `ctx`; six call sites in the threading tests still used the cvcapp singleton. Replace cvcapp.X(...) with ctx.X(...) so the threading tests exercise the same per-fixture app the data flows through. Linux Debug build clean; ctest -R VoxelsTest 108/108 passed. Part of cvc-singleton-removal-plan.md (PR 8 — voxels piece). --- src/cvc/tests/voxels_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cvc/tests/voxels_test.cpp b/src/cvc/tests/voxels_test.cpp index f0962e80..582ce174 100644 --- a/src/cvc/tests/voxels_test.cpp +++ b/src/cvc/tests/voxels_test.cpp @@ -3250,14 +3250,14 @@ TEST_F(VoxelsCUDATest, MultithreadedCUDAOperations) { std::vector task_keys; // Set pool size - unsigned int original_pool_size = cvcapp.getThreadPoolSize(); - cvcapp.setThreadPoolSize(std::min(4u, boost::thread::hardware_concurrency())); + unsigned int original_pool_size = ctx.getThreadPoolSize(); + ctx.setThreadPoolSize(std::min(4u, boost::thread::hardware_concurrency())); for (int t = 0; t < num_threads; t++) { std::string key = "cuda_voxels_" + std::to_string(t); task_keys.push_back(key); - cvcapp.startThreadPooled( + ctx.startThreadPooled( key, [this, t, &success_count, dim]() { try { @@ -3289,15 +3289,15 @@ TEST_F(VoxelsCUDATest, MultithreadedCUDAOperations) { // Wait for all tasks to complete for (const auto &key : task_keys) { - if (cvcapp.hasThread(key)) { - thread_ptr tptr = cvcapp.threads(key); + if (ctx.hasThread(key)) { + thread_ptr tptr = ctx.threads(key); if (tptr) tptr->join(); } } // Restore original pool size - cvcapp.setThreadPoolSize(original_pool_size); + ctx.setThreadPoolSize(original_pool_size); EXPECT_EQ(success_count.load(), num_threads); }