From $ROOTSYS/tutorials/fit/fitpanel_playback.C

// Author: David Gonzalez Maline
// Based on Olivier's $ROOTSYS/tutorials/graphcs/graph_edit_playback.C

// This file will test all the transient frames (aka Dialog windows)
// displayed in the fitpanel, as the rest of the functionality is
// tried automatically with the UnitTest.C unit.

// This implies trying the Set Parameters dialog and the Advanced one.

// At every operation, a png file will be saved. These files will be
// later on compared with some references values, to have an stimation
// of the goodness of the test.

#include "TSystem.h"
#include "TSystemFile.h"
#include "TRecorder.h"
#include "Riostream.h"

Int_t file_size(char *filename)
{
   FileStat_t fs;
   gSystem->GetPathInfo(filename, fs);
   return (Int_t)fs.fSize;
}

void fitpanel_playback()
{
   r = new TRecorder();
   r->Replay("http://root.cern.ch/files/fitpanel_playback.root");

   // wait for the recorder to finish the replay
   while (r->GetState() == TRecorder::kReplaying) {
      gSystem->ProcessEvents();
      gSystem->Sleep(1);
   }

   Int_t Step_Err    = 100;
   Int_t Step1_Ref   = 15691;
   Int_t Step2_Ref   = 15691;
   Int_t Step3_Ref   = 17632;
   Int_t Step4_Ref   = 12305;
   Int_t Step5_Ref   = 11668;

   Int_t Step1_Size   =  file_size("Step1.png");
   Int_t Step2_Size   =  file_size("Step2.png");
   Int_t Step3_Size   =  file_size("Step3.png");
   Int_t Step4_Size   =  file_size("Step4.png");
   Int_t Step5_Size   =  file_size("Step5.png");


   cout << "**********************************************************************" <<endl;
   cout << "*  Report of fitpanel_playback.C                                     *" <<endl;
   cout << "**********************************************************************" <<endl;

   if (TMath::Abs(Step1_Ref-Step1_Size) <= Step_Err) {
      cout << "Step1: ............................................................ OK" <<endl;
   } else {
      cout << "Step1: ........................................................ FAILED" <<endl;
   }

   if (TMath::Abs(Step2_Ref-Step2_Size) <= Step_Err) {
      cout << "Step2: ............................................................ OK" <<endl;
   } else {
      cout << "Step2: ........................................................ FAILED" <<endl;
   }

   if (TMath::Abs(Step3_Ref-Step3_Size) <= Step_Err) {
      cout << "Step3: ............................................................ OK" <<endl;
   } else {
      cout << "Step3: ........................................................ FAILED" <<endl;
   }

   if (TMath::Abs(Step4_Ref-Step4_Size) <= Step_Err) {
      cout << "Step4: ............................................................ OK" <<endl;
   } else {
      cout << "Step4: ........................................................ FAILED" <<endl;
   }

   if (TMath::Abs(Step5_Ref-Step5_Size) <= Step_Err) {
      cout << "Step5: ............................................................ OK" <<endl;
   } else {
      cout << "Step5: ........................................................ FAILED" <<endl;
   }
   cout << "**********************************************************************" <<endl;

}
 fitpanel_playback.C:1
 fitpanel_playback.C:2
 fitpanel_playback.C:3
 fitpanel_playback.C:4
 fitpanel_playback.C:5
 fitpanel_playback.C:6
 fitpanel_playback.C:7
 fitpanel_playback.C:8
 fitpanel_playback.C:9
 fitpanel_playback.C:10
 fitpanel_playback.C:11
 fitpanel_playback.C:12
 fitpanel_playback.C:13
 fitpanel_playback.C:14
 fitpanel_playback.C:15
 fitpanel_playback.C:16
 fitpanel_playback.C:17
 fitpanel_playback.C:18
 fitpanel_playback.C:19
 fitpanel_playback.C:20
 fitpanel_playback.C:21
 fitpanel_playback.C:22
 fitpanel_playback.C:23
 fitpanel_playback.C:24
 fitpanel_playback.C:25
 fitpanel_playback.C:26
 fitpanel_playback.C:27
 fitpanel_playback.C:28
 fitpanel_playback.C:29
 fitpanel_playback.C:30
 fitpanel_playback.C:31
 fitpanel_playback.C:32
 fitpanel_playback.C:33
 fitpanel_playback.C:34
 fitpanel_playback.C:35
 fitpanel_playback.C:36
 fitpanel_playback.C:37
 fitpanel_playback.C:38
 fitpanel_playback.C:39
 fitpanel_playback.C:40
 fitpanel_playback.C:41
 fitpanel_playback.C:42
 fitpanel_playback.C:43
 fitpanel_playback.C:44
 fitpanel_playback.C:45
 fitpanel_playback.C:46
 fitpanel_playback.C:47
 fitpanel_playback.C:48
 fitpanel_playback.C:49
 fitpanel_playback.C:50
 fitpanel_playback.C:51
 fitpanel_playback.C:52
 fitpanel_playback.C:53
 fitpanel_playback.C:54
 fitpanel_playback.C:55
 fitpanel_playback.C:56
 fitpanel_playback.C:57
 fitpanel_playback.C:58
 fitpanel_playback.C:59
 fitpanel_playback.C:60
 fitpanel_playback.C:61
 fitpanel_playback.C:62
 fitpanel_playback.C:63
 fitpanel_playback.C:64
 fitpanel_playback.C:65
 fitpanel_playback.C:66
 fitpanel_playback.C:67
 fitpanel_playback.C:68
 fitpanel_playback.C:69
 fitpanel_playback.C:70
 fitpanel_playback.C:71
 fitpanel_playback.C:72
 fitpanel_playback.C:73
 fitpanel_playback.C:74
 fitpanel_playback.C:75
 fitpanel_playback.C:76
 fitpanel_playback.C:77
 fitpanel_playback.C:78
 fitpanel_playback.C:79
 fitpanel_playback.C:80
 fitpanel_playback.C:81
 fitpanel_playback.C:82
 fitpanel_playback.C:83
 fitpanel_playback.C:84
 fitpanel_playback.C:85
 fitpanel_playback.C:86
 fitpanel_playback.C:87