Merge ~rodrigo-zaiden/qa-regression-testing:update-test-libpng into qa-regression-testing:master

Proposed by Rodrigo Figueiredo Zaiden
Status: Merged
Merge reported by: Rodrigo Figueiredo Zaiden
Merged at revision: 34972c7e7d63e8b7a38beb4683a689c290a3138b
Proposed branch: ~rodrigo-zaiden/qa-regression-testing:update-test-libpng
Merge into: qa-regression-testing:master
Diff against target: 98 lines (+21/-22)
1 file modified
scripts/test-libpng.py (+21/-22)
Reviewer Review Type Date Requested Status
Marc Deslauriers Approve
Review via email: mp+414315@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/test-libpng.py b/scripts/test-libpng.py
2index c6983ce..02424fb 100755
3--- a/scripts/test-libpng.py
4+++ b/scripts/test-libpng.py
5@@ -1,7 +1,7 @@
6 #!/usr/bin/python2
7 #
8 # test-libpng.py quality assurance test script for Xine
9-# Copyright (C) 2009-2015 Canonical Ltd.
10+# Copyright (C) 2009-2022 Canonical Ltd.
11 # Author: Jamie Strandboge <jamie@canonical.com>
12 #
13 # This program is free software: you can redistribute it and/or modify
14@@ -25,8 +25,8 @@
15
16 NOTES:
17 When run with '--download', this file will download various files
18- from ftp://ftp.simplesystems.org/pub/libpng/png/images/suite/ if they don't
19- already exist. These files should not be added to the bzr branch for
20+ from http://www.schaik.com/pngsuite/ if they don't
21+ already exist. These files should not be added to the branch for
22 qa-regression-testing due to copyright.
23
24 When running, the script will launch the executable, and you will have to
25@@ -46,8 +46,8 @@ import testlib
26 import testlib_multimedia
27
28 topdir = os.path.join(os.getcwd(), "testlib_png")
29-topurl = "ftp://ftp.simplesystems.org/pub/libpng/png/images/suite/"
30-archive = "PngSuite.tar.gz"
31+topurl = "http://www.schaik.com/pngsuite/"
32+archive = "PngSuite-2017jul19.tgz"
33
34 use_x = False
35 use_private = True
36@@ -107,9 +107,9 @@ class TestPNG(testlib_multimedia.MultimediaCommon):
37 add_file_url = False
38 if exe == "eog":
39 add_file_url = True
40- elif exe == "pnginfo": # These fail for some reason
41- files.remove("ct1n0g04.png")
42- files.remove("ctzn0g04.png")
43+ elif exe == "pnginfo": # These used to fail for some reason (leaving for reference)
44+ #files.remove("ct1n0g04.png")
45+ #files.remove("ctzn0g04.png")
46
47 arch = testlib.get_arch()
48 if arch == "x86_64" and self.lsb_release['Release'] == 14.04:
49@@ -136,28 +136,27 @@ class TestPNG(testlib_multimedia.MultimediaCommon):
50 count += 1
51 expected = 0
52 search = ""
53- if bad == "x00n0g01.png":
54- if exe == "pnginfo":
55- expected = 42
56- search = "Could not set PNG jump value"
57- elif exe == "pngchunks": # segfaults normally
58- continue
59- elif (bad == "xcrn0g04.png" or bad == "xlfn0g04.png") and exe == "pngchunks":
60- expected = 1
61+
62 rc, report = testlib.cmd([exe, f])
63+ if exe == "pnginfo":
64+ search = "Could not set PNG jump value"
65+ if search in report:
66+ expected = 42
67+ elif exe == "pngchunks":
68+ search = "This is not a PNG file"
69+ if search in report:
70+ expected = 1
71 result = 'Got exit code %d, expected %d for \'%s %s\'\n' % (rc, expected, exe, f)
72 self.assertEqual(expected, rc, result + report)
73- if search != "":
74- self.assertTrue(search in report, "Could not find '%s' in:\n%s" % (search, report))
75
76 def test_pngcrush(self):
77 '''Test pngcrush'''
78 files = []
79 for f in self.files:
80 files.append(f)
81- # These fail for some reason
82- files.remove("ct1n0g04.png")
83- files.remove("ctzn0g04.png")
84+ # These used to fail for some reason (leaving for reference)
85+ #files.remove("ct1n0g04.png")
86+ #files.remove("ctzn0g04.png")
87
88 count = 1
89 for fn in files:
90@@ -166,7 +165,7 @@ class TestPNG(testlib_multimedia.MultimediaCommon):
91 print("(%d of %d: Trying %s with pngcrush)" % (count, len(files), fn))
92 count += 1
93
94- rc, report = testlib.cmd(['pngcrush', '-d', '/tmp', '-v', '-n', f])
95+ rc, report = testlib.cmd(['pngcrush', '-d', '/tmp', '-v', '-v', '-n', f])
96 expected = 0
97 result = 'Got exit code %d, expected %d for \'%s\'\n' % (rc, expected, f)
98 self.assertEqual(expected, rc, result + report)

Subscribers

People subscribed via source and target branches