diff --git a/libs/pigment/tests/TestKoColorSpaceRegistry.cpp b/libs/pigment/tests/TestKoColorSpaceRegistry.cpp index 6ced82e135..1ba216a4fd 100644 --- a/libs/pigment/tests/TestKoColorSpaceRegistry.cpp +++ b/libs/pigment/tests/TestKoColorSpaceRegistry.cpp @@ -1,68 +1,68 @@ /* * Copyright (c) 2010 Cyrille Berger * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "TestKoColorSpaceRegistry.h" #include #include #include #include -TestColorSpaceRegistry::TestColorSpaceRegistry() +TestBaseColorSpaceRegistry::TestBaseColorSpaceRegistry() { } -void TestColorSpaceRegistry::testLab16() +void TestBaseColorSpaceRegistry::testLab16() { const KoColorSpace* cs = KoColorSpaceRegistry::instance()->lab16(); QCOMPARE(cs->colorModelId().id(), LABAColorModelID.id()); QCOMPARE(cs->colorDepthId().id(), Integer16BitsColorDepthID.id()); QVERIFY(*cs == *KoColorSpaceRegistry::instance()->colorSpace(LABAColorModelID.id(), Integer16BitsColorDepthID.id(), 0)); } -void TestColorSpaceRegistry::testRgb8() +void TestBaseColorSpaceRegistry::testRgb8() { const KoColorSpace* cs = KoColorSpaceRegistry::instance()->rgb8(); QCOMPARE(cs->colorModelId().id(), RGBAColorModelID.id()); QCOMPARE(cs->colorDepthId().id(), Integer8BitsColorDepthID.id()); QVERIFY(*cs == *KoColorSpaceRegistry::instance()->colorSpace(RGBAColorModelID.id(), Integer8BitsColorDepthID.id(), 0)); } -void TestColorSpaceRegistry::testRgb16() +void TestBaseColorSpaceRegistry::testRgb16() { const KoColorSpace* cs = KoColorSpaceRegistry::instance()->rgb16(); QCOMPARE(cs->colorModelId().id(), RGBAColorModelID.id()); QCOMPARE(cs->colorDepthId().id(), Integer16BitsColorDepthID.id()); QVERIFY(*cs == *KoColorSpaceRegistry::instance()->colorSpace(RGBAColorModelID.id(), Integer16BitsColorDepthID.id(), 0)); } -void TestColorSpaceRegistry::testProfileByUniqueId() +void TestBaseColorSpaceRegistry::testProfileByUniqueId() { const KoColorSpace* cs = KoColorSpaceRegistry::instance()->rgb16(); const KoColorProfile *profile = cs->profile(); QVERIFY(profile); const KoColorProfile *fetchedProfile = KoColorSpaceRegistry::instance()->profileByUniqueId(profile->uniqueId()); QCOMPARE(*fetchedProfile, *profile); } -QTEST_GUILESS_MAIN(TestColorSpaceRegistry) +QTEST_GUILESS_MAIN(TestBaseColorSpaceRegistry) diff --git a/plugins/color/lcms2engine/tests/CMakeLists.txt b/plugins/color/lcms2engine/tests/CMakeLists.txt index 4f1230e01c..324479bb75 100644 --- a/plugins/color/lcms2engine/tests/CMakeLists.txt +++ b/plugins/color/lcms2engine/tests/CMakeLists.txt @@ -1,32 +1,32 @@ add_definitions(-DFILES_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data/") set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) include_directories( ../colorspaces/cmyk_u16 ../colorspaces/cmyk_u8 ../colorspaces/gray_u16 ../colorspaces/gray_u8 ../colorspaces/lab_u16 ../colorspaces/rgb_u16 ../colorspaces/rgb_u8 ../colorspaces/xyz_u16 ../colorprofiles .. ) if(OPENEXR_FOUND) include_directories(SYSTEM ${OPENEXR_INCLUDE_DIR}) endif() include_directories( ${LCMS2_INCLUDE_DIR} ) if(MSVC OR (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")) # avoid "cannot open file 'LIBC.lib'" error set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBC.LIB") endif() ecm_add_tests( TestKoLcmsColorProfile.cpp - TestKoColorSpaceRegistry.cpp + TestColorSpaceRegistry.cpp TestLcmsRGBP2020PQColorSpace.cpp NAME_PREFIX "plugins-lcmsengine-" LINK_LIBRARIES kritawidgets kritapigment KF5::I18n Qt5::Test ${LCMS2_LIBRARIES}) diff --git a/plugins/color/lcms2engine/tests/TestKoColorSpaceRegistry.cpp b/plugins/color/lcms2engine/tests/TestColorSpaceRegistry.cpp similarity index 92% rename from plugins/color/lcms2engine/tests/TestKoColorSpaceRegistry.cpp rename to plugins/color/lcms2engine/tests/TestColorSpaceRegistry.cpp index fa87fde80b..088cd641b8 100644 --- a/plugins/color/lcms2engine/tests/TestKoColorSpaceRegistry.cpp +++ b/plugins/color/lcms2engine/tests/TestColorSpaceRegistry.cpp @@ -1,91 +1,91 @@ -#include "TestKoColorSpaceRegistry.h" +#include "TestColorSpaceRegistry.h" #include #include "KoColorSpaceRegistry.h" #include "KoColorSpace.h" #include "RgbU8ColorSpace.h" #include "RgbU16ColorSpace.h" #include "LabColorSpace.h" #include "sdk/tests/kistest.h" -void TestKoColorSpaceRegistry::testConstruction() +void TestColorSpaceRegistry::testConstruction() { KoColorSpaceRegistry *instance = KoColorSpaceRegistry::instance(); Q_ASSERT(instance); } -void TestKoColorSpaceRegistry::testRgbU8() +void TestColorSpaceRegistry::testRgbU8() { const QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(RGBAColorModelID, Integer8BitsColorDepthID); const KoColorSpace *colorSpace = KoColorSpaceRegistry::instance()->rgb8(); QVERIFY(colorSpace != 0); const KoColorProfile *profile = colorSpace->profile(); QVERIFY(profile != 0); QCOMPARE(profile->name(), KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(colorSpaceId)); cmsHPROFILE lcmsProfile = cmsCreate_sRGBProfile(); QString testProfileName = "TestRGBU8ProfileName"; cmsWriteTag(lcmsProfile, cmsSigProfileDescriptionTag, testProfileName.toLatin1().constData()); cmsWriteTag(lcmsProfile, cmsSigDeviceModelDescTag, testProfileName.toLatin1().constData()); cmsWriteTag(lcmsProfile, cmsSigDeviceMfgDescTag, ""); } -void TestKoColorSpaceRegistry::testRgbU16() +void TestColorSpaceRegistry::testRgbU16() { const QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(RGBAColorModelID, Integer16BitsColorDepthID); const KoColorSpace *colorSpace = KoColorSpaceRegistry::instance()->rgb16(); QVERIFY(colorSpace != 0); const KoColorProfile *profile = colorSpace->profile(); QVERIFY(profile != 0); QCOMPARE(profile->name(), KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(colorSpaceId)); cmsHPROFILE lcmsProfile = cmsCreate_sRGBProfile(); QString testProfileName = "TestRGBU16ProfileName"; cmsWriteTag(lcmsProfile, cmsSigProfileDescriptionTag, testProfileName.toLatin1().constData()); cmsWriteTag(lcmsProfile, cmsSigDeviceModelDescTag, testProfileName.toLatin1().constData()); cmsWriteTag(lcmsProfile, cmsSigDeviceMfgDescTag, ""); } -void TestKoColorSpaceRegistry::testLab() +void TestColorSpaceRegistry::testLab() { const QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(LABAColorModelID, Integer16BitsColorDepthID); const KoColorSpace *colorSpace = KoColorSpaceRegistry::instance()->lab16(); QVERIFY(colorSpace != 0); const KoColorProfile *profile = colorSpace->profile(); QVERIFY(profile != 0); QCOMPARE(profile->name(), KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(colorSpaceId)); cmsCIExyY whitepoint; whitepoint.x = 0.33; whitepoint.y = 0.33; whitepoint.Y = 1.0; cmsHPROFILE lcmsProfile = cmsCreateLab2Profile(&whitepoint); QString testProfileName = "TestLabProfileName"; cmsWriteTag(lcmsProfile, cmsSigProfileDescriptionTag, testProfileName.toLatin1().constData()); cmsWriteTag(lcmsProfile, cmsSigDeviceModelDescTag, testProfileName.toLatin1().constData()); cmsWriteTag(lcmsProfile, cmsSigDeviceMfgDescTag, ""); } -KISTEST_MAIN(TestKoColorSpaceRegistry) +KISTEST_MAIN(TestColorSpaceRegistry) diff --git a/plugins/color/lcms2engine/tests/TestKoColorSpaceRegistry.h b/plugins/color/lcms2engine/tests/TestColorSpaceRegistry.h similarity index 82% rename from plugins/color/lcms2engine/tests/TestKoColorSpaceRegistry.h rename to plugins/color/lcms2engine/tests/TestColorSpaceRegistry.h index 18badc9daa..cdae8a670a 100644 --- a/plugins/color/lcms2engine/tests/TestKoColorSpaceRegistry.h +++ b/plugins/color/lcms2engine/tests/TestColorSpaceRegistry.h @@ -1,16 +1,16 @@ #ifndef TESTKOCOLORSPACEREGISTRY_H #define TESTKOCOLORSPACEREGISTRY_H #include -class TestKoColorSpaceRegistry : public QObject +class TestColorSpaceRegistry : public QObject { Q_OBJECT private Q_SLOTS: void testConstruction(); void testRgbU8(); void testRgbU16(); void testLab(); }; #endif