ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fitpanel_playback.C
Go to the documentation of this file.
1 // Author: David Gonzalez Maline
2 // Based on Olivier's $ROOTSYS/tutorials/graphcs/graph_edit_playback.C
3 
4 // This file will test all the transient frames (aka Dialog windows)
5 // displayed in the fitpanel, as the rest of the functionality is
6 // tried automatically with the UnitTest.C unit.
7 
8 // This implies trying the Set Parameters dialog and the Advanced one.
9 
10 // At every operation, a png file will be saved. These files will be
11 // later on compared with some references values, to have an stimation
12 // of the goodness of the test.
13 
14 #include "TSystem.h"
15 #include "TSystemFile.h"
16 #include "TRecorder.h"
17 #include "Riostream.h"
18 
20 {
21  FileStat_t fs;
22  gSystem->GetPathInfo(filename, fs);
23  return (Int_t)fs.fSize;
24 }
25 
27 {
28  r = new TRecorder();
29  r->Replay("http://root.cern.ch/files/fitpanel_playback.root");
30 
31  // wait for the recorder to finish the replay
32  while (r->GetState() == TRecorder::kReplaying) {
34  gSystem->Sleep(1);
35  }
36 
37  Int_t Step_Err = 100;
38  Int_t Step1_Ref = 15691;
39  Int_t Step2_Ref = 15691;
40  Int_t Step3_Ref = 17632;
41  Int_t Step4_Ref = 12305;
42  Int_t Step5_Ref = 11668;
43 
44  Int_t Step1_Size = file_size("Step1.png");
45  Int_t Step2_Size = file_size("Step2.png");
46  Int_t Step3_Size = file_size("Step3.png");
47  Int_t Step4_Size = file_size("Step4.png");
48  Int_t Step5_Size = file_size("Step5.png");
49 
50 
51  cout << "**********************************************************************" <<endl;
52  cout << "* Report of fitpanel_playback.C *" <<endl;
53  cout << "**********************************************************************" <<endl;
54 
55  if (TMath::Abs(Step1_Ref-Step1_Size) <= Step_Err) {
56  cout << "Step1: ............................................................ OK" <<endl;
57  } else {
58  cout << "Step1: ........................................................ FAILED" <<endl;
59  }
60 
61  if (TMath::Abs(Step2_Ref-Step2_Size) <= Step_Err) {
62  cout << "Step2: ............................................................ OK" <<endl;
63  } else {
64  cout << "Step2: ........................................................ FAILED" <<endl;
65  }
66 
67  if (TMath::Abs(Step3_Ref-Step3_Size) <= Step_Err) {
68  cout << "Step3: ............................................................ OK" <<endl;
69  } else {
70  cout << "Step3: ........................................................ FAILED" <<endl;
71  }
72 
73  if (TMath::Abs(Step4_Ref-Step4_Size) <= Step_Err) {
74  cout << "Step4: ............................................................ OK" <<endl;
75  } else {
76  cout << "Step4: ........................................................ FAILED" <<endl;
77  }
78 
79  if (TMath::Abs(Step5_Ref-Step5_Size) <= Step_Err) {
80  cout << "Step5: ............................................................ OK" <<endl;
81  } else {
82  cout << "Step5: ........................................................ FAILED" <<endl;
83  }
84  cout << "**********************************************************************" <<endl;
85 
86 }
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition: TSystem.cxx:420
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
Definition: TSystem.cxx:1311
static const char * filename()
int Int_t
Definition: RtypesCore.h:41
Long64_t fSize
Definition: TSystem.h:141
Short_t Abs(Short_t d)
Definition: TMathBase.h:110
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
Definition: TSystem.cxx:441
ROOT::R::TRInterface & r
Definition: Object.C:4
R__EXTERN TSystem * gSystem
Definition: TSystem.h:545
void fitpanel_playback()
Int_t file_size(char *filename)