|
void CTest_DB::TestPMDB_ClearFileData()
{
TEST_CASE_TRACE("Begin");
CString strSamplePath;
strSamplePath.Format("%s\\BaseTestCase\\SwitchView",m_strCurrentPath);
CString strTrace;
strTrace.Format("Create a ItemFolder %s",strSamplePath);
TEST_CASE_TRACE(strTrace);
CItemFolder * pItemFolder;
PMDB_CreateFolder(strSamplePath,pItemFolder);
if (pItemFolder)
{
CString strOldFileName(_T("OCR Pro 4.jpg"));
CItemFile* pOldItem = pItemFolder->GetItemFile(strOldFileName);
strTrace.Format("Get %s ItemFile info %s",strOldFileName);
TEST_CASE_TRACE(strTrace);
CPropertyInfo * pInfo = pOldItem->GetPropertyInfo(PROPERTYID_KEYWORD);
pInfo->SetProperData("Test PROPERTYID_KEYWORD");
strTrace.Format("Add KeyWord Test PROPERTYID_KEYWORD",strOldFileName);
TEST_CASE_TRACE(strTrace);
pInfo = pOldItem->GetPropertyInfo(PROPERTYID_AUTHOR);
pInfo->SetProperData("Test PROPERTYID_AUTHOR");
strTrace.Format("Add Author Test PROPERTYID_AUTHOR");
TEST_CASE_TRACE(strTrace);
pInfo = pOldItem->GetPropertyInfo(PROPERTYID_MEMORY);
pInfo->SetProperData("Test PROPERTYID_MEMORY");
strTrace.Format("Add Memory Test PROPERTYID_MEMORY");
TEST_CASE_TRACE(strTrace);
pOldItem->UpdateProperty(FALSE);
CString strFile;
strFile.Format("%s\\OCR Pro 4.jpg",strSamplePath);
strTrace.Format("Call PMDB_ClearFileData to Delete file info");
TEST_CASE_TRACE(strTrace);
PMDB_ClearFileData(strFile);
pOldItem->UpdateProperty(TRUE);
CString strData;
pInfo = pOldItem->GetPropertyInfo(PROPERTYID_KEYWORD);
strData = pInfo->GetProperData();
strTrace.Format("Get File %s,KeyWord = %s",strFile,strData);
TEST_CASE_TRACE(strTrace);
TEST_CASE_ASSERT(strData.CompareNoCase("Test PROPERTYID_KEYWORD") != 0);
pInfo = pOldItem->GetPropertyInfo(PROPERTYID_AUTHOR);
strData = pInfo->GetProperData();
strTrace.Format("Get File %s,AUTHOR = %s",strFile,strData);
TEST_CASE_TRACE(strTrace);
TEST_CASE_ASSERT(strData.CompareNoCase("Test PROPERTYID_AUTHOR") != 0);
pInfo = pOldItem->GetPropertyInfo(PROPERTYID_MEMORY);
strData = pInfo->GetProperData();
strTrace.Format("Get File %s,MEMORY = %s",strFile,strData);
TEST_CASE_TRACE(strTrace);
TEST_CASE_ASSERT(strData.CompareNoCase("Test PROPERTYID_MEMORY") != 0);
strTrace.Format("Free ItemFolder");
TEST_CASE_TRACE(strTrace);
delete pItemFolder;
pItemFolder = NULL;
}
TEST_CASE_TRACE("End");
} |
|