[05/36] test: ipa: ipa_interface: Use IPAManager::createIPA()
diff mbox series

Message ID 20260113000808.15395-6-laurent.pinchart@ideasonboard.com
State New
Headers show
Series
  • libcamera: Global configuration file improvements
Related show

Commit Message

Laurent Pinchart Jan. 13, 2026, 12:07 a.m. UTC
The goal of ipa_interface is to unit test the IPA interface. It
currently creates the IPA proxy through the higher level PipelineHandler
class. Use the IPAManager::createIPA() function instead to keep the
focus on the components that were meant to be tested.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/ipa/ipa_interface_test.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

--
Regards,

Laurent Pinchart

Patch
diff mbox series

diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
index ccff6ac106c8..41ef81721bfa 100644
--- a/test/ipa/ipa_interface_test.cpp
+++ b/test/ipa/ipa_interface_test.cpp
@@ -22,6 +22,8 @@ 

 #include "libcamera/internal/camera_manager.h"
 #include "libcamera/internal/device_enumerator.h"
+#include "libcamera/internal/global_configuration.h"
+#include "libcamera/internal/ipa_manager.h"
 #include "libcamera/internal/ipa_module.h"
 #include "libcamera/internal/pipeline_handler.h"

@@ -43,6 +45,8 @@  public:
 	{
 		delete notifier_;
 		ipa_.reset();
+		ipaManager_.reset();
+		config_.reset();
 		cameraManager_.reset();
 	}

@@ -90,6 +94,10 @@  protected:
 		notifier_ = new EventNotifier(fd_, EventNotifier::Read, this);
 		notifier_->activated.connect(this, &IPAInterfaceTest::readTrace);

+		/* Create the IPA manager. */
+		config_ = std::make_unique<GlobalConfiguration>();
+		ipaManager_ = std::make_unique<IPAManager>(*config_);
+
 		return TestPass;
 	}

@@ -98,7 +106,7 @@  protected:
 		EventDispatcher *dispatcher = thread()->eventDispatcher();
 		Timer timer;

-		ipa_ = pipe_->createIPA<ipa::vimc::IPAProxyVimc>(0, 0);
+		ipa_ = ipaManager_->createIPA<ipa::vimc::IPAProxyVimc>(pipe_.get(), 0, 0);
 		if (!ipa_) {
 			cerr << "Failed to create VIMC IPA interface" << endl;
 			return TestFail;
@@ -173,6 +181,8 @@  private:
 	std::shared_ptr<PipelineHandler> pipe_;
 	std::unique_ptr<ipa::vimc::IPAProxyVimc> ipa_;
 	std::unique_ptr<CameraManager> cameraManager_;
+	std::unique_ptr<GlobalConfiguration> config_;
+	std::unique_ptr<IPAManager> ipaManager_;
 	enum ipa::vimc::IPAOperationCode trace_;
 	EventNotifier *notifier_;
 	int fd_;