[pygobject/gsoc2009: 3/160] Add UTF8 tests in TestGIEverything



commit 91d1ab56c0a187d9eb6b611b674a073aa2f59980
Author: Simon van der Linden <svdlinden src gnome org>
Date:   Wed Jun 17 21:15:16 2009 +0200

    Add UTF8 tests in TestGIEverything

 tests/test_girepository.py |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/tests/test_girepository.py b/tests/test_girepository.py
index 3c626e5..4c529ed 100644
--- a/tests/test_girepository.py
+++ b/tests/test_girepository.py
@@ -24,6 +24,9 @@ UINT16_MAX = 65535
 UINT32_MAX = 4294967295
 UINT64_MAX = 18446744073709551615L
 
+utf8_const = 'const \xe2\x99\xa5 utf8'
+utf8_nonconst = 'nonconst \xe2\x99\xa5 utf8'
+
 class SignalHandler:
     def __init__(self):
         self.counter = 0
@@ -205,6 +208,26 @@ class TestGIEverything(unittest.TestCase):
 #	    self.assertEqual(gobject.TYPE_INT, Everything.test_gtype(gobject.TYPE_INT))
 #	    self.assertRaises(TypeError, Everything.test_gtype, 'a')
 
+# UTF-8
+
+    def testUtf8ConstReturn(self):
+        self.assertEquals(utf8_const, Everything.test_utf8_const_return())
+
+    def testUtf8NonconstReturn(self):
+        self.assertEquals(utf8_nonconst, Everything.test_utf8_nonconst_return())
+
+    def testUtf8NonconstIn(self):
+        Everything.test_utf8_nonconst_in(utf8_nonconst)
+
+    def testUtf8ConstIn(self):
+        Everything.test_utf8_const_in(utf8_const)
+
+    def testUtf8Out(self):
+        self.assertEquals(utf8_nonconst, Everything.test_utf8_out())
+
+    def testUtf8Inout(self):
+        self.assertEquals(utf8_nonconst, Everything.test_utf8_inout(utf8_const))
+
 # FIXME
 # ======================================================================
 # FAIL: testFilenameReturn (__main__.TestGIEverything)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]