MOAB: Mesh Oriented datABase  (version 5.4.1)
ccmio_test.cpp
Go to the documentation of this file.
00001 #include "TestUtil.hpp"
00002 #include "moab/Core.hpp"
00003 #define IS_BUILDING_MB
00004 #include "moab/Range.hpp"
00005 #include "moab/FileOptions.hpp"
00006 
00007 using namespace moab;
00008 
00009 std::string cubfile   = TestDir + "unittest/io/singlecyl.cub";
00010 std::string ccmgfiler = TestDir + "unittest/io/singlecyl.ccmg";
00011 std::string ccmgfilew = "singlecyl_tmp.ccmg";
00012 
00013 void test_read();
00014 void test_write();
00015 
00016 int main()
00017 {
00018     int result = 0;
00019 
00020     result += RUN_TEST( test_write );
00021     result += RUN_TEST( test_read );
00022 
00023     return result;
00024 }
00025 
00026 void test_write()
00027 {
00028     ErrorCode rval;
00029     Core moab;
00030     Interface& mb = moab;
00031     rval          = mb.load_file( cubfile.c_str() );
00032     if( MB_SUCCESS != rval ) std::cerr << "Trouble reading file " << cubfile << std::endl;CHECK_ERR( rval );
00033 
00034     rval = mb.write_file( ccmgfilew.c_str() );
00035     if( MB_SUCCESS != rval ) std::cerr << "Trouble writing file " << ccmgfilew << std::endl;CHECK_ERR( rval );
00036 }
00037 
00038 void test_read()
00039 {
00040     ErrorCode rval;
00041     Core moab;
00042     Interface& mb = moab;
00043     rval          = mb.load_file( ccmgfiler.c_str() );CHECK_ERR( rval );
00044 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines