Skip to content

Commit e57ce64

Browse files
committed
Add a test
1 parent 170a734 commit e57ce64

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

hist/hist/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ROOT_ADD_GTEST(testMapCppName test_MapCppName.cxx LIBRARIES Hist Gpad)
2828
ROOT_ADD_GTEST(testTGraphSorting test_TGraph_sorting.cxx LIBRARIES Hist)
2929
ROOT_ADD_GTEST(testSpline test_spline.cxx LIBRARIES Hist)
3030
ROOT_ADD_GTEST(testTF1Simple test_tf1_simple.cxx LIBRARIES Hist RIO)
31+
ROOT_ADD_GTEST(testTF1DrawCopy test_tf1_drawcopy.cxx LIBRARIES Hist)
3132

3233
if(fftw3)
3334
ROOT_ADD_GTEST(testTF1 test_tf1.cxx LIBRARIES Hist)

hist/hist/test/test_tf1_drawcopy.cxx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "TF1.h"
2+
#include "TAxis.h"
3+
4+
#include "gtest/gtest.h"
5+
6+
// issue #13122
7+
TEST(TF1, DrawCopy) {
8+
auto f = new TF1("f", "x*x", -3, 3);
9+
f->GetXaxis()->SetTitle("xtitle");
10+
auto fcopy = f->DrawCopy();
11+
EXPECT_STREQ("xtitle", fcopy->GetXaxis()->GetTitle());
12+
}

0 commit comments

Comments
 (0)