1 /*=========================================================================
4 Module: $RCSfile: TestVR.cxx,v $
6 Date: $Date: 2005/10/18 12:58:25 $
7 Version: $Revision: 1.8 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
20 int TestVR(int , char *[])
23 gdcm::VR *vr = new gdcm::VR();
25 // There should be 16 entries ...
26 vr->Print( std::cout );
29 if( !vr->IsValidVR( "PN" ) )
31 std::cerr << "'PN' is not a valid VR" << std::endl;
34 if( !vr->IsValidVR( "FD" ) )
36 std::cerr << "'FD' is not a valid VR" << std::endl;
39 if( vr->IsValidVR( "" ) )
41 std::cerr << "'' is a valid VR" << std::endl;
44 if( vr->IsValidVR( " " ) )
46 std::cerr << "' ' is a valid VR" << std::endl;
49 if( vr->IsValidVR( gdcm::GDCM_VRUNKNOWN ) )
51 std::cerr << "' ' is a valid VR" << std::endl;
55 // String representable
56 if( !vr->IsVROfStringRepresentable( "PN" ) )
58 std::cerr << "'PN' is not a string representable" << std::endl;
61 if( vr->IsVROfStringRepresentable( "FD" ) )
63 std::cerr << "'FD' is a string representable" << std::endl;
67 // Binary representable
68 if( !vr->IsVROfBinaryRepresentable( "FD" ) )
70 std::cerr << "FD is not a binary representable" << std::endl;
73 if( vr->IsVROfBinaryRepresentable( "PN" ) )
75 std::cerr << "'PN' is a binary representable" << std::endl;
80 if( vr->IsVROfSequence( "" ) )
82 std::cerr << "'' is a sequence" << std::endl;
85 if( !vr->IsVROfSequence( "SQ" ) )
87 std::cerr << "'SQ' is not a sequence" << std::endl;