1 /*=========================================================================
4 Module: $RCSfile: TestVR.cxx,v $
6 Date: $Date: 2005/10/20 15:05:15 $
7 Version: $Revision: 1.9 $
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( "\000/" ) )
51 std::cerr << "'\000/' is a valid VR" << std::endl;
54 if( vr->IsValidVR( gdcm::GDCM_VRUNKNOWN ) )
56 std::cerr << "' ' is a valid VR" << std::endl;
60 // String representable
61 if( !vr->IsVROfStringRepresentable( "PN" ) )
63 std::cerr << "'PN' is not a string representable" << std::endl;
66 if( vr->IsVROfStringRepresentable( "FD" ) )
68 std::cerr << "'FD' is a string representable" << std::endl;
72 // Binary representable
73 if( !vr->IsVROfBinaryRepresentable( "FD" ) )
75 std::cerr << "FD is not a binary representable" << std::endl;
78 if( vr->IsVROfBinaryRepresentable( "PN" ) )
80 std::cerr << "'PN' is a binary representable" << std::endl;
85 if( vr->IsVROfSequence( "" ) )
87 std::cerr << "'' is a sequence" << std::endl;
90 if( !vr->IsVROfSequence( "SQ" ) )
92 std::cerr << "'SQ' is not a sequence" << std::endl;