summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestbasicstreamer.cpp
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2009-07-30 00:53:28 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2009-07-30 04:54:44 (GMT)
commit79ed97b8298e3c7e3c7d266c905024affeba7258 (patch)
tree9306b4a8bcaface2c243217aa3bc527aa553ef2f /src/testlib/qtestbasicstreamer.cpp
parenta92117be4323e26efe3f13b5c624e5010a7cd26a (diff)
downloadQt-79ed97b8298e3c7e3c7d266c905024affeba7258.zip
Qt-79ed97b8298e3c7e3c7d266c905024affeba7258.tar.gz
Qt-79ed97b8298e3c7e3c7d266c905024affeba7258.tar.bz2
Make QTestBasicStreamer use dynamically allocated strings.
This commit contains the bare minimum needed for the API to use dynamic allocation; some parts of the code still use static buffers and therefore have constraints on the size of output messages. Task: 253861 Reviewed-by: Michael Goddard
Diffstat (limited to 'src/testlib/qtestbasicstreamer.cpp')
-rw-r--r--src/testlib/qtestbasicstreamer.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/testlib/qtestbasicstreamer.cpp b/src/testlib/qtestbasicstreamer.cpp
index 5fe9d4d..aac57ba 100644
--- a/src/testlib/qtestbasicstreamer.cpp
+++ b/src/testlib/qtestbasicstreamer.cpp
@@ -68,39 +68,39 @@ QTestBasicStreamer::QTestBasicStreamer()
QTestBasicStreamer::~QTestBasicStreamer()
{}
-void QTestBasicStreamer::formatStart(const QTestElement *element, char *formatted) const
+void QTestBasicStreamer::formatStart(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
-void QTestBasicStreamer::formatEnd(const QTestElement *element, char *formatted) const
+void QTestBasicStreamer::formatEnd(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
-void QTestBasicStreamer::formatBeforeAttributes(const QTestElement *element, char *formatted) const
+void QTestBasicStreamer::formatBeforeAttributes(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
-void QTestBasicStreamer::formatAfterAttributes(const QTestElement *element, char *formatted) const
+void QTestBasicStreamer::formatAfterAttributes(const QTestElement *element, char **formatted) const
{
if(!element || !formatted )
return;
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
-void QTestBasicStreamer::formatAttributes(const QTestElement *, const QTestElementAttribute *attribute, char *formatted) const
+void QTestBasicStreamer::formatAttributes(const QTestElement *, const QTestElementAttribute *attribute, char **formatted) const
{
if(!attribute || !formatted )
return;
- QTest::qt_snprintf(formatted, 10, "");
+ QTest::qt_asprintf(formatted, "");
}
void QTestBasicStreamer::output(QTestElement *element) const
@@ -113,7 +113,7 @@ void QTestBasicStreamer::output(QTestElement *element) const
void QTestBasicStreamer::outputElements(QTestElement *element, bool) const
{
- char buf[1024];
+ QTestCharBuffer buf;
bool hasChildren;
/*
Elements are in reverse order of occurrence, so start from the end and work
@@ -148,7 +148,7 @@ void QTestBasicStreamer::outputElements(QTestElement *element, bool) const
void QTestBasicStreamer::outputElementAttributes(const QTestElement* element, QTestElementAttribute *attribute) const
{
- char buf[1024];
+ QTestCharBuffer buf;
while(attribute){
formatAttributes(element, attribute, buf);
outputString(buf);