diff options
author | Marti Maria <info@littlecms.com> | 2012-08-06 19:04:28 +0200 |
---|---|---|
committer | Marti Maria <info@littlecms.com> | 2012-08-06 19:04:28 +0200 |
commit | 493aac084b7df46e24ec86ffb6395e5d11cddfba (patch) | |
tree | 30af8c5935110ecd329735c791df9798f8fb0cbc /testbed | |
parent | 8b13ad6a80ce0f2e19301083c4313988ae0f8c38 (diff) | |
download | lcms2-493aac084b7df46e24ec86ffb6395e5d11cddfba.tar.gz |
Prepare for 2.4
Diffstat (limited to 'testbed')
-rw-r--r-- | testbed/Makefile.am | 2 | ||||
-rw-r--r-- | testbed/Makefile.in | 4 | ||||
-rw-r--r-- | testbed/testcms2.c | 53 |
3 files changed, 57 insertions, 2 deletions
diff --git a/testbed/Makefile.am b/testbed/Makefile.am index dccb407..7961a42 100644 --- a/testbed/Makefile.am +++ b/testbed/Makefile.am @@ -9,7 +9,7 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/sr check_PROGRAMS = testcms -CFLAGS = --pedantic -Wall -std=c99 -O2 +# CFLAGS = --pedantic -Wall -std=c99 -O2 testcms_LDADD = $(top_builddir)/src/liblcms2.la testcms_LDFLAGS = @LDFLAGS@ diff --git a/testbed/Makefile.in b/testbed/Makefile.in index 76977df..db8622c 100644 --- a/testbed/Makefile.in +++ b/testbed/Makefile.in @@ -81,7 +81,7 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ -CFLAGS = --pedantic -Wall -std=c99 -O2 +CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ @@ -207,6 +207,8 @@ top_srcdir = @top_srcdir@ # Don't require all the GNU mandated files AUTOMAKE_OPTIONS = 1.7 foreign INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src + +# CFLAGS = --pedantic -Wall -std=c99 -O2 testcms_LDADD = $(top_builddir)/src/liblcms2.la testcms_LDFLAGS = @LDFLAGS@ testcms_SOURCES = testcms2.c diff --git a/testbed/testcms2.c b/testbed/testcms2.c index 6e18dfd..aa1f4a3 100644 --- a/testbed/testcms2.c +++ b/testbed/testcms2.c @@ -670,6 +670,8 @@ void RemoveTestProfiles(void) remove("bchslcms2.icc"); remove("lcms2cmyk.icc"); remove("glablcms2.icc"); + remove("lcms2link.icc"); + remove("lcms2link2.icc"); } // ------------------------------------------------------------------------------------------------- @@ -7040,6 +7042,56 @@ int CheckMD5(void) } + +static +int CheckLinking(void) +{ + cmsHPROFILE h; + cmsPipeline * pipeline; + cmsStage *stageBegin, *stageEnd; + + // Create a CLUT based profile + h = cmsCreateInkLimitingDeviceLinkTHR(DbgThread(), cmsSigCmykData, 150); + + // link a second tag + cmsLinkTag(h, cmsSigAToB1Tag, cmsSigAToB0Tag); + + // Save the linked devicelink + if (!cmsSaveProfileToFile(h, "lcms2link.icc")) return 0; + cmsCloseProfile(h); + + // Now open the profile and read the pipeline + h = cmsOpenProfileFromFile("lcms2link.icc", "r"); + if (h == NULL) return 0; + + pipeline = (cmsPipeline*) cmsReadTag(h, cmsSigAToB1Tag); + if (pipeline == NULL) + { + return 0; + } + + pipeline = cmsPipelineDup(pipeline); + + // extract stage from pipe line + cmsPipelineUnlinkStage(pipeline, cmsAT_BEGIN, &stageBegin); + cmsPipelineUnlinkStage(pipeline, cmsAT_END, &stageEnd); + cmsPipelineInsertStage(pipeline, cmsAT_END, stageEnd); + cmsPipelineInsertStage(pipeline, cmsAT_BEGIN, stageBegin); + + if (cmsTagLinkedTo(h, cmsSigAToB1Tag) != cmsSigAToB0Tag) return 0; + + cmsWriteTag(h, cmsSigAToB0Tag, pipeline); + cmsPipelineFree(pipeline); + + if (!cmsSaveProfileToFile(h, "lcms2link2.icc")) return 0; + cmsCloseProfile(h); + + + return 1; + +} + + // -------------------------------------------------------------------------------------------------- // P E R F O R M A N C E C H E C K S // -------------------------------------------------------------------------------------------------- @@ -7904,6 +7956,7 @@ int main(int argc, char* argv[]) Check("PostScript generator", CheckPostScript); Check("Segment maxima GBD", CheckGBD); Check("MD5 digest", CheckMD5); + Check("Linking", CheckLinking); } |