Exemple #1
0
static int init(int hup)
{
    if(!hup) {
	GCBREG(newtransfercb, reg, NULL);
	chfile(confgetvar("reqstat", "file"), NULL);
	CBREG(confgetvar("reqstat", "file"), conf_update, chfile, NULL, NULL);
    }
    return(0);
}
bool TestCase::loadXmlInformation()
{
    QDomNodeList nodeList = xmlNode.childNodes();
    for(int i = 0; i < nodeList.count(); i++){
        QDomNode nd = nodeList.at(i);
        if(nd.childNodes().count() > 0){
            if(nd.nodeName() == "Name")
                testName = nd.firstChild().nodeValue();
            else if(nd.nodeName() == "InterfaceHeader")
                iheader = getTestFileFolder() + "/" + nd.firstChild().nodeValue();
            else if(nd.nodeName() == "CompareHeader")
                header = getTestFileFolder() + "/" + nd.firstChild().nodeValue();
            else if(nd.nodeName() == "ExpectedResult"){
                QDomNodeList chnodeList = nd.childNodes();
                for(int b = 0; b < chnodeList.count(); b++){
                    QDomNode chnd = chnodeList.at(b);
                    if(chnd.childNodes().size() > 0)
                        expectedResult << chnd.firstChild().nodeValue();
                }
            }
        }
    }
    
    // check if we have all informations
    QTextStream out(&errorMsg);
    if(testName.size() <= 0)
        out << "No test name defined. Error in Test.xml file!" << endl;
    if(iheader.size() <= 0)
        out << "No interface header defined. Error in Test.xml file!" << endl;
    if(header.size() <= 0)
        out << "No compare header defined. Error in Test.xml file!" << endl;
    if(errorMsg.size() > 0)
        return false;

    //check if the headers are available
    QFile ichfile(iheader);
    if (!ichfile.exists()){
        out << iheader << " file not found on drive." << endl;
    }
    QFile chfile(header);
    if (!chfile.exists()){
        out << header << " file not found on drive." << endl;
    }
    if(errorMsg.size() > 0)
        return false;

    return true;
}