[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2023-10-04 16:05:46 +00:00
parent 501125ba4b
commit afb2062b61
2 changed files with 7 additions and 5 deletions

View File

@@ -122,4 +122,3 @@ TEST(GLContextMode, Shared) {
test::checkImage("test/fixtures/shared_context", frontend.render(map).image, 0.5, 0.1);
}

View File

@@ -21,11 +21,14 @@ TEST(GL, DrawModeType) {
namespace {
template <typename T>
auto enumIdentity(T x) { return Enum<T>::from(Enum<T>::to(x)); }
auto enumIdentity(T x) {
return Enum<T>::from(Enum<T>::to(x));
}
} // namespace
TEST(GL, ColorBlendEquationType) {
//const auto identity = [](auto x){ return Enum<ColorBlendEquationType>::from(Enum<ColorBlendEquationType>::to(x)); };
// const auto identity = [](auto x){ return Enum<ColorBlendEquationType>::from(Enum<ColorBlendEquationType>::to(x));
// };
ASSERT_EQ(ColorBlendEquationType::Add, enumIdentity(ColorBlendEquationType::Add));
ASSERT_EQ(ColorBlendEquationType::Subtract, enumIdentity(ColorBlendEquationType::Subtract));
ASSERT_EQ(ColorBlendEquationType::ReverseSubtract, enumIdentity(ColorBlendEquationType::ReverseSubtract));
@@ -50,7 +53,7 @@ TEST(GL, ColorBlendFactorType) {
ASSERT_EQ(ColorBlendFactorType::ConstantAlpha, enumIdentity(ColorBlendFactorType::ConstantAlpha));
ASSERT_EQ(ColorBlendFactorType::OneMinusConstantAlpha, enumIdentity(ColorBlendFactorType::OneMinusConstantAlpha));
ASSERT_EQ(ColorBlendFactorType::SrcAlphaSaturate, enumIdentity(ColorBlendFactorType::SrcAlphaSaturate));
ASSERT_EQ(GL_INVALID_ENUM, Enum<ColorBlendFactorType>::to(static_cast<ColorBlendFactorType>(-1)));
ASSERT_EQ(ColorBlendFactorType{}, Enum<ColorBlendFactorType>::from(GL_RGBA8));
}
@@ -64,7 +67,7 @@ TEST(GL, DepthFunctionType) {
ASSERT_EQ(DepthFunctionType::NotEqual, enumIdentity(DepthFunctionType::NotEqual));
ASSERT_EQ(DepthFunctionType::GreaterEqual, enumIdentity(DepthFunctionType::GreaterEqual));
ASSERT_EQ(DepthFunctionType::Always, enumIdentity(DepthFunctionType::Always));
ASSERT_EQ(GL_INVALID_ENUM, Enum<DepthFunctionType>::to(static_cast<DepthFunctionType>(-1)));
ASSERT_EQ(DepthFunctionType{}, Enum<DepthFunctionType>::from(GL_RGBA8));
}