Skip to content

Commit

Permalink
[TDF] Trigger event loop and check results in test_read_leaves[_nodict]
Browse files Browse the repository at this point in the history
  • Loading branch information
eguiraud authored and bluehood committed Mar 16, 2018
1 parent 9d3963e commit 28e38e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
9 changes: 8 additions & 1 deletion root/dataframe/test_read_leaves.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <TTree.h>
#include <TFile.h>
#include <TSystem.h>
#include <cassert>

#include "test_read_leaves.h"

Expand All @@ -26,7 +27,13 @@ int main()
}

TDataFrame d("t", "test_read_leaves.root");
d.Filter(check_a_b, {"v.a", "v.b"}).Report();
auto check_a_b = [](int a, int b) {
assert(a == 1);
assert(b == 2);
return true;
};
auto c = d.Filter(check_a_b, {"v.a", "v.b"}).Count();
assert(*c == 1u);
gSystem->Unlink("test_read_leaves.root");
return 0;
}
Expand Down
7 changes: 0 additions & 7 deletions root/dataframe/test_read_leaves.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,3 @@ struct V {
struct W {
V v;
};


// checkers
bool check_a_b (int , int )
{
return true;
}
8 changes: 7 additions & 1 deletion root/dataframe/test_read_leaves_nodict.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ int main()
}

TDataFrame d("t", "test_read_leaves_nodict.root");
d.Filter(check_a_b, {"v.a", "v.b"}).Report();
auto check_a_b = [](int a, int b) {
assert(a == 1);
assert(b == 2);
return true;
};
auto c = d.Filter(check_a_b, {"v.a", "v.b"}).Count();
assert(*c == 1u);
gSystem->Unlink("test_read_leaves_nodict.root");
return 0;
}
Expand Down

0 comments on commit 28e38e8

Please sign in to comment.