]> Creatis software - gdcm.git/blob - Testing/TestUtil.cxx
ENH: Add license to tests since they belong to gdcm
[gdcm.git] / Testing / TestUtil.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: TestUtil.cxx,v $
5   Language:  C++
6   Date:      $Date: 2004/11/16 04:28:20 $
7   Version:   $Revision: 1.3 $
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18 // This test should test everything in Util, since I didn't know any other 
19 // way to test this class.
20
21 #include "gdcm.h"
22
23 int TestUtil(int , char * [])
24 {
25    std::cout << gdcm::Util::CreateUniqueUID("") << std::endl;
26    
27    const char ref[] = "MONOCHROME1";
28    std::string a = "MONOCHROME1";
29    a += '\0';
30    std::string b = "MONOCHROME1 ";
31    std::string c = gdcm::Util::DicomString("MONOCHROME1");
32    std::string d = "MONOCHROME1";
33
34    if( !gdcm::Util::DicomStringEqual(a,ref) ) return 1;
35    if( !gdcm::Util::DicomStringEqual(b,ref) ) return 1;
36    if( !gdcm::Util::DicomStringEqual(c,ref) ) return 1;
37    if(  gdcm::Util::DicomStringEqual(d,ref) ) return 1;
38
39    return 0;
40 }