[Reproducible-commits] [debbindiff] 03/07: Add tests for ttf comparator

Jérémy Bobbio lunar at moszumanska.debian.org
Wed Jun 24 11:52:25 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository debbindiff.

commit 115be378b7dd9af01adb531c77d3a0699fee65a5
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Wed Jun 24 10:19:48 2015 +0000

    Add tests for ttf comparator
---
 debian/copyright                 |  30 +++++++++++++++++
 tests/comparators/test_fonts.py  |  39 +++++++++++++++++++++
 tests/data/Samyak-Malayalam1.ttf | Bin 0 -> 46408 bytes
 tests/data/Samyak-Malayalam2.ttf | Bin 0 -> 46408 bytes
 tests/data/ttf_expected_diff     |  71 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 140 insertions(+)

diff --git a/debian/copyright b/debian/copyright
index c49a711..ba483a8 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -58,6 +58,36 @@ Copyright: 2015 Jérémy Bobbio <lunar at debian.org>
            2015 Helmut Grohne <helmut at subdivi.de>
 License: GPL-3+
 
+Files: tests/data/Samyak-Malayalam*.ttf
+Copyright: 2005-2006, Rahul Bhalerao <b.rahul.pm at gmail.com>
+           2005-2006, Bageshri Salvi <sbageshri at gmail.com>
+           2005-2006, Pravin Satpute <pravin.d.s at gmail.com>
+           2005-2006, Sandeep Shedmake <Sandeep.shedmake at gmail.com>
+License: GPL-3.0+ with font exception
+ This program is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation, either version 3 of the License, or (at your option) any later
+ version.
+ .
+ This package 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 General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License along with
+ this program. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General Public License version
+ 3 can be found in "/usr/share/common-licenses/GPL-3".
+ .
+ "As a special exception, if you create a document which uses this font, and
+ embed this font or unaltered portions of this font into the document, this
+ font does not by itself cause the resulting document to be covered by the GNU
+ General Public License. This exception does not however invalidate any other
+ reasons why the document might be covered by the GNU General Public License.
+ If you modify this font, you may extend this exception to your version of the
+ font, but you are not obligated to do so. If you do not wish to do so, delete
+ this exception statement from your version."
+
 Files: debian/*
 Copyright: 2014-2015 Jérémy Bobbio <lunar at debian.org>
 License: GPL-3+
diff --git a/tests/comparators/test_fonts.py b/tests/comparators/test_fonts.py
new file mode 100644
index 0000000..6b7d8e7
--- /dev/null
+++ b/tests/comparators/test_fonts.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# debbindiff: highlight differences between two builds of Debian packages
+#
+# Copyright © 2015 Jérémy Bobbio <lunar at debian.org>
+#
+# debbindiff is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# debbindiff 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with debbindiff.  If not, see <http://www.gnu.org/licenses/>.
+
+import os.path
+import shutil
+import pytest
+from debbindiff.comparators.fonts import compare_ttf_files
+
+TEST_FILE1_PATH = os.path.join(os.path.dirname(__file__), '../data/Samyak-Malayalam1.ttf') 
+TEST_FILE2_PATH = os.path.join(os.path.dirname(__file__), '../data/Samyak-Malayalam2.ttf') 
+
+def test_no_differences():
+    differences = compare_ttf_files(TEST_FILE1_PATH, TEST_FILE1_PATH)
+    assert len(differences) == 0
+
+ at pytest.fixture
+def differences():
+    return compare_ttf_files(TEST_FILE1_PATH, TEST_FILE2_PATH)[0].details # skip container with path
+
+def test_diff(differences):
+    expected_diff = open(os.path.join(os.path.dirname(__file__), '../data/ttf_expected_diff')).read()
+    assert differences[0].unified_diff == expected_diff
diff --git a/tests/data/Samyak-Malayalam1.ttf b/tests/data/Samyak-Malayalam1.ttf
new file mode 100644
index 0000000..699eec5
Binary files /dev/null and b/tests/data/Samyak-Malayalam1.ttf differ
diff --git a/tests/data/Samyak-Malayalam2.ttf b/tests/data/Samyak-Malayalam2.ttf
new file mode 100644
index 0000000..f8054fe
Binary files /dev/null and b/tests/data/Samyak-Malayalam2.ttf differ
diff --git a/tests/data/ttf_expected_diff b/tests/data/ttf_expected_diff
new file mode 100644
index 0000000..25a896a
--- /dev/null
+++ b/tests/data/ttf_expected_diff
@@ -0,0 +1,71 @@
+@@ -6,33 +6,33 @@
+ GSUB checksum=83ea9f40 actual=83ea9f40 diff=0 offset=44256 len=2092
+ OS/2 checksum=8253044b actual=8253044b diff=0 offset=424 len=86
+ cmap checksum=635872c2 actual=635872c2 diff=0 offset=1356 len=434
+ cvt  checksum=e67de44f actual=e67de44f diff=0 offset=1960 len=82
+ fpgm checksum=8333c24f actual=8333c24f diff=0 offset=1792 len=20
+ gasp checksum=ffff0003 actual=ffff0003 diff=0 offset=44184 len=8
+ glyf checksum=c19163d1 actual=c19163d1 diff=0 offset=2468 len=33904
+-head checksum=ee7cdfb8 actual=1be360cb diff=f59fbf73 offset=300 len=54
++head checksum=ee7cdfb8 actual=17e360c7 diff=f99fbf7f offset=300 len=54
+ hhea checksum=0b070428 actual=0b070428 diff=0 offset=356 len=36
+ hmtx checksum=90d00254 actual=90d00254 diff=0 offset=512 len=844
+ loca checksum=7be19c62 actual=7be19c62 diff=0 offset=2044 len=424
+ maxp checksum=018d0241 actual=018d0241 diff=0 offset=392 len=32
+-name checksum=bb87b0d0 actual=bb87b0d0 diff=0 offset=36372 len=4743
++name checksum=bd87b0d2 actual=bd87b0d2 diff=0 offset=36372 len=4743
+ post checksum=9a0361df actual=9a0361df diff=0 offset=41116 len=3065
+ prep checksum=271c18e6 actual=271c18e6 diff=0 offset=1812 len=147
+ 
+ 
+ Created by FontForge 14:57 31-July-2012
+ 	Font created: Fri Jan  6 19:21:03 2006
+ 	Font modified: Tue May 11 11:54:49 2010
+ 
+ 
+ HEAD table (at 300)
+ 	Version=1
+ 	fontRevision=1.2
+-	checksumAdj=2d668113
++	checksumAdj=2966810f
+ 	magicNumber=5f0f3cf5 (0x5f0f3cf5, diff=0)
+ 	flags=1f baseline_at_0 lsb_at_0 instrs_depend_on_size ppem_to_int instr_set_width 
+ 	unitsPerEm=1024
+ 	create[0]=0
+ 	 create[1]=bfe4739f
+ 	File created: Fri Jan  6 19:21:03 2006
+ 	modtime[0]=0
+@@ -74,15 +74,15 @@
+ 	 platform=1 plat spec encoding=0 language=0 name=0 Copyright
+ 	 strlen=1259  stroff=2520	   Created by:^JRahul Bhalerao <b.rahul.pm at gmail.com>, ^JSandeep Shedmake <sandeep.shedmake at gmail.com>, ^JBageshri Salvi <sbageshri at gmail.com>, ^JPravin Satpute <pravin.d.s at gmail.com>^J^JModified by Hiran Venugopalan <hiran.v at gmail.com>^J^JGNU GPL V.3 or later (with Font Exception), Copyright `2005-2006 by  H.B.C.S.E., T.I.F.R.,^JHomi Bhabha Centre For Science Education, ^JTata Institute Of Fundamental Research,^JV.N. Purav Marg, Mankhurd, ^JMumbai 400 088, IN [...]
+ 	 platform=1 plat spec encoding=0 language=0 name=1 Family
+ 	 strlen=16  stroff=3814	   Samyak Malayalam
+ 	 platform=1 plat spec encoding=0 language=0 name=2 Subfamily
+ 	 strlen=6  stroff=3845	   Medium
+ 	 platform=1 plat spec encoding=0 language=0 name=3 UniqueID
+-	 strlen=44  stroff=3942	   FontForge 2.0 : Samyak Malayalam : 23-6-2015
++	 strlen=44  stroff=3942	   FontForge 2.0 : Samyak Malayalam : 25-6-2015
+ 	 platform=1 plat spec encoding=0 language=0 name=4 FullName
+ 	 strlen=16  stroff=4021	   Samyak Malayalam
+ 	 platform=1 plat spec encoding=0 language=0 name=5 Version
+ 	 strlen=28  stroff=4096	   Original Version 1.00 (2005)
+ 	 platform=1 plat spec encoding=0 language=0 name=6 Postscript
+ 	 strlen=16  stroff=4159	   Samyak-Malayalam
+ 	 platform=1 plat spec encoding=0 language=0 name=9 Designer
+@@ -94,15 +94,15 @@
+ 	 platform=3 plat spec encoding=1 language=409 name=0 Copyright
+ 	 strlen=2518  stroff=0	   ^@C^@r^@e^@a^@t^@e^@d^@ ^@b^@y^@:^@^J^@R^@a^@h^@u^@l^@ ^@B^@h^@a^@l^@e^@r^@a^@o^@ ^@<^@b^@.^@r^@a^@h^@u^@l^@.^@p^@m^@@^@g^@m^@a^@i^@l^@.^@c^@o^@m^@>^@,^@ ^@^J^@S^@a^@n^@d^@e^@e^@p^@ ^@S^@h^@e^@d^@m^@a^@k^@e^@ ^@<^@s^@a^@n^@d^@e^@e^@p^@.^@s^@h^@e^@d^@m^@a^@k^@e^@@^@g^@m^@a^@i^@l^@.^@c^@o^@m^@>^@,^@ ^@^J^@B^@a^@g^@e^@s^@h^@r^@i^@ ^@S^@a^@l^@v^@i^@ ^@<^@s^@b^@a^@g^@e^@s^@h^@r^@i^@@^@g^@m^@a^@i^@l^@.^@c^@o^@m^@>^@,^@ ^@^J^@P^@r^@a^@v^@i^@n^@ ^@S^@a^@t^@p^@u^@t^@e^ [...]
+ 	 platform=3 plat spec encoding=1 language=409 name=1 Family
+ 	 strlen=32  stroff=3780	   ^@S^@a^@m^@y^@a^@k^@ ^@M^@a^@l^@a^@y^@a^@l^@a^@m
+ 	 platform=3 plat spec encoding=1 language=409 name=2 Subfamily
+ 	 strlen=12  stroff=3831	   ^@M^@e^@d^@i^@u^@m
+ 	 platform=3 plat spec encoding=1 language=409 name=3 UniqueID
+-	 strlen=88  stroff=3852	   ^@F^@o^@n^@t^@F^@o^@r^@g^@e^@ ^@2^@.^@0^@ ^@:^@ ^@S^@a^@m^@y^@a^@k^@ ^@M^@a^@l^@a^@y^@a^@l^@a^@m^@ ^@:^@ ^@2^@3^@-^@6^@-^@2^@0^@1^@5
++	 strlen=88  stroff=3852	   ^@F^@o^@n^@t^@F^@o^@r^@g^@e^@ ^@2^@.^@0^@ ^@:^@ ^@S^@a^@m^@y^@a^@k^@ ^@M^@a^@l^@a^@y^@a^@l^@a^@m^@ ^@:^@ ^@2^@5^@-^@6^@-^@2^@0^@1^@5
+ 	 platform=3 plat spec encoding=1 language=409 name=4 FullName
+ 	 strlen=32  stroff=3987	   ^@S^@a^@m^@y^@a^@k^@ ^@M^@a^@l^@a^@y^@a^@l^@a^@m
+ 	 platform=3 plat spec encoding=1 language=409 name=5 Version
+ 	 strlen=56  stroff=4038	   ^@O^@r^@i^@g^@i^@n^@a^@l^@ ^@V^@e^@r^@s^@i^@o^@n^@ ^@1^@.^@0^@0^@ ^@(^@2^@0^@0^@5^@)
+ 	 platform=3 plat spec encoding=1 language=409 name=6 Postscript
+ 	 strlen=32  stroff=4125	   ^@S^@a^@m^@y^@a^@k^@-^@M^@a^@l^@a^@y^@a^@l^@a^@m
+ 	 platform=3 plat spec encoding=1 language=409 name=9 Designer

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/debbindiff.git



More information about the Reproducible-commits mailing list