MOAB: Mesh Oriented datABase  (version 5.2.1)
read_cgm_load_test.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include "moab/Interface.hpp"
00003 #ifndef IS_BUILDING_MB
00004 #define IS_BUILDING_MB
00005 #endif
00006 #include "TestUtil.hpp"
00007 #include "Internals.hpp"
00008 #include "moab/Core.hpp"
00009 
00010 using namespace moab;
00011 
00012 #define CHKERR( A )                                                                                        \
00013     do                                                                                                     \
00014     {                                                                                                      \
00015         if( MB_SUCCESS != ( A ) )                                                                          \
00016         {                                                                                                  \
00017             std::cerr << "Failure (error code " << ( A ) << ") at " __FILE__ ":" << __LINE__ << std::endl; \
00018             return A;                                                                                      \
00019         }                                                                                                  \
00020     } while( false )
00021 
00022 #ifdef HAVE_OCC_STEP
00023 std::string input_file = TestDir + "/io/dum.stp";
00024 #else
00025 std::string input_file = TestDir + "/io/dum.sat";
00026 #endif
00027 
00028 // Checks that a file can be loaded twice without errors
00029 void read_multiple_test()
00030 {
00031     Core mb;
00032 
00033     ErrorCode rval = mb.load_file( input_file.c_str() );CHECK_ERR( rval );
00034     // second load
00035     rval = mb.load_file( input_file.c_str() );CHECK_ERR( rval );
00036 }
00037 
00038 int main( int /* argc */, char** /* argv */ )
00039 {
00040     int result = RUN_TEST( read_multiple_test );
00041 
00042     return result;
00043 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines