mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 14:58:10 -05:00
Change cpp unit test framework to catch2 for all cpp unit test projects
This commit is contained in:
@ -1,22 +1,17 @@
|
||||
#include "CppUnitTest.h"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#include "Image/ImageFormat.h"
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
||||
namespace ObjCommonTests
|
||||
namespace image::image_format
|
||||
{
|
||||
TEST_CLASS(ImageFormatTests)
|
||||
TEST_CASE("ImageFormat: EnsureAllFormatsArrayIndicesAreIds", "[image]")
|
||||
{
|
||||
public:
|
||||
TEST_METHOD(EnsureAllFormatsArrayIndicesAreIds)
|
||||
{
|
||||
Assert::AreEqual(static_cast<unsigned int>(ImageFormatId::MAX), _countof(ImageFormat::ALL_FORMATS));
|
||||
REQUIRE(static_cast<unsigned int>(ImageFormatId::MAX) == _countof(ImageFormat::ALL_FORMATS));
|
||||
|
||||
for(unsigned i = 0; i < _countof(ImageFormat::ALL_FORMATS); i++)
|
||||
{
|
||||
Assert::IsNotNull(ImageFormat::ALL_FORMATS[i]);
|
||||
Assert::AreEqual(i, static_cast<unsigned>(ImageFormat::ALL_FORMATS[i]->GetId()));
|
||||
}
|
||||
for(unsigned i = 0; i < _countof(ImageFormat::ALL_FORMATS); i++)
|
||||
{
|
||||
REQUIRE(ImageFormat::ALL_FORMATS[i] != nullptr);
|
||||
REQUIRE(i == static_cast<unsigned>(ImageFormat::ALL_FORMATS[i]->GetId()));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
2
test/ObjCommonTests/main.cpp
Normal file
2
test/ObjCommonTests/main.cpp
Normal file
@ -0,0 +1,2 @@
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include <catch2/catch.hpp>
|
Reference in New Issue
Block a user