26 #ifndef __TERRALIB_UNITTEST_MEMORY_EXPANSIBLEBANDBLOCKSMANAGER_INTERNAL_H 27 #define __TERRALIB_UNITTEST_MEMORY_EXPANSIBLEBANDBLOCKSMANAGER_INTERNAL_H 30 #include <cppunit/extensions/HelperMacros.h> 51 template<
typename DataType >
57 for(
unsigned int bandIdx = 0 ; bandIdx < bandsNumber ; ++bandIdx )
62 const unsigned int elementsNumber = blocksSizesBytes /
63 ((
unsigned int)
sizeof( DataType ));
65 for(
unsigned int blockX = 0 ; blockX < numberOfBlocksX ; ++blockX )
66 for(
unsigned int blockY = 0 ; blockY < numberOfBlocksY ; ++blockY )
68 DataType* dataPtr = (DataType*)manager.
getBlockPointer( bandIdx, blockX, blockY );
69 assert( dataPtr != 0 );
71 for(
unsigned int elemIdx = 0 ; elemIdx < elementsNumber ; ++elemIdx )
73 dataPtr[ elemIdx ] = counter;
80 template<
typename DataType >
86 for(
unsigned int bandIdx = 0 ; bandIdx < bandsNumber ; ++bandIdx )
91 const unsigned int elementsNumber = blocksSizesBytes /
92 ((
unsigned int)
sizeof( DataType ));
94 for(
unsigned int blockX = 0 ; blockX < numberOfBlocksX ; ++blockX )
95 for(
unsigned int blockY = 0 ; blockY < numberOfBlocksY ; ++blockY )
97 DataType* dataPtr = (DataType*)manager.
getBlockPointer( bandIdx, blockX, blockY );
98 assert( dataPtr != 0 );
100 for(
unsigned int elemIdx = 0 ; elemIdx < elementsNumber ; ++elemIdx )
102 CPPUNIT_ASSERT( dataPtr[ elemIdx ] == counter );
114 #endif // __TERRALIB_UNITTEST_MEMORY_EXPANSIBLEBANDBLOCKSMANAGER_INTERNAL_H void FillBlocks(te::mem::ExpansibleBandBlocksManager &manager)
This file contains include headers for the memory data source of TerraLib.
void * getBlockPointer(unsigned int band, unsigned int x, unsigned int y)
Returns a pointer to the required data block.
unsigned int getNumberOfBands() const
Returns the number of bands.
CPPUNIT_TEST_SUITE(TsExpansibleBandBlocksManager)
RAM cached and tiled raster band blocks manager.
unsigned int getNumberOfBlocksY(const unsigned int band) const
Returns the number of blocks along the Y directon for the required band.
A test suit for the Expansible Band Blocks Manager Class.
unsigned long int getBlockSizeBytes()
Returns the internal size( bytes ) used for all internal blocks.
unsigned int getNumberOfBlocksX(const unsigned int band) const
Returns the number of blocks along the X directon for the required band.
CPPUNIT_TEST(ReadWriteTest)
void CheckValues(te::mem::ExpansibleBandBlocksManager &manager)