mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 16:45:44 +00:00
20 lines
686 B
C++
20 lines
686 B
C++
#include "Image/ImageFormat.h"
|
|
|
|
#include <catch2/catch_test_macros.hpp>
|
|
#include <catch2/generators/catch_generators.hpp>
|
|
#include <type_traits>
|
|
|
|
namespace image::image_format
|
|
{
|
|
TEST_CASE("ImageFormat: EnsureAllFormatsArrayIndicesAreIds", "[image]")
|
|
{
|
|
REQUIRE(static_cast<unsigned int>(ImageFormatId::MAX) == std::extent<decltype(ImageFormat::ALL_FORMATS)>::value);
|
|
|
|
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()));
|
|
}
|
|
}
|
|
} // namespace image::image_format
|