File: TePDIPIManager_test.cpp

package info (click to toggle)
libterralib 4.3.0%2Bdfsg.2-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 61,560 kB
  • ctags: 37,110
  • sloc: cpp: 225,052; ansic: 31,562; makefile: 807; sh: 80; xml: 37
file content (65 lines) | stat: -rw-r--r-- 1,528 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#define TEAGN_ENABLE_STDOUT_LOG

#include <TePDIPIManager.hpp>


#include <TeProgress.h>
#include <TeStdIOProgress.h>
#include <TeAgnostic.h>

#include <stdlib.h>

int main()
{
  TEAGN_LOGMSG( "Test started." );

  try{
    TeStdIOProgress pi;
    TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );  
    
    /* Test 0 */
    {
      TePDIPIManager manager1( "Manager1", 100, true );
      manager1.Update( 50 );
      manager1.Update( 100 );
    }    
  
    /* Test 1 */
    {
      TePDIPIManager manager1( "Manager1", 100, true );
      manager1.Update( 25 );
      
      TePDIPIManager manager2( "Manager2", 100, true );
      manager2.Update( 50 );
      
      TePDIPIManager manager3( "Manager3", 100, true );
      manager3.Update( 75 );   
      
      manager1.Update( 100 );  
      manager2.Update( 100 ); 
      manager3.Update( 100 );  
    }
    
    /* Test 2 */
    {
      TePDIPIManager manager1( "Manager1", 100, true );
      TePDIPIManager manager2( "Manager2", 100, true );
      TePDIPIManager manager3( "Manager3", 100, true );
      
      manager1.Update( 50 );
      manager2.Update( 50 );
      manager3.Update( 50 ); 
      
      manager1.Update( 100 );
      manager2.Update( 100 );
      manager3.Update( 100 );       
    }    
  }
  catch( const TeException& e ){
    TEAGN_LOGERR( "Test Failed - " + e.message() );
    return EXIT_FAILURE;
  }  

  TEAGN_LOGMSG( "Test OK." );
  return EXIT_SUCCESS;
}