aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tools
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2013-01-16 12:07:29 +0100
committerErik Verbruggen <erik.verbruggen@digia.com>2013-01-18 14:02:03 +0100
commit54bb06435a4d3129529d26d275047c1094a64167 (patch)
tree69c18bd0e025fb06b03cf0a5907ae324f5705475 /tests/tools
parent725ecc5f9179df92d4c26dbedea12028fa7d3ea1 (diff)
tests: fix compilation with osx/clang, avoid implicit conversion
- osx clang does not support sending a newly created string to an ostream, converting it to c_str - avoid std::string(QBytearray), as that skips length (I suppose) Change-Id: I3712df9d5e4a6f96420a8f2bf59c3bec9286b788 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'tests/tools')
-rw-r--r--tests/tools/cplusplus-ast2png/cplusplus-ast2png.cpp3
-rw-r--r--tests/tools/qml-ast2dot/main.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/tools/cplusplus-ast2png/cplusplus-ast2png.cpp b/tests/tools/cplusplus-ast2png/cplusplus-ast2png.cpp
index 51d7c37986..9c2829bbbb 100644
--- a/tests/tools/cplusplus-ast2png/cplusplus-ast2png.cpp
+++ b/tests/tools/cplusplus-ast2png/cplusplus-ast2png.cpp
@@ -57,6 +57,7 @@
#include <cstdlib>
#include <fstream>
#include <iostream>
+#include <string>
#ifdef __GNUC__
# include <cxxabi.h>
#endif
@@ -115,7 +116,7 @@ protected:
void alignTerminals() {
out<<"{ rank=same;" << std::endl;
foreach (const QByteArray &terminalShape, _terminalShapes) {
- out << " " << std::string(terminalShape) << ";" << std::endl;
+ out << " " << std::string(terminalShape.constData(), terminalShape.size()).c_str() << ";" << std::endl;
}
out<<"}"<<std::endl;
}
diff --git a/tests/tools/qml-ast2dot/main.cpp b/tests/tools/qml-ast2dot/main.cpp
index db758387aa..7e066bfc22 100644
--- a/tests/tools/qml-ast2dot/main.cpp
+++ b/tests/tools/qml-ast2dot/main.cpp
@@ -43,6 +43,7 @@
#include <cstdlib>
#include <fstream>
#include <iostream>
+#include <string>
#ifdef __GNUC__
# include <cxxabi.h>
#endif
@@ -83,7 +84,7 @@ protected:
void alignTerminals() {
out<<"{ rank=same;" << endl;
foreach (const QByteArray &terminalShape, _terminalShapes) {
- out << " " << string(terminalShape) << ";" << endl;
+ out << " " << string(terminalShape.constData(), terminalShape.size()).c_str() << ";" << endl;
}
out<<"}"<<endl;
}