|
|
|
@ -50,6 +50,8 @@ struct FilterTest: TestSuite::Tester { |
|
|
|
void attributesLayers(); |
|
|
|
void attributesLayers(); |
|
|
|
void attributesLayersRemoveBaseLayer(); |
|
|
|
void attributesLayersRemoveBaseLayer(); |
|
|
|
void attributesLayersWrongBitCount(); |
|
|
|
void attributesLayersWrongBitCount(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void emptyInput(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FilterTest::FilterTest() { |
|
|
|
FilterTest::FilterTest() { |
|
|
|
@ -63,7 +65,9 @@ FilterTest::FilterTest() { |
|
|
|
|
|
|
|
|
|
|
|
&FilterTest::attributesLayers, |
|
|
|
&FilterTest::attributesLayers, |
|
|
|
&FilterTest::attributesLayersRemoveBaseLayer, |
|
|
|
&FilterTest::attributesLayersRemoveBaseLayer, |
|
|
|
&FilterTest::attributesLayersWrongBitCount}); |
|
|
|
&FilterTest::attributesLayersWrongBitCount, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&FilterTest::emptyInput}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
using namespace Math::Literals; |
|
|
|
using namespace Math::Literals; |
|
|
|
@ -318,6 +322,25 @@ void FilterTest::attributesLayersWrongBitCount() { |
|
|
|
"MaterialTools::filterAttributesLayers(): expected 2 layer bits but got 3\n"); |
|
|
|
"MaterialTools::filterAttributesLayers(): expected 2 layer bits but got 3\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FilterTest::emptyInput() { |
|
|
|
|
|
|
|
Trade::MaterialData empty{Trade::MaterialType::PbrClearCoat, {}}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* We have no attributes but we always have one implicit layer */ |
|
|
|
|
|
|
|
const bool yes[1]{}; |
|
|
|
|
|
|
|
Containers::BitArrayView layersToKeep{yes, 0, 1}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* It shouldn't assert or do any other crazy thing */ |
|
|
|
|
|
|
|
CORRADE_COMPARE_AS(filterAttributes(empty, nullptr), |
|
|
|
|
|
|
|
empty, |
|
|
|
|
|
|
|
DebugTools::CompareMaterial); |
|
|
|
|
|
|
|
CORRADE_COMPARE_AS(filterLayers(empty, layersToKeep), |
|
|
|
|
|
|
|
empty, |
|
|
|
|
|
|
|
DebugTools::CompareMaterial); |
|
|
|
|
|
|
|
CORRADE_COMPARE_AS(filterAttributesLayers(empty, nullptr, layersToKeep), |
|
|
|
|
|
|
|
empty, |
|
|
|
|
|
|
|
DebugTools::CompareMaterial); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}}}} |
|
|
|
}}}} |
|
|
|
|
|
|
|
|
|
|
|
CORRADE_TEST_MAIN(Magnum::MaterialTools::Test::FilterTest) |
|
|
|
CORRADE_TEST_MAIN(Magnum::MaterialTools::Test::FilterTest) |
|
|
|
|