1 /*=========================================================================
2 
3   Program: GDCM (Grassroots DICOM). A DICOM library
4 
5   Copyright (c) 2006-2011 Mathieu Malaterre
6   All rights reserved.
7   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9      This software is distributed WITHOUT ANY WARRANTY; without even
10      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11      PURPOSE.  See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #include "gdcmTesting.h"
15 #include "gdcmSystem.h"
16 
TestTesting(int,char * [])17 int TestTesting(int , char *[])
18 {
19   gdcm::Testing testing;
20   testing.Print( std::cout );
21 
22   const char *f = gdcm::Testing::GetFileName( 100000 );
23   if( f ) return 1;
24 
25   std::cout << "Num:" << gdcm::Testing::GetNumberOfFileNames() << std::endl;
26 
27   const char * const * md5 = gdcm::Testing::GetMD5DataImage( 100000 );
28   if( !md5 ) return 1;
29   if( md5[0] || md5[1] ) return 1;
30 
31   const char * const *null = gdcm::Testing::GetMD5DataImage(1000000000u);
32   if( null[0] != nullptr || null[1] != nullptr )
33     {
34     return 1;
35     }
36 
37 
38   const char *tmp = gdcm::Testing::GetTempDirectory();
39   if( !gdcm::System::FileExists(tmp) )
40     {
41     return 1;
42     }
43   if( !gdcm::System::FileIsDirectory(tmp) )
44     {
45     return 1;
46     }
47 
48   return 0;
49 }
50