File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ if(fortran AND CMAKE_Fortran_COMPILER AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL
1111 COMMAND h2root mb4i1.hbook
1212 COPY_TO_BUILDDIR mb4i1.hbook
1313 OUTREF h2root.ref )
14+ ROOT_ADD_GTEST (THbookFile THbookFile.cxx LIBRARIES Hbook )
15+ set_tests_properties (roottest-root-hist-h2root PROPERTIES FIXTURES_SETUP hbookFile )
16+ set_tests_properties (gtest-roottest-root-hist-THbookFile PROPERTIES FIXTURES_REQUIRED hbookFile )
1417endif ()
1518
1619ROOTTEST_ADD_TESTDIRS ()
Original file line number Diff line number Diff line change 1+ #include < THbookFile.h>
2+ #include < TH1F.h>
3+
4+ #include " gtest/gtest.h"
5+
6+ TEST (THbookFile, ReadTH1)
7+ {
8+ THbookFile file (" mb4i1.hbook" );
9+ EXPECT_STREQ (file.GetCurDir (), " //lun10" );
10+ EXPECT_EQ (file.GetListOfKeys ()->size (), 9 );
11+
12+ TObject *histo = file.Get (1 );
13+ auto th1 = dynamic_cast <TH1F *>(histo);
14+ ASSERT_NE (th1, nullptr );
15+ EXPECT_EQ (th1->GetEntries (), 500 );
16+ }
You can’t perform that action at this time.
0 commit comments