summaryrefslogtreecommitdiffstats
path: root/tests/auto/qxmlstream
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-01-13 18:55:05 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-01-13 18:55:05 (GMT)
commit7d1e48639d6d3897e66779f22fe02d17d6c38707 (patch)
tree7abc16568274e1f54c976f890e92d73f7a00160c /tests/auto/qxmlstream
parent20e0e7a849d70139f9106f60c78fd0c736ec3c4b (diff)
parente1b03bac22f87edbbe78eba366966259be6eb0ed (diff)
downloadQt-7d1e48639d6d3897e66779f22fe02d17d6c38707.zip
Qt-7d1e48639d6d3897e66779f22fe02d17d6c38707.tar.gz
Qt-7d1e48639d6d3897e66779f22fe02d17d6c38707.tar.bz2
Merge branch '4.6'
Conflicts: bin/syncqt doc/src/deployment/deployment.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/xml/qxmlstream.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
Diffstat (limited to 'tests/auto/qxmlstream')
-rw-r--r--tests/auto/qxmlstream/qc14n.h2
-rwxr-xr-xtests/auto/qxmlstream/setupSuite.sh2
-rw-r--r--tests/auto/qxmlstream/tst_qxmlstream.cpp18
3 files changed, 18 insertions, 4 deletions
diff --git a/tests/auto/qxmlstream/qc14n.h b/tests/auto/qxmlstream/qc14n.h
index e62870e..93fa6b4 100644
--- a/tests/auto/qxmlstream/qc14n.h
+++ b/tests/auto/qxmlstream/qc14n.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qxmlstream/setupSuite.sh b/tests/auto/qxmlstream/setupSuite.sh
index c9e6c05..9933f61 100755
--- a/tests/auto/qxmlstream/setupSuite.sh
+++ b/tests/auto/qxmlstream/setupSuite.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#############################################################################
##
-## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/auto/qxmlstream/tst_qxmlstream.cpp b/tests/auto/qxmlstream/tst_qxmlstream.cpp
index e28d933..27ae089 100644
--- a/tests/auto/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/qxmlstream/tst_qxmlstream.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -559,6 +559,7 @@ private slots:
void hasAttributeSignature() const;
void hasAttribute() const;
void writeWithCodec() const;
+ void writeWithUtf8Codec() const;
void writeWithStandalone() const;
void entitiesAndWhitespace_1() const;
void entitiesAndWhitespace_2() const;
@@ -1303,7 +1304,6 @@ void tst_QXmlStream::hasAttribute() const
void tst_QXmlStream::writeWithCodec() const
{
-
QByteArray outarray;
QXmlStreamWriter writer(&outarray);
writer.setAutoFormatting(true);
@@ -1326,6 +1326,20 @@ void tst_QXmlStream::writeWithCodec() const
QVERIFY(outarray.contains(codec->name()));
}
+void tst_QXmlStream::writeWithUtf8Codec() const
+{
+ QByteArray outarray;
+ QXmlStreamWriter writer(&outarray);
+
+ QTextCodec *codec = QTextCodec::codecForMib(106); // utf-8
+ QVERIFY(codec);
+ writer.setCodec(codec);
+
+ writer.writeStartDocument("1.0");
+ static const char begin[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
+ QVERIFY(outarray.startsWith(begin));
+}
+
void tst_QXmlStream::writeWithStandalone() const
{
{