From 94d07c949eab30d243805055e956c7383c71a017 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Tue, 19 Dec 2023 06:40:49 +0100 Subject: [PATCH] [MultiThreading] Fix failing test on ParallelImplementationsRegistry (#4392) * More details when test fails * Test initializing the module at init --- .../MultiThreading/src/MultiThreading/initMultiThreading.cpp | 4 ++++ .../test/ParallelImplementationsRegistry_test.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/applications/plugins/MultiThreading/src/MultiThreading/initMultiThreading.cpp b/applications/plugins/MultiThreading/src/MultiThreading/initMultiThreading.cpp index b2defc710f77..6220f2b4ddbf 100644 --- a/applications/plugins/MultiThreading/src/MultiThreading/initMultiThreading.cpp +++ b/applications/plugins/MultiThreading/src/MultiThreading/initMultiThreading.cpp @@ -22,6 +22,9 @@ #include #include +#include + + namespace multithreading { @@ -39,6 +42,7 @@ void init() static bool first = true; if (first) { + sofa::component::linearsolver::iterative::init(); first = false; } } diff --git a/applications/plugins/MultiThreading/test/ParallelImplementationsRegistry_test.cpp b/applications/plugins/MultiThreading/test/ParallelImplementationsRegistry_test.cpp index 4a8254b2541f..83d38f230669 100644 --- a/applications/plugins/MultiThreading/test/ParallelImplementationsRegistry_test.cpp +++ b/applications/plugins/MultiThreading/test/ParallelImplementationsRegistry_test.cpp @@ -36,8 +36,8 @@ TEST(ParallelImplementationsRegistry, existInObjectFactory) ASSERT_FALSE(seq.empty()); ASSERT_FALSE(par.empty()); - EXPECT_TRUE(sofa::core::ObjectFactory::getInstance()->hasCreator(seq)); - EXPECT_TRUE(sofa::core::ObjectFactory::getInstance()->hasCreator(par)); + EXPECT_TRUE(sofa::core::ObjectFactory::getInstance()->hasCreator(seq)) << seq; + EXPECT_TRUE(sofa::core::ObjectFactory::getInstance()->hasCreator(par)) << par; } } }