static int dumpQObject() { // Requires the childOffset to be know, but that is not critical QAction action(0); QObject x; QAction *a2= new QAction(&action); a2->setObjectName(QLatin1String("a2")); action.setObjectName(QLatin1String("action")); QObject::connect(&action, SIGNAL(triggered()), &x, SLOT(deleteLater())); prepareInBuffer("QObject", "local.qobject", "local.qobject", ""); qDumpObjectData440(2, 42, testAddress(&action), 1, 0, 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputs("\n\n", stdout); // Property list prepareInBuffer("QObjectPropertyList", "local.qobjectpropertylist", "local.qobjectpropertylist", ""); qDumpObjectData440(2, 42, testAddress(&action), 1, 0, 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputs("\n\n", stdout); // Signal list prepareInBuffer("QObjectSignalList", "local.qobjectsignallist", "local.qobjectsignallist", ""); qDumpObjectData440(2, 42, testAddress(&action), 1, 0, 0, 0, 0); fputs(qDumpOutBuffer, stdout); // Slot list prepareInBuffer("QObjectSlotList", "local.qobjectslotlist", "local.qobjectslotlist", ""); qDumpObjectData440(2, 42, testAddress(&action), 1, 0, 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputs("\n\n", stdout); // Signal list prepareInBuffer("QObjectChildList", "local.qobjectchildlist", "local.qobjectchildlist", ""); qDumpObjectData440(2, 42, testAddress(&action), 1, 0, 0, 0, 0); fputs(qDumpOutBuffer, stdout); return 0; }
static int dumpQVariant() { QVariant test = QLatin1String("item"); prepareInBuffer("QVariant", "local.qvariant", "local.qvariant", ""); qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0,0 ,0); fputs(qDumpOutBuffer, stdout); fputs("\n\n", stdout); test = QVariant(int(42)); prepareInBuffer("QVariant", "local.qvariant", "local.qvariant", ""); qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0,0 ,0); fputs(qDumpOutBuffer, stdout); fputs("\n\n", stdout); test = QVariant(double(3.141)); prepareInBuffer("QVariant", "local.qvariant", "local.qvariant", ""); qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0,0 ,0); fputs(qDumpOutBuffer, stdout); fputs("\n\n", stdout); test = QVariant(QStringList(QLatin1String("item1"))); prepareInBuffer("QVariant", "local.qvariant", "local.qvariant", ""); qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0,0 ,0); fputs(qDumpOutBuffer, stdout); test = QVariant(QRect(1,2, 3, 4)); prepareInBuffer("QVariant", "local.qvariant", "local.qvariant", ""); qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0,0 ,0); fputs(qDumpOutBuffer, stdout); return 0; }
static int dumpQQStringVector() { QVector<QString> test = QVector<QString>() << "42s" << "43s"; prepareInBuffer("QVector", "local.qstringvector", "local.qstringvector", "QString"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(QString), 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpQIntVector() { QVector<int> test = QVector<int>() << 42 << 43; prepareInBuffer("QVector", "local.qintvector", "local.qintvector", "int"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(int), 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpQIntLinkedList() { QLinkedList<int> test = QLinkedList<int>() << 1 << 2; prepareInBuffer("QLinkedList", "local.qintlinkedlist", "local.qlinkedintlist", "int"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(int), 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpQStringList() { QStringList test = QStringList() << QLatin1String("item1") << QLatin1String("item2"); prepareInBuffer("QList", "local.qstringlist", "local.qstringlist", "QString"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(QString), 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpStdWString() { std::wstring test = L"hallo"; prepareInBuffer("std::wstring", "local.wstring", "local.wstring", ""); qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
void run () { testAddressV4 (); testAddressV4Proxy(); testAddress (); testEndpoint (); testParse <Endpoint> ("Parse Endpoint"); }
static int dumpQFileInfo() { QFileInfo test(QString::fromLatin1(appPath)); prepareInBuffer("QFileInfo", "local.qfileinfo", "local.qfileinfo",""); qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
// --------------- Qt types static int dumpQString() { QString test = QLatin1String("hallo"); prepareInBuffer("QString", "local.qstring", "local.qstring", ""); qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); QString uninitialized; return 0; }
static int dumpQSharedPointerQString() { QSharedPointer<QString> test(new QString(QLatin1String("hallo"))); prepareInBuffer("QSharedPointer", "local.sharedpointerqstring", "local.local.sharedpointerqstring", "QString"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(QString), 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); QString uninitialized; return 0; }
static int dumpQVariantList() { QVariantList test; if (!optEmptyContainers) { test.push_back(QVariant(QLatin1String("hallo"))); test.push_back(QVariant(42)); test.push_back(QVariant(3.141)); } // As a list prepareInBuffer("QList", "local.qvariantlist", "local.qvariantlist", "QVariant"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(QVariant), 0,0 ,0); fputs(qDumpOutBuffer, stdout); // As typedef fputs("\n\n", stdout); prepareInBuffer("QVariantList", "local.qvariantlist", "local.qvariantlist", ""); qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0,0 ,0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
boolean Z21PacketTest::testAll() { UnitTest::suite("Z21 Packet"); testBasicSet(); testSetHeader(); testAddress(); testBasicGet(); testPacketGet(); return UnitTest::report(); }
static int dumpStdIntSet() { std::set<int> test; if (!optEmptyContainers) { test.insert(1); test.insert(2); } prepareInBuffer("std::set", "local.intset", "local.intset", "int"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(int), sizeof(std::list<int>::allocator_type), 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpStdWStringVector() { std::vector<std::wstring> test; if (!optEmptyContainers) { test.push_back(L"item1"); test.push_back(L"item2"); } prepareInBuffer("std::vector", "local.wstringvector", "local.wstringvector", "std::wstring"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(std::wstring), sizeof(std::list<int>::allocator_type), 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpStdStringQList() { QList<std::string> test; if (!optEmptyContainers) { test.push_back("item1"); test.push_back("item2"); } prepareInBuffer("QList", "local.stringqlist", "local.stringqlist", "std::string"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(std::string), 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpStdQStringSet() { std::set<QString> test; if (!optEmptyContainers) { test.insert(QLatin1String("item1")); test.insert(QLatin1String("item2")); } prepareInBuffer("std::set", "local.stringset", "local.stringset", "QString"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(QString), sizeof(std::list<int>::allocator_type), 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpQSetInt() { QSet<int> test; if (!optEmptyContainers) { test.insert(42); test.insert(43); } prepareInBuffer("QSet", "local.qsetint", "local.qsetint", "int"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(int), 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
Tests() { // TODO: // - Obtain authentication token // - Transaction test // - Presence test // - Ack test // - Benchmarks testClient(); #if 0 testAddress(); #endif }
static int dumpQMapIntInt() { QMap<int,int> test; QMapNode<int,int> mapNode; const int valueOffset = (char*)&(mapNode.value) - (char*)&mapNode; if (!optEmptyContainers) { test.insert(42, 43); test.insert(43, 44); } prepareInBuffer("QMap", "local.qmapintint", "local.qmapintint", "int@int"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(int), sizeof(int), sizeof(mapNode), valueOffset); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpQMapQStringString() { QMap<QString,QString> test; QMapNode<QString,QString> mapNode; const int valueOffset = (char*)&(mapNode.value) - (char*)&mapNode; if (!optEmptyContainers) { test.insert(QLatin1String("42s"), QLatin1String("fortytwo")); test.insert(QLatin1String("423"), QLatin1String("fortytree")); } prepareInBuffer("QMap", "local.qmapqstringqstring", "local.qmapqstringqstring", "QString@QString"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(QString), sizeof(QString), sizeof(mapNode), valueOffset); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpStdMapIntString() { std::map<int,std::string> test; std::map<int,std::string>::value_type entry(42, std::string("fortytwo")); if (!optEmptyContainers) { test.insert(entry); } const int valueOffset = (char*)&(entry.second) - (char*)&entry; prepareInBuffer("std::map", "local.stdmapintstring", "local.stdmapintstring", "int@std::basic_string<char,std::char_traits<char>,std::allocator<char> >@std::less<int>@std::allocator<std::pair<const int,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(int), sizeof(std::string), valueOffset, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
static int dumpStdMapStringString() { typedef std::map<std::string,std::string> TestType; TestType test; const TestType::value_type entry("K", "V"); if (!optEmptyContainers) { test.insert(entry); } const int valueOffset = (char*)&(entry.second) - (char*)&entry; prepareInBuffer("std::map", "local.stdmapstringstring", "local.stdmapstringstring", "std::basic_string<char,std::char_traits<char>,std::allocator<char> >@std::basic_string<char,std::char_traits<char>,std::allocator<char> >@std::less<int>@std::allocator<std::pair<const std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >"); qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(std::string), sizeof(std::string), valueOffset, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); return 0; }
boolean DccStandardTest::testAll() { UnitTest::suite("DccStandard"); testSize(); testAddress(); testMFKind(); testBasicSpeed(); testFunctionF0_F4(); testFunctionF5_F8(); testFunctionF9_F12(); testMF_CV_Short(); testMF_CV_Long(); testAccessoryKind(); testAccessoryAddress(); testAccessoryState(); return UnitTest::report(); }
static int dumpQObjectList() { // Requires the childOffset to be know, but that is not critical QObject *root = new QObject; root ->setObjectName("root"); QTimer *t1 = new QTimer; t1 ->setObjectName("t1"); QTimer *t2 = new QTimer; t2 ->setObjectName("t2"); QObjectList test; test << root << t1 << t2; prepareInBuffer("QList", "local.qobjectlist", "local.qobjectlist", "QObject *"); qDumpObjectData440(2, 42, testAddress(&test), sizeof(QObject*), 0, 0, 0, 0); fputs(qDumpOutBuffer, stdout); fputc('\n', stdout); delete root; return 0; }