From d9e797d647c3ae6933b6a6d511307c2d53ca7cee Mon Sep 17 00:00:00 2001 From: dsandersoremutah Date: Thu, 9 Feb 2006 23:39:48 +0000 Subject: [PATCH] When comparing FlmRecords if a field is empty, we cannot compare the data type - because it is not guaranteed to be preserved. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@96 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- flaim/util/basic_test.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/flaim/util/basic_test.cpp b/flaim/util/basic_test.cpp index f7512ba..59b079e 100644 --- a/flaim/util/basic_test.cpp +++ b/flaim/util/basic_test.cpp @@ -2155,15 +2155,6 @@ RCODE IFlmTestImpl::compareRecords( pszDb2, (unsigned)uiLevel2); goto Exit; } - if (uiDataType1 != uiDataType2) - { - rc = RC_SET( FERR_FAILURE); - f_sprintf( m_szFailInfo, "Field Type mismatch in %s, Fld: %u, %s: %u, %s: %u", - pszWhat, (unsigned)uiFieldNum1, - pszDb1, (unsigned)uiDataType1, - pszDb2, (unsigned)uiDataType2); - goto Exit; - } if (uiDataLength1 != uiDataLength2) { rc = RC_SET( FERR_FAILURE); @@ -2173,6 +2164,21 @@ RCODE IFlmTestImpl::compareRecords( pszDb2, (unsigned)uiDataLength2); goto Exit; } + + // Data type is not guaranteed to be preserved if there is no data. + + if (uiDataLength1) + { + if (uiDataType1 != uiDataType2) + { + rc = RC_SET( FERR_FAILURE); + f_sprintf( m_szFailInfo, "Field Type mismatch in %s, Fld: %u, %s: %u, %s: %u", + pszWhat, (unsigned)uiFieldNum1, + pszDb1, (unsigned)uiDataType1, + pszDb2, (unsigned)uiDataType2); + goto Exit; + } + } if (uiEncLength1 != uiEncLength2) { rc = RC_SET( FERR_FAILURE);