| 1058 | } |
| 1059 | |
| 1060 | bool CAICHHashSet::IsPartDataAvailable(uint64 nPartStartPos) |
| 1061 | { |
| 1062 | if (!(m_eStatus == AICH_VERIFIED || m_eStatus == AICH_TRUSTED || m_eStatus == AICH_HASHSETCOMPLETE) ) { |
| 1063 | wxFAIL; |
| 1064 | return false; |
| 1065 | } |
| 1066 | uint64 nPartSize = min<uint64>(PARTSIZE, m_pOwner->GetFileSize()-nPartStartPos); |
| 1067 | for (uint64 nPartPos = 0; nPartPos < nPartSize; nPartPos += EMBLOCKSIZE) { |
| 1068 | CAICHHashTree* phtToCheck = m_pHashTree.FindHash(nPartStartPos+nPartPos, min<uint64>(EMBLOCKSIZE, nPartSize-nPartPos)); |
| 1069 | if (phtToCheck == NULL || !phtToCheck->m_bHashValid) { |
| 1070 | return false; |
| 1071 | } |
| 1072 | } |
| 1073 | return true; |
| 1074 | } |
| 1075 | |
| 1076 | // VC++ defines Assert as ASSERT. VC++ also defines VERIFY MACRO, which is the equivalent of ASSERT but also works in Released builds. |
| 1077 |
no test coverage detected