fitpanel_playback.C

Go to the documentation of this file.
00001 // Author: David Gonzalez Maline
00002 // Based on Olivier's $ROOTSYS/tutorials/graphcs/graph_edit_playback.C
00003 
00004 // This file will test all the transient frames (aka Dialog windows)
00005 // displayed in the fitpanel, as the rest of the functionality is
00006 // tried automatically with the UnitTest.C unit.
00007 
00008 // This implies trying the Set Parameters dialog and the Advanced one.
00009 
00010 // At every operation, a png file will be saved. These files will be
00011 // later on compared with some references values, to have an stimation
00012 // of the goodness of the test.
00013 
00014 #include "TSystem.h"
00015 #include "TSystemFile.h"
00016 #include "TRecorder.h"
00017 #include "Riostream.h"
00018 
00019 Int_t file_size(char *filename)
00020 {
00021    FileStat_t fs;
00022    gSystem->GetPathInfo(filename, fs);
00023    return (Int_t)fs.fSize;
00024 }
00025 
00026 void fitpanel_playback()
00027 {
00028    r = new TRecorder();
00029    r->Replay("http://root.cern.ch/files/fitpanel_playback.root");
00030 
00031    // wait for the recorder to finish the replay
00032    while (r->GetState() == TRecorder::kReplaying) {
00033       gSystem->ProcessEvents();
00034       gSystem->Sleep(1);
00035    }
00036 
00037    Int_t Step_Err    = 100;
00038    Int_t Step1_Ref   = 15691;
00039    Int_t Step2_Ref   = 15691;
00040    Int_t Step3_Ref   = 17632;
00041    Int_t Step4_Ref   = 12305;
00042    Int_t Step5_Ref   = 11668;
00043 
00044    Int_t Step1_Size   =  file_size("Step1.png");
00045    Int_t Step2_Size   =  file_size("Step2.png");
00046    Int_t Step3_Size   =  file_size("Step3.png");
00047    Int_t Step4_Size   =  file_size("Step4.png");
00048    Int_t Step5_Size   =  file_size("Step5.png");
00049    
00050 
00051    cout << "**********************************************************************" <<endl;
00052    cout << "*  Report of fitpanel_playback.C                                     *" <<endl;
00053    cout << "**********************************************************************" <<endl;
00054 
00055    if (TMath::Abs(Step1_Ref-Step1_Size) <= Step_Err) {
00056       cout << "Step1: ............................................................ OK" <<endl;
00057    } else {
00058       cout << "Step1: ........................................................ FAILED" <<endl;
00059    }
00060 
00061    if (TMath::Abs(Step2_Ref-Step2_Size) <= Step_Err) {
00062       cout << "Step2: ............................................................ OK" <<endl;
00063    } else {
00064       cout << "Step2: ........................................................ FAILED" <<endl;
00065    }
00066 
00067    if (TMath::Abs(Step3_Ref-Step3_Size) <= Step_Err) {
00068       cout << "Step3: ............................................................ OK" <<endl;
00069    } else {
00070       cout << "Step3: ........................................................ FAILED" <<endl;
00071    }
00072 
00073    if (TMath::Abs(Step4_Ref-Step4_Size) <= Step_Err) {
00074       cout << "Step4: ............................................................ OK" <<endl;
00075    } else {
00076       cout << "Step4: ........................................................ FAILED" <<endl;
00077    }
00078 
00079    if (TMath::Abs(Step5_Ref-Step5_Size) <= Step_Err) {
00080       cout << "Step5: ............................................................ OK" <<endl;
00081    } else {
00082       cout << "Step5: ........................................................ FAILED" <<endl;
00083    }
00084    cout << "**********************************************************************" <<endl;
00085 
00086 }

Generated on Tue Jul 5 15:44:07 2011 for ROOT_528-00b_version by  doxygen 1.5.1