Skip to content

Commit 7a8eb64

Browse files
committed
[DF] Fix test_nested_rvec_snapshot on Windows
On Windows it is not allowed to delete (or, in this case, "RECREATE") a file while it is still open. We now enclose each Snapshot call in its own scope so the file is closed before being recreated.
1 parent b29ce24 commit 7a8eb64

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

root/dataframe/test_nested_rvec_snapshot.C

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <ROOT/RDataFrame.hxx>
22
#include <ROOT/RVec.hxx>
3+
#include <TSystem.h>
34
using namespace ROOT::VecOps;
45

56
struct TwoInts {
@@ -44,12 +45,18 @@ void test_nested_rvec_snapshot()
4445
{"vv", "vvv", "vvti"});
4546
};
4647

47-
// compiled
48-
auto out_df1 =
49-
df.Snapshot<RVec<RVec<int>>, RVec<RVec<RVec<int>>>, RVec<RVec<TwoInts>>>("t", fname, {"vv", "vvv", "vvti"});
50-
check(*out_df1);
48+
{
49+
// compiled
50+
auto out_df1 =
51+
df.Snapshot<RVec<RVec<int>>, RVec<RVec<RVec<int>>>, RVec<RVec<TwoInts>>>("t", fname, {"vv", "vvv", "vvti"});
52+
check(*out_df1);
53+
}
5154

52-
// jitted
53-
auto out_df2 = df.Snapshot("t", fname, {"vv", "vvv", "vvti"});
54-
check(*out_df2);
55+
{
56+
// jitted
57+
auto out_df2 = df.Snapshot("t", fname, {"vv", "vvv", "vvti"});
58+
check(*out_df2);
59+
}
60+
61+
gSystem->Unlink(fname);
5562
}

0 commit comments

Comments
 (0)