]> Creatis software - gdcm.git/blob - Testing/TestDicomString.cxx
BUG: Thankfully VS6 catch it :)
[gdcm.git] / Testing / TestDicomString.cxx
1 #include "gdcmUtil.h"
2
3 int TestDicomString(int , char* [])
4 {
5   int i;
6   const char *s = "\0\0";
7   std::string a(s,s+2); // will copy 2 '\0' 
8   assert( a.size() == 2 );
9   for(i=0;i<2;i++)
10   {
11     assert( a.c_str()[i] == '\0' );
12     assert( a.data()[i] == '\0' );
13   }
14   assert( a.c_str()[2] == '\0' );
15
16 /*
17 std::string zeros(x, 0);
18 char s1[] = "\0";
19 char s2[] = "\0\0";
20 char s3[] = "\0\0\0";
21 char s4[] = "\0abc";*/
22
23   return 0;
24 }