1 /*=========================================================================
4 Module: $RCSfile: TestDicomString.cxx,v $
6 Date: $Date: 2004/11/16 04:28:20 $
7 Version: $Revision: 1.3 $
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.
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.
17 =========================================================================*/
20 int TestDicomString(int , char* [])
23 const char *s = "\0\0";
24 std::string a(s,s+2); // will copy 2 '\0'
25 assert( a.size() == 2 );
28 assert( a.c_str()[i] == '\0' );
29 assert( a.data()[i] == '\0' );
31 assert( a.c_str()[2] == '\0' );
34 std::string zeros(x, 0);
38 char s4[] = "\0abc";*/