summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-04-27 02:36:18 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-04-28 01:54:49 +0300
commita6de9030893753e5428ee912fe7c52fbf93febd1 (patch)
treee82996e2e87c464919808663c443a3dcb99ea887 /test
parent26a4b03ed85e0cc39939028964ae4a8961c05d02 (diff)
ipa: Pass IPA initialization settings to IPAInterface::init()
Add a new IPASettings class to pass IPA initialization settings through the IPAInterface::init() method. The settings currently only contain the name of a configuration file, and are expected to be extended later. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'test')
-rw-r--r--test/ipa/ipa_interface_test.cpp3
-rw-r--r--test/ipa/ipa_wrappers_test.cpp13
2 files changed, 13 insertions, 3 deletions
diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
index 22f9ca41..2e2dfb8d 100644
--- a/test/ipa/ipa_interface_test.cpp
+++ b/test/ipa/ipa_interface_test.cpp
@@ -98,7 +98,8 @@ protected:
}
/* Test initialization of IPA module. */
- ipa_->init();
+ IPASettings settings;
+ ipa_->init(settings);
timer.start(1000);
while (timer.isRunning() && trace_ != IPAOperationInit)
dispatcher->processEvents();
diff --git a/test/ipa/ipa_wrappers_test.cpp b/test/ipa/ipa_wrappers_test.cpp
index fae1d56b..21bf51a2 100644
--- a/test/ipa/ipa_wrappers_test.cpp
+++ b/test/ipa/ipa_wrappers_test.cpp
@@ -43,8 +43,14 @@ public:
{
}
- int init() override
+ int init(const IPASettings &settings) override
{
+ if (settings.configurationFile != "/ipa/configuration/file") {
+ cerr << "init(): Invalid configuration file" << endl;
+ report(Op_init, TestFail);
+ return 0;
+ }
+
report(Op_init, TestPass);
return 0;
}
@@ -339,7 +345,10 @@ protected:
* Test init(), start() and stop() last to ensure nothing in the
* wrappers or serializer depends on them being called first.
*/
- ret = INVOKE(init);
+ IPASettings settings{
+ .configurationFile = "/ipa/configuration/file"
+ };
+ ret = INVOKE(init, settings);
if (ret == TestFail) {
cerr << "Failed to run init()";
return TestFail;