Share some more test helpers.
svn path=/branches/work/~ervin/qtjolie/; revision=978070
This commit is contained in:
parent
968f969f89
commit
4df21c1b83
@ -28,6 +28,35 @@
|
|||||||
#include <QtJolie/Value>
|
#include <QtJolie/Value>
|
||||||
#include "../qtjolie/sodephelpers_p.h"
|
#include "../qtjolie/sodephelpers_p.h"
|
||||||
|
|
||||||
|
inline void sodepDump(const Jolie::Value &value, int level)
|
||||||
|
{
|
||||||
|
QByteArray indent;
|
||||||
|
|
||||||
|
while (level>0) {
|
||||||
|
indent+=" ";
|
||||||
|
level--;
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug() << (indent+value.toByteArray()) << value.toInt() << value.toDouble();
|
||||||
|
foreach (const QByteArray &name, value.childrenNames()) {
|
||||||
|
QList<Jolie::Value> children = value.children(name);
|
||||||
|
qDebug() << (indent+"Children:") << name;
|
||||||
|
foreach (const Jolie::Value &child, children) {
|
||||||
|
sodepDump(child, level+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void sodepDump(const Jolie::Message &message)
|
||||||
|
{
|
||||||
|
qDebug() << "Resource :" << message.resourcePath();
|
||||||
|
qDebug() << "Operation:" << message.operationName();
|
||||||
|
qDebug() << "Fault :" << message.fault().name();
|
||||||
|
sodepDump(message.fault().data(), 1);
|
||||||
|
qDebug() << "Value :";
|
||||||
|
sodepDump(message.data(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
inline void sodepCompare(const Jolie::Value &v1, const Jolie::Value &v2)
|
inline void sodepCompare(const Jolie::Value &v1, const Jolie::Value &v2)
|
||||||
{
|
{
|
||||||
QCOMPARE(v1.isValid(), v2.isValid());
|
QCOMPARE(v1.isValid(), v2.isValid());
|
||||||
|
@ -34,35 +34,6 @@
|
|||||||
|
|
||||||
using namespace Jolie;
|
using namespace Jolie;
|
||||||
|
|
||||||
void dump(const Value &value, int level)
|
|
||||||
{
|
|
||||||
QByteArray indent;
|
|
||||||
|
|
||||||
while (level>0) {
|
|
||||||
indent+=" ";
|
|
||||||
level--;
|
|
||||||
}
|
|
||||||
|
|
||||||
qDebug() << (indent+value.toByteArray()) << value.toInt() << value.toDouble();
|
|
||||||
foreach (const QByteArray &name, value.childrenNames()) {
|
|
||||||
QList<Value> children = value.children(name);
|
|
||||||
qDebug() << (indent+"Children:") << name;
|
|
||||||
foreach (const Value &child, children) {
|
|
||||||
dump(child, level+1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void dump(const Message &message)
|
|
||||||
{
|
|
||||||
qDebug() << "Resource :" << message.resourcePath();
|
|
||||||
qDebug() << "Operation:" << message.operationName();
|
|
||||||
qDebug() << "Fault :" << message.fault().name();
|
|
||||||
dump(message.fault().data(), 1);
|
|
||||||
qDebug() << "Value :";
|
|
||||||
dump(message.data(), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
class TestMetaService : public QObject
|
class TestMetaService : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user