From 307b793ca5deacfde7c787352f54f4f1aebc95e8 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Tue, 30 Oct 2012 12:04:42 +0100 Subject: Created unit test for utf8 strings. --- tests/client/modeltest.cpp | 8 +++++++- tests/client/script_modeltest.py | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) 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") -- cgit v1.2.3