Commit 8c559757 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère
Browse files

Fixed all QDataStream benches

parent 3a1fae1e
......@@ -165,27 +165,6 @@ int main()
GROUP("<atoms")
{
START {
b.seek(0); b.buffer().clear();
QDataStream(&b)
<< 1.333333333333f
<< PI
<< text
<< false
;
}
STOP("QDataStream",QString::fromUtf8(b.buffer().toHex()));
START {
b.seek(0); b.buffer().clear();
QDataStream d(&b);
DataStreamWriter(&d).sequence()
.bind(1.333333333333f)
.bind(PI)
.bind(text)
.bind(false)
;
}
STOP("DataStream",QString::fromUtf8(b.buffer().toHex()));
START {
s.clear();
QDebug(&s)
......@@ -240,24 +219,31 @@ int main()
CborWriter(&b).bind(writables); // TODO Fix false > 0
}
STOP("Writables>Cbor",QString::fromUtf8(b.buffer().toHex()));
}
GROUP_STOP;
GROUP("<doubles")
{
START {
b.seek(0); b.buffer().clear();
QDataStream data(&b);
for (int i=0; i < 16; i++) {
data << transform[i];
};
QDataStream d(&b);
DataStreamWriter(&d).sequence()
.bind(1.333333333333f)
.bind(PI)
.bind(text)
.bind(false)
;
}
STOP("QDataStream",QString::fromUtf8(b.buffer().toHex()));
STOP("DataStream",QString::fromUtf8(b.buffer().toHex()));
START {
b.seek(0); b.buffer().clear();
QDataStream d(&b);
DataStreamWriter(&d).bind(transform);
QDataStream(&b)
<< 1.333333333333f
<< PI
<< text
<< false
;
}
STOP("DataStream",QString::fromUtf8(b.buffer().toHex()));
STOP("QDataStream",QString::fromUtf8(b.buffer().toHex()));
}
GROUP_STOP;
GROUP("<doubles")
{
START {
s.clear();
QDebug data(&s);
......@@ -292,27 +278,25 @@ int main()
CborWriter(&b).bind(writable);
}
STOP("Writable>Cbor",QString::fromUtf8(b.buffer().toHex()));
}
GROUP_STOP
GROUP("<Person")
{
START {
b.seek(0); b.buffer().clear();
QDataStream(&b)
<< person.firstName.constData()
<< person. lastName.constData()
<< person. height
<< person. age
<< person. phones
;
QDataStream d(&b);
DataStreamWriter(&d).bind(transform);
}
STOP("QDataStream",QString::fromUtf8(b.buffer().toHex()));
STOP("DataStream",QString::fromUtf8(b.buffer().toHex()));
START {
b.seek(0); b.buffer().clear();
QDataStream d(&b);
DataStreamWriter(&d).bind(person);
QDataStream data(&b);
data << transform.size();
for (int i=0; i < 16; i++) {
data << transform[i];
};
}
STOP("DataStream",QString::fromUtf8(b.buffer().toHex()));
STOP("QDataStream",QString::fromUtf8(b.buffer().toHex()));
}
GROUP_STOP
GROUP("<Person")
{
START {
s.clear();
QDebug(&s) << '['
......@@ -349,6 +333,23 @@ int main()
CborWriter(&b).bind(writable);
}
STOP("Writable>Cbor",QString::fromUtf8(b.buffer().toHex()));
START {
b.seek(0); b.buffer().clear();
QDataStream d(&b);
DataStreamWriter(&d).bind(person);
}
STOP("DataStream",QString::fromUtf8(b.buffer().toHex()));
START {
b.seek(0); b.buffer().clear();
QDataStream d(&b);
d << person.firstName;
d << person. lastName;
d << person. height;
d << person. age;
d << person. phones;
;
}
STOP("QDataStream",QString::fromUtf8(b.buffer().toHex()));
}
GROUP_STOP
GROUP("Read+Write")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment