summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-05-01 14:05:43 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-05-01 14:06:18 +0200
commitf69b2c1e24c711c7451a93cc30a317c113b09d6a (patch)
tree4652c6e3792bf1146a704927c0d106ecab8b69eb /test
parente110cc9eb66a5f1bc40a2f8864bd9977e614c5ad (diff)
add testcase for fdo31814-2.emf
Diffstat (limited to 'test')
-rw-r--r--test/emf/pass/fdo31814-2.emfbin0 -> 15996 bytes
-rwxr-xr-xtest/emf/test.py46
2 files changed, 46 insertions, 0 deletions
diff --git a/test/emf/pass/fdo31814-2.emf b/test/emf/pass/fdo31814-2.emf
new file mode 100644
index 0000000..8b3923e
--- /dev/null
+++ b/test/emf/pass/fdo31814-2.emf
Binary files differ
diff --git a/test/emf/test.py b/test/emf/test.py
new file mode 100755
index 0000000..c4091f5
--- /dev/null
+++ b/test/emf/test.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python2
+# -*- encoding: UTF-8 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+import sys
+sys.path.append(sys.path[0] + "/../..")
+emf_dumper = __import__('emf-dump')
+from xml.etree import ElementTree
+import unittest
+import os
+
+
+class Test(unittest.TestCase):
+ def dump(self, name):
+ try:
+ os.unlink("%s.emf.xml" % name)
+ except OSError:
+ pass
+ sock = open("%s.emf.xml" % name, "w")
+ saved = sys.stdout
+ sys.stdout = sock
+ emf_dumper.main(["emf-dumper", "%s.emf" % name])
+ sys.stdout = saved
+ sock.close()
+ tree = ElementTree.parse('%s.emf.xml' % name)
+ self.root = tree.getroot()
+ # Make sure everything is dumped - so it can't happen that dump(a) == dump(b), but a != b.
+ self.assertEqual(0, len(self.root.findall('todo')))
+
+ def test_pass(self):
+ """This test just makes sure that all files in the 'pass' directory are
+ dumped without problems."""
+
+ for dirname, dirnames, filenames in os.walk('pass'):
+ for filename in filenames:
+ if filename.endswith(".emf"):
+ self.dump(os.path.join(dirname, filename).replace('.emf', ''))
+
+if __name__ == '__main__':
+ unittest.main()
+
+# vim:set filetype=python shiftwidth=4 softtabstop=4 expandtab: