tests/bindingstest.cpp tests/bindingstest.h

Christian Mollekopf mollekopf at kolabsys.com
Fri Aug 10 00:39:41 CEST 2012


 tests/bindingstest.cpp |   18 +++++++++++++++---
 tests/bindingstest.h   |    3 ++-
 2 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit b547658b06be929298bf90fe1ebb500ad3b186a8
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Fri Aug 10 00:39:33 2012 +0200

    we either test for latin1 or unicode, not utf8 (which is a unicode encoding)

diff --git a/tests/bindingstest.cpp b/tests/bindingstest.cpp
index 337acec..912e5c6 100644
--- a/tests/bindingstest.cpp
+++ b/tests/bindingstest.cpp
@@ -719,18 +719,30 @@ void BindingsTest::BenchmarkRoundtrip()
     }
 }
 
-void BindingsTest::preserveUtf8()
+void BindingsTest::preserveLatin1()
 {
     Kolab::Event event;
-    event.setSummary("äöü");
+    event.setSummary("äöü%@$£é¤¼²°");
     std::string result = Kolab::writeEvent(event);
-//     std::cout << result << std::endl;
+//    std::cout << result << std::endl;
+    Kolab::Event readEvent = Kolab::readEvent(result, false);
+//     std::cout << readEvent.summary() << std::endl;
+    QCOMPARE(readEvent.summary(), event.summary());
+}
+
+void BindingsTest::preserveUnicode()
+{
+    Kolab::Event event;
+    event.setSummary("€Š�ـأبـ");
+    std::string result = Kolab::writeEvent(event);
+//    std::cout << result << std::endl;
     Kolab::Event readEvent = Kolab::readEvent(result, false);
 //     std::cout << readEvent.summary() << std::endl;
     QCOMPARE(readEvent.summary(), event.summary());
 }
 
 
+
 QTEST_MAIN( BindingsTest )
 
 #include "bindingstest.moc"
diff --git a/tests/bindingstest.h b/tests/bindingstest.h
index 260864d..86fd7d7 100644
--- a/tests/bindingstest.h
+++ b/tests/bindingstest.h
@@ -44,7 +44,8 @@ class BindingsTest : public QObject
     void BenchmarkRoundtripKolab();
     void BenchmarkRoundtrip();
 
-    void preserveUtf8();
+    void preserveLatin1();
+    void preserveUnicode();
 
 };
 





More information about the commits mailing list