1 /*=========================================================================
4 Module: $RCSfile: TestVR.cxx,v $
6 Date: $Date: 2007/05/23 14:18:06 $
7 Version: $Revision: 1.13 $
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_NAME_SPACE::VR *vr = GDCM_NAME_SPACE::VR::New();
26 GDCM_NAME_SPACE::Debug::DebugOn();
28 // We should test the 27 entries ...
29 vr->Print( std::cout );
32 if( !vr->IsValidVR( "PN" ) )
34 std::cerr << "'PN' is not recognized as a valid VR" << std::endl;
37 if( !vr->IsValidVR( "FD" ) )
39 std::cerr << "'FD' is not recognized as a valid VR" << std::endl;
42 if( vr->IsValidVR( "" ) )
44 std::cerr << "'' is recognized as a valid VR" << std::endl;
47 if( vr->IsValidVR( " " ) )
49 std::cerr << "' ' is recognized as a valid VR" << std::endl;
52 if( vr->IsValidVR( "\000/" ) )
54 std::cerr << "' /' is recognized as a valid VR" << std::endl;
57 if( vr->IsValidVR( GDCM_NAME_SPACE::GDCM_VRUNKNOWN ) )
59 std::cerr << "' ' is recognized as a valid VR" << std::endl;
63 // String representable
64 //---------------------
65 if( !vr->IsVROfStringRepresentable( "PN" ) )
67 std::cerr << "'PN' is not recognized as a string representable" << std::endl;
70 if( vr->IsVROfStringRepresentable( "OB" ) )
72 std::cerr << "'OB' is recognized as a string representable" << std::endl;
76 // Binary representable
77 //---------------------
78 if( !vr->IsVROfBinaryRepresentable( "OB" ) )
80 std::cerr << "OB is not recognized as a binary representable" << std::endl;
83 if( vr->IsVROfBinaryRepresentable( "PN" ) )
85 std::cerr << "'PN' is a binary representable" << std::endl;
91 if( vr->IsVROfSequence( "" ) )
93 std::cerr << "'' is a sequence" << std::endl;
96 if( !vr->IsVROfSequence( "SQ" ) )
98 std::cerr << "'SQ' is not recognized as a Sequence" << std::endl;