]> Creatis software - gdcm.git/blob - Testing/TestUtil.cxx
ENH: Apply first patch toward better string comparison when dealing with broken DICOM...
[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    const char ref[] = "MONOCHROME1";
9    std::string a = "MONOCHROME1";
10    a += '\0';
11    std::string b = "MONOCHROME1 ";
12    std::string c = gdcm::Util::DicomString("MONOCHROME1");
13    std::string d = "MONOCHROME1";
14
15    if( !gdcm::Util::DicomStringEqual(a,ref) ) return 1;
16    if( !gdcm::Util::DicomStringEqual(b,ref) ) return 1;
17    if( !gdcm::Util::DicomStringEqual(c,ref) ) return 1;
18    if(  gdcm::Util::DicomStringEqual(d,ref) ) return 1;
19
20    return 0;
21 }