Skip to content

Commit 5e6bdc2

Browse files
committed
[io] add integration test for TFile recover
1 parent e09381b commit 5e6bdc2

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

roottest/root/io/recover/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,13 @@ ROOTTEST_ADD_TEST(zombie
66
ROOTTEST_ADD_TEST(empty
77
MACRO runempty.C
88
OUTREF empty.ref)
9+
10+
# corrupted_recover.root contains an otherwise-valid ROOT file that has been tweaked in the following way:
11+
# - fEND is changed to a larger size than the file, to trigger the recover;
12+
# - a fake key has been appended, that has a className "TH1F" and an object name whose string length is 2 GiB long.
13+
# The test verifies that Recover doesn't try to read out of bounds and refuses to read the string, while still
14+
# properly recovering the first two valid keys.
15+
ROOTTEST_ADD_TEST(corrupted_objname
16+
COPY_TO_BUILDDIR corrupted_recover.root
17+
COMMAND ${ROOT_root_CMD} -q corrupted_recover.root
18+
PASSREGEX "given buffer is too small \\(992 B remaining, need at least 2147483646 more\\)")
2 KB
Binary file not shown.

0 commit comments

Comments
 (0)