Commit 03a104aa authored by George Zagaris's avatar George Zagaris
Browse files

ENH: Added Serialize/Deserialize for AMR box

Added a simple test case for the AMR box serialization
and deserialization functionality. Also, excluded the
AMR kit classes from wrapping.
parent f3bd58ea
......@@ -5,5 +5,9 @@ SET(UKIT AMR)
## Get the kit sources
FILE( GLOB Kit_SRCS *.cxx )
SET_SOURCE_FILES_PROPERTIES(
vtkAMRGridIndexEncoder
WRAP_EXCLUDE
)
## Include CMAKE code common to all kits
INCLUDE(${VTK_CMAKE_DIR}/KitCommonBlock.cmake )
\ No newline at end of file
......@@ -277,6 +277,34 @@ int TestAMRBox(int , char *[])
return 1;
}
}
// Serialize/Deserialize
{
vtkAMRBox A( 0,0,0, 9,9,9 );
unsigned char *buffer = NULL;
size_t bytesize = 0;
A.Serialize( buffer, bytesize );
if( (buffer == NULL) || (bytesize == 0) )
{
std::cerr << "Failed serializing AMR box." << std::endl;
return 1;
}
size_t expectedByteSize = sizeof( int )+( 6*sizeof(double) );
if( bytesize != expectedByteSize )
{
std::cerr << "Bytesize of buffer did not match expected size.\n";
return 1;
}
vtkAMRBox B;
B.Deserialize( buffer, bytesize );
if( !(A == B) )
{
std::cerr << "Deserialization of AMR box did not match initial box.\n";
return 1;
}
}
return 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment