[poppler] 2 commits - poppler/Gfx.cc regtest/backends

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun Sep 18 07:28:53 PDT 2011


 poppler/Gfx.cc               |    3 ++-
 regtest/backends/__init__.py |   12 +++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit e23f6b9cade804136bd4bb58182f4fe0b072fbf2
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Sep 18 16:27:50 2011 +0200

    regtest: Do not create checksums for crashed, failed and stderr files

diff --git a/regtest/backends/__init__.py b/regtest/backends/__init__.py
index de8b3ec..f54be80 100644
--- a/regtest/backends/__init__.py
+++ b/regtest/backends/__init__.py
@@ -38,12 +38,19 @@ class Backend:
     def get_name(self):
         return self._name
 
+    def __should_have_checksum(self, entry):
+        if not entry.startswith(self._name):
+            return False
+
+        name, ext = os.path.splitext(entry)
+        return ext not in ('.md5', '.crashed', '.failed', '.stderr');
+
     def create_checksums(self, refs_path, delete_refs = False):
         path = os.path.join(refs_path, self._name)
         md5_file = open(path + '.md5', 'w')
 
         for entry in os.listdir(refs_path):
-            if not entry.startswith(self._name) or entry.endswith('.md5'):
+            if not self.__should_have_checksum(entry):
                 continue
             ref_path = os.path.join(refs_path, entry)
             f = open(ref_path, 'rb')
@@ -69,6 +76,9 @@ class Backend:
                 print("%s found in md5 ref file but missing in output dir %s" % (basename, out_path))
                 continue
 
+            if not self.__should_have_checksum(basename):
+                continue
+
             result_path = os.path.join(out_path, basename)
             f = open(result_path, 'rb')
             matched = md5sum == md5(f.read()).hexdigest()
commit 110b8be1d9f2694b42bd12dcb6af02bfca9866dd
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Sep 18 16:26:58 2011 +0200

    Fix memory leak

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 94f5e55..92c66a3 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -4804,7 +4804,8 @@ void Gfx::opBeginMarkedContent(Object args[], int numArgs) {
 	  bool visible = contentConfig->optContentIsVisible( &markedContent );
 	  MarkedContentStack *mc = mcStack;
 	  mc->ocSuppressed = !(visible);
-       }
+        }
+        markedContent.free();
       } else {
 	error(getPos(), "DID NOT find %s", name1);
       }


More information about the poppler mailing list