Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/testlib/qtestlogger.cpp

    r651 r769  
    212212        failureElement->addAttribute(QTest::AI_Line, buf);
    213213        failureElement->addAttribute(QTest::AI_Description, description);
    214         const char* tag = QTestResult::currentDataTag();
    215         if (tag) {
    216             failureElement->addAttribute(QTest::AI_Tag, tag);
    217         }
     214        addTag(failureElement);
    218215        currentLogElement->addLogElement(failureElement);
    219216    }
     
    278275}
    279276
     277void QTestLogger::addTag(QTestElement* element)
     278{
     279    const char *tag = QTestResult::currentDataTag();
     280    const char *gtag = QTestResult::currentGlobalDataTag();
     281    const char *filler = (tag && gtag) ? ":" : "";
     282    if ((!tag || !tag[0]) && (!gtag || !gtag[0])) {
     283        return;
     284    }
     285
     286    if (!tag) {
     287        tag = "";
     288    }
     289    if (!gtag) {
     290        gtag = "";
     291    }
     292
     293    QTestCharBuffer buf;
     294    QTest::qt_asprintf(&buf, "%s%s%s", gtag, filler, tag);
     295    element->addAttribute(QTest::AI_Tag, buf.constData());
     296}
     297
    280298void QTestLogger::addMessage(MessageTypes type, const char *message, const char *file, int line)
    281299{
     
    298316    case QAbstractTestLogger::QWarning:
    299317        ++qwarnCounter;
    300         typeBuf = "qwarning";
     318        typeBuf = "qwarn";
    301319        break;
    302320    case QAbstractTestLogger::QFatal:
     
    319337    errorElement->addAttribute(QTest::AI_Type, typeBuf);
    320338    errorElement->addAttribute(QTest::AI_Description, message);
     339    addTag(errorElement);
    321340
    322341    if(file)
Note: See TracChangeset for help on using the changeset viewer.