Add another test profile, where A2B/B2A and XYZ+TRC disagree strongly

Bug: chromium:820233
Bug: chromium:1055154
Change-Id: I102f6ce577761da22ca1515c37424b1628dacd3c
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/294376
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/profiles/misc/Calibrated_A2B_XYZ_Mismatch.icc b/profiles/misc/Calibrated_A2B_XYZ_Mismatch.icc
new file mode 100644
index 0000000..e4dfc32
--- /dev/null
+++ b/profiles/misc/Calibrated_A2B_XYZ_Mismatch.icc
Binary files differ
diff --git a/profiles/misc/Calibrated_A2B_XYZ_Mismatch.icc.txt b/profiles/misc/Calibrated_A2B_XYZ_Mismatch.icc.txt
new file mode 100644
index 0000000..2c230cc
--- /dev/null
+++ b/profiles/misc/Calibrated_A2B_XYZ_Mismatch.icc.txt
@@ -0,0 +1,83 @@
+                Size : 0x000BB2F0 : 766704
+    Data color space : 0x52474220 : 'RGB '
+                 PCS : 0x58595A20 : 'XYZ '
+           Tag count : 0x0000001A : 26
+
+ Tag    : Type   : Size   : Offset
+ ------ : ------ : ------ : --------
+ 'desc' : 'desc' :    269 : 444
+ 'cprt' : 'text' :     74 : 716
+ 'dmnd' : 'desc' :    115 : 792
+ 'dmdd' : 'desc' :     96 : 908
+ 'lumi' : 'XYZ ' :     20 : 1004
+ 'wtpt' : 'XYZ ' :     20 : 1024
+ 'bkpt' : 'XYZ ' :     20 : 1044
+ 'clrt' : 'clrt' :    126 : 1064
+ 'vcgt' : 'vcgt' :   1554 : 1192
+ 'A2B0' : 'mft2' : 240250 : 2748
+ 'B2A0' : 'mft2' : 241786 : 243000
+ 'rXYZ' : 'XYZ ' :     20 : 484788
+ 'gXYZ' : 'XYZ ' :     20 : 484808
+ 'bXYZ' : 'XYZ ' :     20 : 484828
+ 'rTRC' : 'curv' :     14 : 484848
+ 'gTRC' : 'curv' :     14 : 484848
+ 'bTRC' : 'curv' :     14 : 484848
+ 'targ' : 'text' :  37550 : 484864
+ 'DevD' : 'text' :  37550 : 484864
+ 'CIED' : 'text' :  37550 : 484864
+ 'arts' : 'sf32' :     44 : 522416
+ 'A2B1' : 'mft2' : 240250 : 2748
+ 'B2A1' : 'mft2' : 241786 : 522460
+ 'chrm' : 'chrm' :     36 : 764248
+ 'mmod' : 'mmod' :     40 : 764284
+ 'meta' : 'dict' :   2380 : 764324
+
+rTRC : 2.199219, 1, 0, 0, 0, 0, 0 (f(1) = 1)
+gTRC : 2.199219, 1, 0, 0, 0, 0, 0 (f(1) = 1)
+bTRC : 2.199219, 1, 0, 0, 0, 0, 0 (f(1) = 1)
+Best : 2.199219, 1, 0, 0, 0, 0, 0 (f(1) = 1)
+Inv  : 0.4547069, 1, -0, 0, 0, 0, 0 (f(1) = 1)
+Best Error: | 0.000167131 0.000167131 0.000167131 |
+ XYZ : | 0.52705383 0.28042602 0.15672302 |
+       | 0.2702179 0.6712799 0.058502197 |
+       | 0.009857177 0.110076904 0.7049713 |
+ A2B : "A", CLUT, "B"
+ "A" : 3 inputs
+  A0 : 16-bit table with 2048 entries
+  ~= : 0.5404596, 1, -1.550652e-06, 1.583625, 0.004885198, -0.04841614, 0 (Max error: 0.0911865) (D-gap: 0.000189664) (f(1) = 0.951607)
+  A1 : 16-bit table with 2048 entries
+  ~= : 0.5278046, 1, -1.103617e-06, 1.443067, 0.004885198, -0.05301666, 0 (Max error: 0.102562) (D-gap: 0.000205171) (f(1) = 0.947006)
+  A2 : 16-bit table with 2048 entries
+  ~= : 0.4176759, 3.184967, 0.3907202, 1.518032, 0.004885197, -0.6789093, 0 (Max error: 0.0466743) (D-gap: 0.000121958) (f(1) = 1.02361)
+CLUT : 33 x 33 x 33 (16 bpp)
+ "B" : 3 outputs
+  B0 : 16-bit table with 2048 entries
+  ~= : 1.009968, 1, -7.651746e-06, 0.6062298, 0.08011725, -0.0293808, 0 (Max error: 0.0304855) (D-gap: 0.000165198) (f(1) = 0.970619)
+  B1 : 16-bit table with 2048 entries
+  ~= : 0.9919698, 1, -1.741946e-05, 0.6215599, 0.07278945, -0.02890778, 0 (Max error: 0.0299486) (D-gap: 0.000160005) (f(1) = 0.971081)
+  B2 : 16-bit table with 2048 entries
+  ~= : 1.040328, 1, -5.505979e-06, 0.6186358, 0.08549096, -0.02437592, 0 (Max error: 0.0263579) (D-gap: 0.000148445) (f(1) = 0.975632)
+WTPT : | 0.95072937 1. 1.0914154 |
+252 random bytes transformed to linear XYZD50 bytes:
+	152a1b 4c6911 23330d 0f0818 110924 352705 1d4215
+	412118 0f0c09 3f2613 54530c 263007 132217 271547
+	59494f 223148 3f4429 1e2a0e 190c2a 4c3d08 512a4e
+	472410 07031d 677635 4c2448 3f5a17 13093c 203825
+	262618 1f171f 120922 46482b 3e6339 4e2738 19390a
+	384644 1a260d 331803 20481b 030404 0d0834 121629
+	10083e 151503 20333a 05050d 0f1c07 2d1b09 4f3848
+	5f592d 5c3d5c 361e0f 193519 214221 0f0808 245610
+	213f14 423507 130c14 1e1806 07051b 04010d 24180f
+	383237 311e31 173008 31172e 1d0d14 151828 2e3347
+	11200b 1a1342 090519 351a03 23490c 010106 252d53
+	26520f 281717 1b231e 352012 214522 2d1b0c 253043
+81 edge-case pixels transformed to sRGB 8888 (unpremul):
+	00020202 00000067 000000d0  00005e00 00005d59 000057cb  001fc000 001fbf00 001fbcb9
+	005d0009 005d0067 005c00d0  005e6000 005d5d5c 005e56cc  0061c000 0061bf00 0061bab9
+	00bc0620 00bc006d 00bc00d2  00bc6100 00bc5e5f 00bc57cd  00bcbf00 00bcbf15 00bcbcbc
+	7f020202 7f000067 7f0000d0  7f005e00 7f005d59 7f0057cb  7f1fc000 7f1fbf00 7f1fbcb9
+	7f5d0009 7f5d0067 7f5c00d0  7f5e6000 7f5d5d5c 7f5e56cc  7f61c000 7f61bf00 7f61bab9
+	7fbc0620 7fbc006d 7fbc00d2  7fbc6100 7fbc5e5f 7fbc57cd  7fbcbf00 7fbcbf15 7fbcbcbc
+	ff020202 ff000067 ff0000d0  ff005e00 ff005d59 ff0057cb  ff1fc000 ff1fbf00 ff1fbcb9
+	ff5d0009 ff5d0067 ff5c00d0  ff5e6000 ff5d5d5c ff5e56cc  ff61c000 ff61bf00 ff61bab9
+	ffbc0620 ffbc006d ffbc00d2  ffbc6100 ffbc5e5f ffbc57cd  ffbcbf00 ffbcbf15 ffbcbcbc
diff --git a/tests.c b/tests.c
index aed3389..8689d12 100644
--- a/tests.c
+++ b/tests.c
@@ -632,6 +632,10 @@
     "profiles/misc/ThinkpadX1YogaV2.icc",
     "profiles/misc/XPS13_9360.icc",
 
+    // Calibrated profile where A2B/B2A and XYZ+TRC produce very different gamut mappings.
+    // User was (rightly) confused & convinced that profile was being ignored.
+    "profiles/misc/Calibrated_A2B_XYZ_Mismatch.icc",  // chromium:1055154
+
     // fuzzer generated profiles that found parsing bugs
 
     // Bad tag table data - these should not parse