1 /*=========================================================================
4 Module: $RCSfile: TestVR.cxx,v $
6 Date: $Date: 2005/10/25 14:52:31 $
7 Version: $Revision: 1.11 $
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 =========================================================================*/
19 #include "gdcmDebug.h"
21 int TestVR(int , char *[])
24 gdcm::VR *vr = gdcm::VR::New();
26 gdcm::Debug::DebugOn();
28 // There should be 16 entries ...
29 vr->Print( std::cout );
32 if( !vr->IsValidVR( "PN" ) )
34 std::cerr << "'PN' is not a valid VR" << std::endl;
37 if( !vr->IsValidVR( "FD" ) )
39 std::cerr << "'FD' is not a valid VR" << std::endl;
42 if( vr->IsValidVR( "" ) )
44 std::cerr << "'' is a valid VR" << std::endl;
47 if( vr->IsValidVR( " " ) )
49 std::cerr << "' ' is a valid VR" << std::endl;
52 if( vr->IsValidVR( "\000/" ) )
54 std::cerr << "' /' is a valid VR" << std::endl;
57 if( vr->IsValidVR( gdcm::GDCM_VRUNKNOWN ) )
59 std::cerr << "' ' is a valid VR" << std::endl;
63 // String representable
64 if( !vr->IsVROfStringRepresentable( "PN" ) )
66 std::cerr << "'PN' is not a string representable" << std::endl;
69 if( vr->IsVROfStringRepresentable( "FD" ) )
71 std::cerr << "'FD' is a string representable" << std::endl;
75 // Binary representable
76 if( !vr->IsVROfBinaryRepresentable( "FD" ) )
78 std::cerr << "FD is not a binary representable" << std::endl;
81 if( vr->IsVROfBinaryRepresentable( "PN" ) )
83 std::cerr << "'PN' is a binary representable" << std::endl;
88 if( vr->IsVROfSequence( "" ) )
90 std::cerr << "'' is a sequence" << std::endl;
93 if( !vr->IsVROfSequence( "SQ" ) )
95 std::cerr << "'SQ' is not a sequence" << std::endl;