Skip to content

Commit

Permalink
chore(fstypes): show section version in dump
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed Dec 19, 2024
1 parent ab21ffa commit 9071ee5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/fstypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ std::string get_section_name(section_type type) {
}

void section_header::dump(std::ostream& os) const {
os << "type=" << get_default(sections, type) << ", compression="
os << "[V1] type=" << get_default(sections, type) << ", compression="
<< get_default(compressions, static_cast<compression_type>(compression))
<< ", length=" << length;
}
Expand All @@ -94,7 +94,8 @@ std::string section_header::to_string() const {
}

void section_header_v2::dump(std::ostream& os) const {
os << "num=" << number
os << "[V" << static_cast<int>(major) << "." << static_cast<int>(minor)
<< "] num=" << number
<< ", type=" << get_default(sections, static_cast<section_type>(type))
<< ", compression="
<< get_default(compressions, static_cast<compression_type>(compression))
Expand Down
3 changes: 2 additions & 1 deletion test/dwarfs_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,8 @@ TEST_P(compression_regression, github45) {
reader::filesystem_v2::identify(lgr, *input, mm, idss, 3);

std::string line;
std::regex const re("^SECTION num=\\d+, type=BLOCK, compression=(\\w+).*");
std::regex const re(
"^SECTION \\[[^\\]]+\\] num=\\d+, type=BLOCK, compression=(\\w+).*");
std::set<std::string> compressions;
while (std::getline(idss, line)) {
std::smatch m;
Expand Down

0 comments on commit 9071ee5

Please sign in to comment.