[fdo-commits] r2511 - trunk/Fdo/UnitTest
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Wed Feb 14 03:02:15 EST 2007
Author: warmerdam
Date: 2007-02-14 03:02:15 -0500 (Wed, 14 Feb 2007)
New Revision: 2511
Modified:
trunk/Fdo/UnitTest/ExpressionParseTest.cpp
trunk/Fdo/UnitTest/FilterParseTest.cpp
Log:
use INT_MIN/MAX for 32bit ranges (64bit ticket #6)
Modified: trunk/Fdo/UnitTest/ExpressionParseTest.cpp
===================================================================
--- trunk/Fdo/UnitTest/ExpressionParseTest.cpp 2007-02-13 19:06:08 UTC (rev 2510)
+++ trunk/Fdo/UnitTest/ExpressionParseTest.cpp 2007-02-14 08:02:15 UTC (rev 2511)
@@ -20,6 +20,8 @@
#include "TestProcessor.h"
#endif
+#define DEBUG_DETAIL 1
+
#include "UnitTestUtil.h"
#include "malloc.h" // for alloca()
@@ -395,17 +397,17 @@
CPPUNIT_ASSERT(pLVal2 != NULL);
CPPUNIT_ASSERT(pLVal2->GetInt32() == SHRT_MAX);
- pVal = FdoInt32Value::Create(LONG_MIN);
+ pVal = FdoInt32Value::Create(INT_MIN);
pVal2 = roundTripBoundaryValue(pVal);
pLVal2 = dynamic_cast<FdoInt32Value*>((FdoDataValue*) pVal2);
CPPUNIT_ASSERT(pLVal2 != NULL);
- CPPUNIT_ASSERT(pLVal2->GetInt32() == LONG_MIN);
+ CPPUNIT_ASSERT(pLVal2->GetInt32() == INT_MIN);
- pVal = FdoInt32Value::Create(LONG_MAX);
+ pVal = FdoInt32Value::Create(INT_MAX);
pVal2 = roundTripBoundaryValue(pVal);
pLVal2 = dynamic_cast<FdoInt32Value*>((FdoDataValue*) pVal2);
CPPUNIT_ASSERT(pLVal2 != NULL);
- CPPUNIT_ASSERT(pLVal2->GetInt32() == LONG_MAX);
+ CPPUNIT_ASSERT(pLVal2->GetInt32() == INT_MAX);
pVal = FdoInt64Value::Create(LLONG_MIN);
pVal2 = roundTripBoundaryValue(pVal);
@@ -419,17 +421,17 @@
CPPUNIT_ASSERT(pLLVal2 != NULL);
CPPUNIT_ASSERT(pLLVal2->GetInt64() == LLONG_MAX);
- pVal = FdoInt64Value::Create(LONG_MIN);
+ pVal = FdoInt64Value::Create(INT_MIN);
pVal2 = roundTripBoundaryValue(pVal);
pLVal2 = dynamic_cast<FdoInt32Value*>((FdoDataValue*) pVal2);
CPPUNIT_ASSERT(pLVal2 != NULL);
- CPPUNIT_ASSERT(pLVal2->GetInt32() == LONG_MIN);
+ CPPUNIT_ASSERT(pLVal2->GetInt32() == INT_MIN);
- pVal = FdoInt64Value::Create(LONG_MAX);
+ pVal = FdoInt64Value::Create(INT_MAX);
pVal2 = roundTripBoundaryValue(pVal);
pLVal2 = dynamic_cast<FdoInt32Value*>((FdoDataValue*) pVal2);
CPPUNIT_ASSERT(pLVal2 != NULL);
- CPPUNIT_ASSERT(pLVal2->GetInt32() == LONG_MAX);
+ CPPUNIT_ASSERT(pLVal2->GetInt32() == INT_MAX);
}
catch (FdoException *e)
{
Modified: trunk/Fdo/UnitTest/FilterParseTest.cpp
===================================================================
--- trunk/Fdo/UnitTest/FilterParseTest.cpp 2007-02-13 19:06:08 UTC (rev 2510)
+++ trunk/Fdo/UnitTest/FilterParseTest.cpp 2007-02-14 08:02:15 UTC (rev 2511)
@@ -250,12 +250,12 @@
expressions->Add( FdoByteValue::Create(UCHAR_MAX) );
expressions->Add( FdoInt16Value::Create(SHRT_MIN) );
expressions->Add( FdoInt16Value::Create(SHRT_MAX) );
- expressions->Add( FdoInt32Value::Create(LONG_MIN) );
- expressions->Add( FdoInt32Value::Create(LONG_MAX) );
+ expressions->Add( FdoInt32Value::Create(INT_MIN) );
+ expressions->Add( FdoInt32Value::Create(INT_MAX) );
expressions->Add( FdoInt64Value::Create(LLONG_MIN) );
expressions->Add( FdoInt64Value::Create(LLONG_MAX) );
- expressions->Add( FdoInt64Value::Create(LONG_MIN) );
- expressions->Add( FdoInt64Value::Create(LONG_MAX) );
+ expressions->Add( FdoInt64Value::Create(INT_MIN) );
+ expressions->Add( FdoInt64Value::Create(INT_MAX) );
FdoPtr<FdoInCondition> in1 = FdoInCondition::Create( ident, expressions );
FdoPtr<FdoFilter> filter = FdoFilter::Parse(in1->ToString());
@@ -289,12 +289,12 @@
pVal2 = expressions2->GetItem(4);
pLVal2 = dynamic_cast<FdoInt32Value*>((FdoValueExpression*) pVal2);
CPPUNIT_ASSERT(pLVal2 != NULL);
- CPPUNIT_ASSERT(pLVal2->GetInt32() == LONG_MIN);
+ CPPUNIT_ASSERT(pLVal2->GetInt32() == INT_MIN);
pVal2 = expressions2->GetItem(5);
pLVal2 = dynamic_cast<FdoInt32Value*>((FdoValueExpression*) pVal2);
CPPUNIT_ASSERT(pLVal2 != NULL);
- CPPUNIT_ASSERT(pLVal2->GetInt32() == LONG_MAX);
+ CPPUNIT_ASSERT(pLVal2->GetInt32() == INT_MAX);
pVal2 = expressions2->GetItem(6);
FdoInt64Value* pLLVal2 = dynamic_cast<FdoInt64Value*>((FdoValueExpression*) pVal2);
@@ -309,12 +309,12 @@
pVal2 = expressions2->GetItem(8);
pLVal2 = dynamic_cast<FdoInt32Value*>((FdoValueExpression*) pVal2);
CPPUNIT_ASSERT(pLVal2 != NULL);
- CPPUNIT_ASSERT(pLVal2->GetInt32() == LONG_MIN);
+ CPPUNIT_ASSERT(pLVal2->GetInt32() == INT_MIN);
pVal2 = expressions2->GetItem(9);
pLVal2 = dynamic_cast<FdoInt32Value*>((FdoValueExpression*) pVal2);
CPPUNIT_ASSERT(pLVal2 != NULL);
- CPPUNIT_ASSERT(pLVal2->GetInt32() == LONG_MAX);
+ CPPUNIT_ASSERT(pLVal2->GetInt32() == INT_MAX);
}
catch (FdoException *e)
{
More information about the fdo-commits
mailing list