]> Creatis software - gdcm.git/blob - Testing/TestUtil.cxx
ENH: Slightly bigger patch:
[gdcm.git] / Testing / TestUtil.cxx
1 // This test should test everything in Util, since I didn't know any other 
2 // way to test this class.
3
4 #include "gdcm.h"
5
6 int TestUtil(int , char * [])
7 {
8    std::cout << gdcm::Util::CreateUniqueUID("") << std::endl;
9    
10    const char ref[] = "MONOCHROME1";
11    std::string a = "MONOCHROME1";
12    a += '\0';
13    std::string b = "MONOCHROME1 ";
14    std::string c = gdcm::Util::DicomString("MONOCHROME1");
15    std::string d = "MONOCHROME1";
16
17    if( !gdcm::Util::DicomStringEqual(a,ref) ) return 1;
18    if( !gdcm::Util::DicomStringEqual(b,ref) ) return 1;
19    if( !gdcm::Util::DicomStringEqual(c,ref) ) return 1;
20    if(  gdcm::Util::DicomStringEqual(d,ref) ) return 1;
21
22    return 0;
23 }