コード例 #1
0
/******************************************************************************
Function Name  :  ValidateEntity
Input(s)       :  
Output         :  HRESULT
Functionality  :   
Member of      :  CTestSetupEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  13/04/2011
Modifications  :  
Code Tag       :  CS026
******************************************************************************/
HRESULT CTestSetupEntity::ValidateEntity(CString& omStrResult)
{
    UINT unCount;
    GetSubEntryCount(unCount);
    CString omStrHeaderResult;
    HRESULT hResult = ERR_VALID_SUCCESS;

    if(m_ouTestSetupHeader.ValidateEntity(omStrHeaderResult) == ERR_VALID_ERROR)
    {
        omStrResult += omStrHeaderResult;
        hResult = ERR_VALID_ERROR;
    }

    if(unCount <=0 )
    {
        omStrResult += _T("No TestCases Are Defined\r\n");
        hResult = ERR_VALID_ERROR;
    }
    else
    {
        for(UINT i=0; i<unCount; i++)
        {
            CString omStrTcResult;
            CBaseEntityTA* pTcEntity;
            GetSubEntityObj(i, &pTcEntity);
            if(pTcEntity->ValidateEntity(omStrTcResult) == ERR_VALID_ERROR) 
            {
                hResult = ERR_VALID_ERROR;
            }
            omStrResult += omStrTcResult;
        }
    }
    return hResult;
}
コード例 #2
0
/******************************************************************************
Function Name  :  ValidateEntity
Input(s)       :  
Output         :  HRESULT
Functionality  :   
Member of      :  CVerifyEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  13/04/2011
Modifications  :  
Code Tag       :  CS030
******************************************************************************/
HRESULT CVerifyEntity::ValidateEntity(CString& omStrResult)
{
    UINT unVerifyMessageCount;
    GetSubEntryCount(unVerifyMessageCount);
    if(unVerifyMessageCount <= 0)
    {
        omStrResult += (_T("Error: Has No Verify Messages\r\n"));       //CS030
        return ERR_VALID_ERROR;
    }
    return ERR_VALID_SUCCESS;
}
コード例 #3
0
ファイル: SendEntity.cpp プロジェクト: Fetze/busmaster
/******************************************************************************
Function Name  :  ValidateEntity
Input(s)       :  
Output         :  HRESULT
Functionality  :   
Member of      :  CSendEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  13/04/2011
Modifications  :  
Code Tag       : CS026
******************************************************************************/
HRESULT CSendEntity::ValidateEntity(CString& omStrResult)
{
    UINT unSendMessageCount;
    GetSubEntryCount(unSendMessageCount);
    if(unSendMessageCount <= 0)
    {
        omStrResult += (_T("Warning: Has No Send Messages\r\n"));
        return ERR_VALID_WARNING;               //CS026
    }
    return ERR_VALID_SUCCESS;
}
コード例 #4
0
/******************************************************************************
Function Name  :  ValidateEntity
Input(s)       :
Output         :  HRESULT
Functionality  :
Member of      :  CVerifyResponse
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  13/04/2011
Modifications  :
Code Tag       :
******************************************************************************/
HRESULT CVerifyResponse::ValidateEntity(CString& omStrResult)
{
    UINT unVerifyMessageCount;
    GetSubEntryCount(unVerifyMessageCount);
    if(unVerifyMessageCount <= 0)
    {
        omStrResult += _("Error: Has No Verify Messages");
        omStrResult += "\r\n";
        return ERR_VALID_ERROR;
    }
    return ERR_VALID_SUCCESS;
}
コード例 #5
0
/******************************************************************************
Function Name  :  ValidateEntity
Input(s)       :  
Output         :  HRESULT
Functionality  :   
Member of      :  CTestCaseEntity
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  13/04/2011
Modifications  :  
Code Tag       :  CS028
******************************************************************************/
HRESULT CTestCaseEntity::ValidateEntity(CString& omStrResult)
{
    UINT unTestCaseCount;
    CString omStrTemp;
    GetSubEntryCount(unTestCaseCount);
    
    HRESULT hResult = ERR_VALID_SUCCESS;
    if(unTestCaseCount == 0)
    {
        omStrTemp.Format("\tError: Atleast One Verify Node Should be Defined\r\n");
        hResult = ERR_VALID_ERROR;      //CS028
    }
    else
    {
        BOOL bVerifyEntityFound = FALSE;
        //omStrTemp = "\t";
        for(UINT i = 0; i < unTestCaseCount; i++)
        {
            CString omStrTCResult;
            CBaseEntityTA* pTCSubEntity;
            if(GetSubEntityObj(i, &pTCSubEntity) == S_OK)
            {
                omStrTCResult.Format(_T("Node %d:"), i+1);
                HRESULT hTempResult = pTCSubEntity->ValidateEntity(omStrTCResult);
                if(hTempResult != ERR_VALID_SUCCESS)
                {   
                    omStrTemp += "\t" + omStrTCResult;
                    if(hResult != ERR_VALID_ERROR)
                    {
                        hResult = hTempResult;
                    }
                }
                if(pTCSubEntity->GetEntityType() == VERIFY)
                {
                    bVerifyEntityFound = TRUE;
                }
                
            }
        }
        if(bVerifyEntityFound == FALSE)
        {
            omStrTemp += "\tError: No Verify Entity Found\r\n";
            hResult = ERR_VALID_ERROR;
        }
    }
    if(hResult != ERR_VALID_SUCCESS)
    {
        omStrResult.Format(_T("TestCase %s Result \r\n"), m_ouData.m_omTitle);
        omStrResult += omStrTemp + "\n";
    }
    return hResult;
}
コード例 #6
0
/******************************************************************************
Function Name  :  SearchEntityObject
Input(s)       :  DWORD dwId - ID of the Entity
                  CBaseEntityTA** pEnityObject - entity object
Output         :  HRESULT - S_OK if the ID is Found
Functionality  :  Retrives the entity of the Given ID.
Member of      :  CBaseEntityTA
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  06/04/2011
Modifications  :
******************************************************************************/
HRESULT CBaseEntityTA::SearchEntityObject(DWORD dwId, CBaseEntityTA** pEnityObject)
{
    *pEnityObject = NULL;

    if( GetID() == dwId)
    {
        *pEnityObject = this;
    }
    else
    {
        UINT unSubEntities = 0;
        GetSubEntryCount(unSubEntities);
        for( UINT i = 0; (i < unSubEntities)&&(*pEnityObject == NULL); i++)
        {
            CBaseEntityTA* pouSubEntityObj = NULL;
            GetSubEntityObj(i, &pouSubEntityObj);
            pouSubEntityObj->SearchEntityObject(dwId, pEnityObject);
        }
    }
    return S_OK;
}