From 89300e04d724aa8a3c0fc482051c2e8b6c357d05 Mon Sep 17 00:00:00 2001 From: Philippe Canal <pcanal@fnal.gov> Date: Mon, 30 Mar 2020 20:49:28 -0500 Subject: [PATCH] stressEntryList detect if entryList content is completely unexpected --- test/stressEntryList.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/stressEntryList.cxx b/test/stressEntryList.cxx index 80f15a3074d..bfb4e4ac92b 100644 --- a/test/stressEntryList.cxx +++ b/test/stressEntryList.cxx @@ -76,6 +76,14 @@ Bool_t Test1(bool fixedCut) smallchain->Draw(">>elist_small", cut, "entrylist"); TEntryList *elist_small = (TEntryList*)gDirectory->Get("elist_small"); + if (fixedCut && elist_small->GetN() != 0) { + printf("Test1: Cut \"Entry$ >= %lld\" found entries in the small chain\n", smallchain->GetEntries()); + return false; + } else if (!fixedCut && elist_small->GetN() == 0) { + printf("Test1: Cut \"x<0 && y>0\" found no entries in the small chain\n"); + return false; + } + //check if the entry list contains correct entries Int_t range = 100; TH1F *hx = new TH1F("hx", "hx", range, -range, range); @@ -111,6 +119,16 @@ Bool_t Test1(bool fixedCut) //make an entry list for a big chain bigchain->Draw(">>elist_big", cut, "entrylist"); TEntryList* elist_big = (TEntryList*)gDirectory->Get("elist_big"); + + if (fixedCut && elist_big->GetN() != smallchain->GetEntries()) { + printf("Test1: Cut \"Entry$ >= %lld\" did not find the right number of entries in the big chain (expected %lld got %lld\n", + smallchain->GetEntries(), smallchain->GetEntries(), elist_big->GetN()); + return false; + } else if (!fixedCut && elist_big->GetN() == 0) { + printf("Test1: Cut \"x<0 && y>0\" found no entries in the big chain\n"); + return false; + } + //make a small entry list by extracting the lists, corresponding to the trees in //the small chain, from the big entry list TEntryList *list_extracted = new TEntryList("list_extracted", "list_extracted"); -- GitLab