Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[TDF] Assert on multiple number of nodes setting and add unit
  • Loading branch information
dpiparo committed Sep 19, 2017
commit a87e3b10be0b807e682d4b21c74ff055850a6df8
4 changes: 1 addition & 3 deletions tree/treeplayer/inc/ROOT/TTrivialDS.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ public:

void SetNSlots(unsigned int nSlots)
{
if (0U != fNSlots) {
return;
}
assert(0U == fNSlots && "Setting the number of slots even if the number of slots is different from zero.");

fNSlots = nSlots;
fCounter.resize(fNSlots);
Expand Down
10 changes: 10 additions & 0 deletions tree/treeplayer/test/dataframe/datasource_trivial.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ TEST(TTrivialDS, ColumnReaders)
}
}

TEST(TTrivialDS, SetNSlotsTwice)
{
auto theTest = []() {
TTrivialDS tds(1);
tds.SetNSlots(1);
tds.SetNSlots(1);
};
ASSERT_DEATH(theTest(), "Setting the number of slots even if the number of slots is different from zero.");
}

TEST(TTrivialDS, FromATDF)
{
std::unique_ptr<TDataSource> tds(new TTrivialDS(32));
Expand Down