Skip to content

Commit

Permalink
Add unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
hqucms committed Oct 1, 2024
1 parent 181b439 commit daa7427
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions hist/hist/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ROOT_ADD_GTEST(testTProfile2Poly test_tprofile2poly.cxx LIBRARIES Hist Matrix MathCore RIO)
ROOT_ADD_GTEST(testTH2PolyBinError test_TH2Poly_BinError.cxx LIBRARIES Hist Matrix MathCore RIO)
ROOT_ADD_GTEST(testTH2PolyAdd test_TH2Poly_Add.cxx LIBRARIES Hist Matrix MathCore RIO)
ROOT_ADD_GTEST(testTH2PolyGetNumberOfBins test_TH2Poly_GetNumberOfBins.cxx LIBRARIES Hist Matrix MathCore RIO)
ROOT_ADD_GTEST(testTHn THn.cxx LIBRARIES Hist Matrix MathCore RIO)
ROOT_ADD_GTEST(testTH1 test_TH1.cxx LIBRARIES Hist)
ROOT_ADD_GTEST(testTHStack test_THStack.cxx LIBRARIES Hist)
Expand Down
14 changes: 14 additions & 0 deletions hist/hist/test/test_TH2Poly_GetNumberOfBins.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// test TH2Poly GetNumberOfBins

#include "gtest/gtest.h"

#include "TH2Poly.h"

TEST(TH2Poly, GetNumberOfBins)
{
TH2Poly *h2p = new TH2Poly();
EXPECT_EQ(0, h2p->GetNumberOfBins());

h2p->AddBin(1, 1, 1, 1);
EXPECT_EQ(1, h2p->GetNumberOfBins());
}

0 comments on commit daa7427

Please sign in to comment.