Commit 30d755f9 authored by Halla Rempt's avatar Halla Rempt
Browse files

fix unittest

parent e4e65db0
......@@ -27,47 +27,47 @@
void KoCtlColorSpaceInfoTest::testCreation()
{
KoCtlColorSpaceInfo info(FILES_DATA_DIR + QString("rgba32f.ctlcs"));
KoCtlColorSpaceInfo info(FILES_DATA_DIR + QString("rgba16f.ctlcs"));
QVERIFY(info.load());
QCOMPARE(info.colorDepthId().id(), QString("F32"));
QCOMPARE(info.colorDepthId().id(), QString("F16"));
QCOMPARE(info.colorModelId().id(), QString("RGBA"));
QCOMPARE(info.colorModelId().name(), QString("Red Green Blue"));
QCOMPARE(info.colorSpaceId(), QString("RgbAF32"));
QCOMPARE(info.name(), QString("RGB (32-bit float/channel) for High Dynamic Range imaging"));
QCOMPARE(info.colorSpaceId(), QString("RgbAF16"));
QCOMPARE(info.name(), QString("RGB (16-bit float/channel) for High Dynamic Range imaging"));
QCOMPARE(info.defaultProfile(), QString("Standard Linear RGB (scRGB/sRGB64)"));
QVERIFY(info.isHdr());
QCOMPARE(info.colorChannelCount(), 3U);
QCOMPARE(info.pixelSize(), 16U);
QCOMPARE(info.pixelSize(), 8U);
QCOMPARE(info.channels().size(), 4);
const KoCtlColorSpaceInfo::ChannelInfo* redChannel = info.channels()[0];
QCOMPARE(redChannel->name(), QString("Red"));
QCOMPARE(redChannel->shortName(), QString("r"));
QCOMPARE(redChannel->index(), 2);
QCOMPARE(redChannel->position(), 8);
QCOMPARE(redChannel->position(), 4);
QCOMPARE(redChannel->channelType(), KoChannelInfo::COLOR);
QCOMPARE(redChannel->valueType(), KoChannelInfo::FLOAT32);
QCOMPARE(redChannel->size(), 4);
QCOMPARE(redChannel->valueType(), KoChannelInfo::FLOAT16);
QCOMPARE(redChannel->size(), 2);
QCOMPARE(redChannel->color(), QColor(255, 0, 0));
const KoCtlColorSpaceInfo::ChannelInfo* alphaChannel = info.channels()[3];
QCOMPARE(alphaChannel->name(), QString("Alpha"));
QCOMPARE(alphaChannel->shortName(), QString("a"));
QCOMPARE(alphaChannel->index(), 3);
QCOMPARE(alphaChannel->position(), 12);
QCOMPARE(alphaChannel->position(), 6);
QCOMPARE(alphaChannel->channelType(), KoChannelInfo::ALPHA);
QCOMPARE(alphaChannel->valueType(), KoChannelInfo::FLOAT32);
QCOMPARE(alphaChannel->size(), 4);
QCOMPARE(alphaChannel->valueType(), KoChannelInfo::FLOAT16);
QCOMPARE(alphaChannel->size(), 2);
QCOMPARE(alphaChannel->color(), QColor(0, 0, 0));
const GTLCore::PixelDescription& pd = info.pixelDescription();
QCOMPARE(qint32(pd.channels()), 4);
QCOMPARE(qint32(pd.alphaPos()), 3);
QCOMPARE(pd.channelTypes()[0], GTLCore::Type::Float32);
QCOMPARE(pd.channelTypes()[1], GTLCore::Type::Float32);
QCOMPARE(pd.channelTypes()[2], GTLCore::Type::Float32);
QCOMPARE(pd.channelTypes()[3], GTLCore::Type::Float32);
QCOMPARE(pd.channelTypes()[0], GTLCore::Type::Float16);
QCOMPARE(pd.channelTypes()[1], GTLCore::Type::Float16);
QCOMPARE(pd.channelTypes()[2], GTLCore::Type::Float16);
QCOMPARE(pd.channelTypes()[3], GTLCore::Type::Float16);
QCOMPARE(pd.hasSameTypeChannels(), true);
QCOMPARE(qint32(pd.bitsSize()), qint32(8 * info.pixelSize()));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment