move parts to new common component to avoid circular dependency of zonecommon and objcommon

This commit is contained in:
Jan
2021-03-03 12:56:15 -08:00
parent d616738be4
commit 12461d27e7
38 changed files with 70 additions and 22 deletions

View File

@ -1,14 +1,16 @@
#include <catch2/catch.hpp>
#include <type_traits>
#include "Image/ImageFormat.h"
namespace image::image_format
{
TEST_CASE("ImageFormat: EnsureAllFormatsArrayIndicesAreIds", "[image]")
{
REQUIRE(static_cast<unsigned int>(ImageFormatId::MAX) == _countof(ImageFormat::ALL_FORMATS));
REQUIRE(static_cast<unsigned int>(ImageFormatId::MAX) == std::extent<decltype(ImageFormat::ALL_FORMATS)>::value);
for(unsigned i = 0; i < _countof(ImageFormat::ALL_FORMATS); i++)
for(unsigned i = 0; i < std::extent<decltype(ImageFormat::ALL_FORMATS)>::value; i++)
{
REQUIRE(ImageFormat::ALL_FORMATS[i] != nullptr);
REQUIRE(i == static_cast<unsigned>(ImageFormat::ALL_FORMATS[i]->GetId()));