summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/algorithms/dpf.h
diff options
context:
space:
mode:
authorDaniel Scally <dan.scally@ideasonboard.com>2024-08-20 14:07:39 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-08-21 03:11:36 +0300
commitbe2182d23971a13512507d6b07cd6111a8b079bb (patch)
tree6bb59d6039958e63b2a326ac43d9cefee5b5727f /src/ipa/rkisp1/algorithms/dpf.h
parent69d11d29a202f91bfcf1dc3a5d3a1ab0f56b8463 (diff)
Documentation: Add internal-api-html placeholder
Mimicking the existing api-html placeholder, add a placeholder for the internal version of the Doxygen generated API documentation so that the website can generate hyperlinks to it properly. Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1/algorithms/dpf.h')
0 files changed, 0 insertions, 0 deletions
18' href='#n118'>118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (C) 2021, Google Inc.
 *
 * UniqueFD test
 */

#include <fcntl.h>
#include <iostream>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

#include <libcamera/base/unique_fd.h>
#include <libcamera/base/utils.h>

#include "test.h"

using namespace libcamera;
using namespace std;

class UniqueFDTest : public Test
{
protected:
	int init() override
	{
		return createFd();
	}

	int run() override
	{
		/* Test creating empty UniqueFD. */
		UniqueFD fd;

		if (fd.isValid() || fd.get() != -1) {
			std::cout << "Failed fd check (default constructor)"
				  << std::endl;
			return TestFail;
		}

		/* Test creating UniqueFD from numerical file descriptor. */
		UniqueFD fd2(fd_);
		if (!fd2.isValid() || fd2.get() != fd_) {
			std::cout << "Failed fd check (fd constructor)"
				  << std::endl;
			return TestFail;
		}

		if (!isValidFd(fd_)) {
			std::cout << "Failed fd validity (fd constructor)"
				  << std::endl;
			return TestFail;
		}

		/* Test move constructor. */
		UniqueFD fd3(std::move(fd2));
		if (!fd3.isValid() || fd3.get() != fd_) {
			std::cout << "Failed fd check (move constructor)"
				  << std::endl;
			return TestFail;
		}

		if (fd2.isValid() || fd2.get() != -1) {
			std::cout << "Failed moved fd check (move constructor)"
				  << std::endl;
			return TestFail;
		}

		if (!isValidFd(fd_)) {
			std::cout << "Failed fd validity (move constructor)"
				  << std::endl;
			return TestFail;
		}

		/* Test move assignment operator. */
		fd = std::move(fd3);
		if (!fd.isValid() || fd.get() != fd_) {
			std::cout << "Failed fd check (move assignment)"
				  << std::endl;
			return TestFail;
		}

		if (fd3.isValid() || fd3.get() != -1) {
			std::cout << "Failed moved fd check (move assignment)"
				  << std::endl;
			return TestFail;
		}

		if (!isValidFd(fd_)) {
			std::cout << "Failed fd validity (move assignment)"
				  << std::endl;
			return TestFail;
		}

		/* Test swapping. */
		fd2.swap(fd);