From f168be6724a451a2b3c9c2ee84e004e9a1202ac3 Mon Sep 17 00:00:00 2001 From: dsandersoremutah Date: Fri, 10 Feb 2006 00:05:09 +0000 Subject: [PATCH] Modified so that we only don't compare field types if the field number is one of our reserved fields. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@97 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- flaim/util/basic_test.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/flaim/util/basic_test.cpp b/flaim/util/basic_test.cpp index 59b079e..f32ab03 100644 --- a/flaim/util/basic_test.cpp +++ b/flaim/util/basic_test.cpp @@ -2165,19 +2165,22 @@ RCODE IFlmTestImpl::compareRecords( goto Exit; } - // Data type is not guaranteed to be preserved if there is no data. + // Data type may not match for FLAIM's reserved field numbers. This is because + // FLAIM does not store the field type for these fields - it just assumes that + // they are FLM_TEXT_TYPE. However, we also have some code where FLAIM puts + // a FLM_CONTEXT_TYPE into the field when it is created inside a FlmRecord + // object. If that object remains cached, but the one we are comparing it to + // is not cached, we would have a mismatch. Hence, we simply ignore field + // type for these fields. - if (uiDataLength1) + if (uiDataType1 != uiDataType2 && uiFieldNum1 < FLM_DICT_FIELD_NUMS) { - 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; - } + 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) {