Skip to content
Commits on Source (2)
  • Chris Lamb's avatar
    Drop print() statement in PPU tests. · 755c2184
    Chris Lamb authored
    755c2184
  • Chris Lamb's avatar
    Fix tests under colord >= 1.4.3. (Closes: #908900) · b1addb0d
    Chris Lamb authored
    The `cd-iccdump` command has no --version command and, whilst the `colord`
    binary does, it relies on the daemon running to return any output.  Therefore
    we hackily compare the output (via the line length) of colord 1.4.3:
    
        "  Profile ID    = 0477fa4bb5ae5ae9a778f5cd72eb45a4"
    
    ... versus, for example, colord 1.3.3:
    
        " Profile ID    = 0x0477fa4b"
    
    We don't massage the output (say, in an `Iccdump.filter` method) as it would
    remove the accuracy and, unfortunately, colord 1.4.3 also removes a
    somewhat-arbitrary newline too.
    b1addb0d
......@@ -18,19 +18,46 @@
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
import pytest
import subprocess
from diffoscope.config import Config
from diffoscope.comparators.icc import IccFile
from diffoscope.comparators.missing_file import MissingFile
from ..utils.data import load_fixture, get_data
from ..utils.tools import skip_unless_tools_exist
from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
icc1 = load_fixture('test1.icc')
icc2 = load_fixture('test2.icc')
def cd_iccdump_version():
"""
The `cd-iccdump` command has no --version command and, whilst the `colord`
binary does, it relies on the daemon running to return any output.
Therefore we hackily compare the output (via the line length) of colord
1.4.3:
" Profile ID = 0477fa4bb5ae5ae9a778f5cd72eb45a4"
... versus, for example, colord 1.3.3:
" Profile ID = 0x0477fa4b"
We don't massage the output (say, in an `Iccdump.filter` method) as it
would remove the accuracy and, unfortunately, colord 1.4.3 also removes a
somewhat-arbitrary newline too.
"""
val = subprocess.check_output(('cd-iccdump', icc1().path)).decode('utf-8')
for x in val.splitlines():
if x.startswith(' Profile ID') and len(x) == 47:
return '1.4.3'
return '1.3.3'
def test_identification(icc1):
assert isinstance(icc1, IccFile)
......@@ -45,7 +72,7 @@ def differences(icc1, icc2):
return icc1.compare(icc2).details
@skip_unless_tools_exist('cd-iccdump')
@skip_unless_tool_is_at_least('cd-iccdump', cd_iccdump_version, '1.4.3')
def test_diff(differences):
if 'ne_SU' in differences[0].unified_diff:
pytest.skip("Endian-specific differences detected; see "
......
......@@ -62,7 +62,6 @@ def differences(file1, file2):
@skip_unless_tool_is_at_least('ppudump', ppudump_version, '3.0.0')
def test_diff(differences):
print(differences[0].unified_diff)
expected_diff = get_data('ppu_expected_diff')
assert differences[0].unified_diff == expected_diff
......
......@@ -12,12 +12,12 @@
Dev. Attrbts = reflective, glossy
Rndrng Intnt = perceptual
Creator = lcms
- Profile ID = 0x0477fa4b
+ Profile ID = 0x06017f17
- Profile ID = 0477fa4bb5ae5ae9a778f5cd72eb45a4
+ Profile ID = 06017f17ec507191e9d859f2324fca53
tag 00:
sig 'desc' [0x64657363]
size 38
type 'mluc' [0x6d6c7563]
Text:
en_US: sRGB [24 bytes]