mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-23 11:24:43 -04:00
test(mkdwarfs): test --no-section-index
This commit is contained in:
parent
9ec7d9fa17
commit
f57a7ff558
@ -117,6 +117,9 @@ TEST_P(mkdwarfs_recompress_test, recompress) {
|
||||
{"fits/metadata", {compression_type}},
|
||||
};
|
||||
EXPECT_EQ(expected_ccmap, ccmap);
|
||||
|
||||
ASSERT_TRUE(info.contains("valid_section_index"));
|
||||
EXPECT_TRUE(info["valid_section_index"].get<bool>());
|
||||
}
|
||||
|
||||
auto tester = [&image_file](std::string const& image_data) {
|
||||
@ -255,8 +258,9 @@ TEST_P(mkdwarfs_recompress_test, recompress) {
|
||||
|
||||
{
|
||||
auto t = tester(image);
|
||||
EXPECT_EQ(0, t.run({"-i", image_file, "-o", "-", "--recompress=none",
|
||||
"--log-level=verbose", "--no-history"}))
|
||||
EXPECT_EQ(
|
||||
0, t.run({"-i", image_file, "-o", "-", "--recompress=none",
|
||||
"--log-level=verbose", "--no-history", "--no-section-index"}))
|
||||
<< t.err();
|
||||
auto fs = t.fs_from_stdout();
|
||||
EXPECT_TRUE(fs.find("/random"));
|
||||
@ -264,6 +268,10 @@ TEST_P(mkdwarfs_recompress_test, recompress) {
|
||||
EXPECT_EQ(1, fs.info_as_json(info_opts).count("history"));
|
||||
EXPECT_THAT(t.err(), ::testing::HasSubstr("removing HISTORY"));
|
||||
|
||||
auto info = fs.info_as_json(info_opts);
|
||||
ASSERT_TRUE(info.contains("valid_section_index"));
|
||||
EXPECT_FALSE(info["valid_section_index"].get<bool>());
|
||||
|
||||
auto t2 = tester(t.out());
|
||||
EXPECT_EQ(0, t2.run({"-i", image_file, "-o", "-", "--recompress=none",
|
||||
"--log-level=verbose"}))
|
||||
@ -272,6 +280,10 @@ TEST_P(mkdwarfs_recompress_test, recompress) {
|
||||
EXPECT_TRUE(fs2.find("/random"));
|
||||
EXPECT_EQ(1, fs2.get_history().size());
|
||||
EXPECT_THAT(t2.err(), ::testing::HasSubstr("adding HISTORY"));
|
||||
|
||||
auto info2 = fs2.info_as_json(info_opts);
|
||||
ASSERT_TRUE(info2.contains("valid_section_index"));
|
||||
EXPECT_TRUE(info2["valid_section_index"].get<bool>());
|
||||
}
|
||||
|
||||
{
|
||||
@ -282,6 +294,14 @@ TEST_P(mkdwarfs_recompress_test, recompress) {
|
||||
<< t.err();
|
||||
EXPECT_THAT(t.err(), ::testing::HasSubstr("input filesystem is corrupt"));
|
||||
}
|
||||
|
||||
{
|
||||
auto t = tester(image);
|
||||
EXPECT_EQ(1, t.run({"-i", image_file, "-o", "-", "--recompress", "-C",
|
||||
"SoMeThInG::null"}))
|
||||
<< t.err();
|
||||
EXPECT_THAT(t.err(), ::testing::HasSubstr("unknown category: 'SoMeThInG'"));
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
Loading…
x
Reference in New Issue
Block a user