aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-10-30 12:04:42 +0100
committerRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-10-30 12:04:42 +0100
commit307b793ca5deacfde7c787352f54f4f1aebc95e8 (patch)
treea05e033c506beb37049e5bc1c5f576251ea4f2b7
parented490f271e983060525cd2964cd4203abb8bfdaa (diff)
downloadqmenumodel-307b793ca5deacfde7c787352f54f4f1aebc95e8.tar.gz
qmenumodel-307b793ca5deacfde7c787352f54f4f1aebc95e8.tar.bz2
qmenumodel-307b793ca5deacfde7c787352f54f4f1aebc95e8.zip
Created unit test for utf8 strings.
-rw-r--r--tests/client/modeltest.cpp8
-rwxr-xr-xtests/client/script_modeltest.py2
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/client/modeltest.cpp b/tests/client/modeltest.cpp
index 1c2eeca..93677db 100644
--- a/tests/client/modeltest.cpp
+++ b/tests/client/modeltest.cpp
@@ -212,7 +212,13 @@ private Q_SLOTS:
QCOMPARE(v.type(), QVariant::Map);
QCOMPARE(v.toMap(), map);
- }
+
+ // Utf8
+ v = extra["utf8"];
+ QCOMPARE(v.type(), QVariant::String);
+ QCOMPARE(v.toString(), QString("dança"));
+
+ }
/*
* Test if model is destroyed without crash
diff --git a/tests/client/script_modeltest.py b/tests/client/script_modeltest.py
index 95df442..fdfbff4 100755
--- a/tests/client/script_modeltest.py
+++ b/tests/client/script_modeltest.py
@@ -1,4 +1,5 @@
#!/usr/bin/python2.7
+# -*- coding: utf-8 -*-
import time
from gi.repository import GLib
@@ -21,6 +22,7 @@ al.appendItem("Menu0", "Menu0Act", None, None, {'x-boolean' : GLib.Variant('b',
'x-uint64' : GLib.Variant('t', 42),
'x-double' : GLib.Variant('d', 42.42),
'x-string' : GLib.Variant('s', u'42'),
+ 'x-utf8' : GLib.Variant('s', u'dança'),
'x-map' : GLib.Variant('a{sv}', pmap),
})
al.appendItem("Menu1", "Menu1Act")