mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-09 12:28:13 -04:00
test: add dump/info tests
This commit is contained in:
parent
0ac4ba088f
commit
1e0eeacfd6
@ -29,6 +29,8 @@
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <folly/json.h>
|
||||
|
||||
#include "dwarfs/filesystem_v2.h"
|
||||
#include "dwarfs/util.h"
|
||||
#include "dwarfs_tool_main.h"
|
||||
@ -352,6 +354,37 @@ TEST_P(categorizer_test, end_to_end) {
|
||||
|
||||
EXPECT_TRUE(iv16);
|
||||
EXPECT_TRUE(iv32);
|
||||
|
||||
{
|
||||
std::vector<std::string> dumps;
|
||||
|
||||
for (int detail = 0; detail <= 6; ++detail) {
|
||||
std::ostringstream os;
|
||||
fs.dump(os, detail);
|
||||
auto d = os.str();
|
||||
if (!dumps.empty()) {
|
||||
EXPECT_GT(d.size(), dumps.back().size()) << detail;
|
||||
}
|
||||
dumps.emplace_back(std::move(d));
|
||||
}
|
||||
|
||||
EXPECT_GT(dumps.back().size(), 10'000);
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<std::string> infos;
|
||||
|
||||
for (int detail = 0; detail <= 4; ++detail) {
|
||||
auto info = fs.info_as_dynamic(detail);
|
||||
auto i = folly::toJson(info);
|
||||
if (!infos.empty()) {
|
||||
EXPECT_GT(i.size(), infos.back().size()) << detail;
|
||||
}
|
||||
infos.emplace_back(std::move(i));
|
||||
}
|
||||
|
||||
EXPECT_GT(infos.back().size(), 1'000);
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(dwarfs, categorizer_test,
|
||||
|
Loading…
x
Reference in New Issue
Block a user