Thread safety implemented for registerPacker and registerUnpacker

This commit is contained in:
Roman committed 2015-04-14 22:50:20 +03:00
1 parent dd24abd0b7
commit e7c6afcd49
5 files changed
+34 -13

No files matched your search

+4 -2
View File
@@ -90,9 +90,11 @@ void MixedTest::test_ext()
QVariant custom;
custom.setValue(ct);
MsgPack::registerPacker((QMetaType::Type)qMetaTypeId<CustomType>(),
bool packer_registered = MsgPack::registerPacker((QMetaType::Type)qMetaTypeId<CustomType>(),
3, pack_custom_type);
MsgPack::registerUnpacker(3, unpack_custom_type);
QVERIFY(packer_registered);
bool unpacker_registered = MsgPack::registerUnpacker(3, unpack_custom_type);
QVERIFY(unpacker_registered);
QByteArray arr = MsgPack::pack(custom);
QVERIFY(arr.size() == 2 + ct.size());