void File::CheckConsistency( void) { if (this == &volume->root) { ASSERT( !sibPrev); } else { ASSERT( sibPrev); ASSERT( *sibPrev == this); if (sibNext) { ASSERT( sibNext->sibPrev == &sibNext); } } if (openPrev) { ASSERT( *openPrev == this); if (openNext) { ASSERT( openNext->openPrev == &openNext); } } if (fileType == pfmFileTypeFolder) { for (File* child = data.folder.firstChild; !!child; child = child->sibNext) { ASSERT( child->parent == this); child->CheckConsistency(); } } }
void Volume::CheckConsistency(void) { if (firstOpenFile) { ASSERT( firstOpenFile->openPrev == &firstOpenFile); } root.CheckConsistency(); }