]> Creatis software - gdcm.git/blob - Testing/TestDicomString.cxx
Fix mistypings
[gdcm.git] / Testing / TestDicomString.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: TestDicomString.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/02/02 10:05:26 $
7   Version:   $Revision: 1.5 $
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 #include "gdcmUtil.h"
19 #include <assert.h>
20
21 int TestDicomString(int, char *[])
22 {
23   int i;
24   const char *s = "\0\0";
25   std::string a(s,s+2); // will copy 2 '\0' 
26   assert( a.size() == 2 );
27   for(i=0;i<2;i++)
28   {
29     assert( a.c_str()[i] == '\0' );
30     assert( a.data()[i] == '\0' );
31   }
32   assert( a.c_str()[2] == '\0' );
33
34 /*
35 std::string zeros(x, 0);
36 char s1[] = "\0";
37 char s2[] = "\0\0";
38 char s3[] = "\0\0\0";
39 char s4[] = "\0abc";
40 */
41
42   return 0;
43 }