From ac6ff7695b03a8a3716e1822ecff3912f93ae122 Mon Sep 17 00:00:00 2001 From: ahodgkinson Date: Tue, 13 Jun 2006 20:20:24 +0000 Subject: [PATCH] Added various tests after the call to FlmDbCheck to verify that the database is corruption-free. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@569 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- flaim/util/basic_test.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/flaim/util/basic_test.cpp b/flaim/util/basic_test.cpp index d969768..4cb2444 100644 --- a/flaim/util/basic_test.cpp +++ b/flaim/util/basic_test.cpp @@ -3248,12 +3248,13 @@ Exit: Desc: ****************************************************************************/ RCODE IFlmTestImpl::checkDbTest( - const char * pszDbName) + const char * pszDbName) { - RCODE rc = FERR_OK; - FLMBOOL bPassed = FALSE; - char szTest [200]; - F_Pool pool; + RCODE rc = FERR_OK; + FLMBOOL bPassed = FALSE; + char szTest [200]; + F_Pool pool; + DB_CHECK_PROGRESS checkStats; pool.poolInit( 512); @@ -3261,12 +3262,20 @@ RCODE IFlmTestImpl::checkDbTest( beginTest( szTest); if( RC_BAD( rc = FlmDbCheck( HFDB_NULL, pszDbName, NULL, NULL, - FLM_CHK_INDEX_REFERENCING | FLM_CHK_FIELDS, &pool, NULL, - NULL, NULL))) + FLM_CHK_INDEX_REFERENCING | FLM_CHK_FIELDS, &pool, &checkStats, + NULL, NULL))) { MAKE_ERROR_STRING( "calling FlmDbCheck", rc, m_szFailInfo); goto Exit; } + + if( checkStats.bLogicalIndexCorrupt || checkStats.bPhysicalCorrupt) + { + rc = RC_SET( FERR_DATA_ERROR); + MAKE_ERROR_STRING( "calling FlmDbCheck", rc, m_szFailInfo); + goto Exit; + } + bPassed = TRUE; Exit: