#ifndef LCAMERA_DEV_TESTS_CATALOG_HELPERS_H
#define LCAMERA_DEV_TESTS_CATALOG_HELPERS_H

#include <bakedCameraProfiles.h>
#include <cameraIdentity.h>
#include <string>
#include <vector>

namespace lcamera_dev {
namespace tests {

inline CameraIdentityRecord profileToIdentityRecord(
	const test_fixtures::BakedCameraProfile& profile)
{
	CameraIdentityRecord record;
	record.id = profile.libcameraId;
	record.model = profile.model;
	record.locationLabel = profile.location;
	return record;
}

inline std::vector<CameraIdentityRecord> bakedProfilesAsRecords(
	const char *machineTag)
{
	std::vector<CameraIdentityRecord> records;

	for (std::size_t i = 0; i < test_fixtures::bakedCameraProfileCount; ++i)
	{
		const test_fixtures::BakedCameraProfile& profile =
			test_fixtures::bakedCameraProfiles[i];

		if (std::string(profile.machineTag) != machineTag) {
			continue;
		}

		records.push_back(profileToIdentityRecord(profile));
	}

	return records;
}

} // namespace tests
} // namespace lcamera_dev

#endif // LCAMERA_DEV_TESTS_CATALOG_HELPERS_H
