Skip to content

Commit

Permalink
[RDF] Suppress diagnostics in dataframe_snapshot tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hageboeck committed Sep 10, 2021
1 parent 0b8cf7a commit 36fceba
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tree/dataframe/test/dataframe_snapshot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,12 @@ TEST(RDFSnapshotMore, ReadWriteNestedLeaves)
RDataFrame d(treename, fname);
const auto outfname = "out_readwritenestedleaves.root";
ROOT::RDF::RNode d2(d);
ROOT_EXPECT_INFO((d2 = *d.Snapshot<int, int>(treename, outfname, {"v.a", "v.b"})), "Snapshot", "Column v.a will be saved as v_a\nInfo in <Snapshot>: Column v.b will be saved as v_b");
{
ExpectedDiagRAII diagRAII;
diagRAII.expectedDiag(ExpectedDiagRAII::EDK_Info, "Snapshot", "Column v.a will be saved as v_a");
diagRAII.expectedDiag(ExpectedDiagRAII::EDK_Info, "Snapshot", "Column v.b will be saved as v_b");
d2 = *d.Snapshot<int, int>(treename, outfname, {"v.a", "v.b"});
}
EXPECT_EQ(d2.GetColumnNames(), std::vector<std::string>({"v_a", "v_b"}));
auto check_a_b = [](int a, int b) {
EXPECT_EQ(a, 1);
Expand Down Expand Up @@ -810,6 +815,7 @@ TEST(RDFSnapshotMore, ForbiddenOutputFilename)
// If some other test case called EnableThreadSafety, the error printed here is of the form
// "SysError in <TFile::TFile>: file /definitely/not/a/valid/path/f.root can not be opened No such file or directory\nError in <TReentrantRWLock::WriteUnLock>: Write lock already released for 0x55f179989378\n"
// but the address printed changes every time
ExpectedDiagRAII diagRAII{ExpectedDiagRAII::EDK_SysError, "TFile::TFile", "file /definitely/not/a/valid/path/f.root can not be opened No such file or directory"};
EXPECT_THROW(df.Snapshot("t", out_fname, {"rdfslot_"}), std::runtime_error);
}

Expand Down Expand Up @@ -1103,6 +1109,9 @@ TEST(RDFSnapshotMore, ForbiddenOutputFilenameMT)
// the error printed here is
// "SysError in <TFile::TFile>: file /definitely/not/a/valid/path/f.root can not be opened No such file or directory\nError in <TReentrantRWLock::WriteUnLock>: Write lock already released for 0x55f179989378\n"
// but the address printed changes every time
ExpectedDiagRAII diagRAII;
diagRAII.expectedDiag(ExpectedDiagRAII::EDK_SysError, "TFile::TFile", "file /definitely/not/a/valid/path/f.root can not be opened No such file or directory");
diagRAII.optionalDiag(ExpectedDiagRAII::EDK_Error, "TReentrantRWLock::WriteUnLock", "Write lock already released for", /*wholeStringNeedsToMatch=*/false);
EXPECT_THROW(df.Snapshot("t", out_fname, {"rdfslot_"}), std::runtime_error);
}

Expand Down

0 comments on commit 36fceba

Please sign in to comment.