Skip to content

Commit dad5cc9

Browse files
committed
[test] Always draw fresh histograms in stressGraphics.
In the past, stressGraphics was retrieving a histogram from a file, modifying it and drawing it. In subsequent tests, the histogram is again read from the TFile, but this returns the in-memory object. This means that the previous tests influence the subsequent tests, e.g. whether or not statistics objects are displayed. In particular, subsequent tests will have the statistics box drawn twice, once from THistPainter::PaintStat(), and once from the fact that the box is added to the list of functions. This impacts output files such as PDF/PS/SVG. Here, the histogram is always cloned when it is retrieved from the file, so the tests are independent. The reference files for SVG are regenerated, because the statistics box is now only drawn once. Similarly, the output size of the .ps files has been corrected to reflect that the boxes are only drawn once.
1 parent 3219045 commit dad5cc9

File tree

6 files changed

+7
-415
lines changed

6 files changed

+7
-415
lines changed

test/stressGraphics.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,7 @@ void th2_cut()
20152015
Float_t y[6] = { 2, 0, -2, -2, 0, 2 };
20162016
TCutG *cut = new TCutG("cut", 6, x, y);
20172017

2018-
TH1 *hpxpy = (TH1*)gHsimple->Get("hpxpy");
2018+
TH1 *hpxpy = (TH1 *)gHsimple->Get("hpxpy")->Clone("th2_cut");
20192019

20202020
hpxpy->Draw("col [cut]");
20212021
cut->Draw("l");
@@ -3827,7 +3827,7 @@ void clonepad()
38273827
{
38283828
TCanvas *C = StartTest(700,500);
38293829

3830-
TH1 *hpxpy = (TH1*)gHsimple->Get("hpxpy");
3830+
TH1 *hpxpy = (TH1 *)gHsimple->Get("hpxpy")->Clone("hpxpy_clonepad");
38313831
hpxpy->Draw();
38323832
TCanvas *C2 = (TCanvas*)C->DrawClone();
38333833

test/stressGraphics.ref

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
th1_palette 17056 100 32429 100 29162 12000 35018 15000 17487 300
3131
thstack1 30815 100 28522 100 46061 15000 23026 10000 31035 100
3232
th2_cut 14774 600 16179 300 19511 5000 11533 4000 16039 600
33-
th2_candle 113353 1000 71394 500 136880 40000 51345 20000 115314 1000
34-
th2_violin 73316 500 84161 500 85037 20000 34733 15000 73223 500
33+
th2_candle 102431 1000 71394 500 136880 40000 51345 20000 115314 1000
34+
th2_violin 67738 500 84161 500 85037 20000 34733 15000 73223 500
3535
th2_axlabels 4878 600 14375 100 17419 5000 11709 1800 5770 600
3636
th2_stats 27107 300 19227 300 30587 14000 16531 7000 27039 500
3737
tellipse 4131 40 15272 100 34038 2500 12258 1400 4162 40

test/svg_ref/clonepad.svg

Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)