1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "MEDMEMTest.hxx"
21 #include <cppunit/TestAssert.h>
26 #include <MEDMEM_MedVersion.hxx>
29 using namespace MEDMEM;
30 using namespace MED_EN;
33 * Check methods (not in spec), defined in MEDMEM_MedVersion.hxx:
34 * (+) MED_EN::medFileVersion getMedFileVersion(const string & fileName) throw (MEDEXCEPTION);
35 * (+) int getMedAccessMode(MED_EN::med_mode_acces mode,
36 * MED_EN::medFileVersion medVersion) throw (MEDEXCEPTION);
39 void MEDMEMTest::testMedVersion()
41 string filename = getResourceFile("pointe_nomorereadable21.med");
42 string notExistFileName = "anyfile";
43 medFileVersion myFileVersion;
45 // Test - getMedFileVersion
46 CPPUNIT_ASSERT_THROW(getMedFileVersion(notExistFileName),MEDEXCEPTION);
48 CPPUNIT_ASSERT_NO_THROW(myFileVersion = getMedFileVersion(filename));
49 CPPUNIT_ASSERT(myFileVersion == V21);