summaryrefslogtreecommitdiff
path: root/src/qcam/assets/feathericons/codepen.svg
blob: ab2a815aa1cf392e2ccc8348ed7a960ecbac9db8 (plain)
1
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-codepen"><polygon points="12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2"></polygon><line x1="12" y1="22" x2="12" y2="15.5"></line><polyline points="22 8.5 12 15.5 2 8.5"></polyline><polyline points="2 15.5 12 8.5 22 15.5"></polyline><line x1="12" y1="2" x2="12" y2="8.5"></line></svg>
> 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * load-so.cpp - loading .so tests
 */

#include <iostream>
#include <string.h>

#include "ipa_module.h"

#include "test.h"

using namespace std;
using namespace libcamera;

class IPAModuleTest : public Test
{
protected:
	int runTest(const string &path, const struct IPAModuleInfo &testInfo)
	{
		int ret = 0;

		IPAModule *ll = new IPAModule(path);

		if (!ll->isValid()) {
			cerr << "test IPA module " << path << " is invalid"
			     << endl;
			delete ll;
			return -1;
		}

		const struct IPAModuleInfo &info = ll->info();

		if (memcmp(&info, &testInfo, sizeof(info))) {
			cerr << "IPA module information mismatch: expected:" << endl
			     << "moduleAPIVersion = "     << testInfo.moduleAPIVersion << endl
			     << "pipelineVersion = "      << testInfo.pipelineVersion << endl
			     << "pipelineName = "         << testInfo.pipelineName << endl
			     << "name = "                 << testInfo.name
			     << "got: " << endl
			     << "moduleAPIVersion = "     << info.moduleAPIVersion << endl
			     << "pipelineVersion = "      << info.pipelineVersion << endl
			     << "pipelineName = "         << info.pipelineName << endl
			     << "name = "                 << info.name << endl;
		}

		delete ll;
		return ret;
	}

	int run() override
	{
		int count = 0;

		const struct IPAModuleInfo testInfo = {
			IPA_MODULE_API_VERSION,
			0,
			"PipelineHandlerVimc",
			"Dummy IPA for Vimc",
			"GPL-2.0-or-later",
		};

		count += runTest("src/ipa/ipa_dummy.so", testInfo);

		if (count < 0)
			return TestFail;

		return TestPass;
	}
};

TEST_REGISTER(IPAModuleTest)