2121 * SPDX-License-Identifier: GPL-3.0-only
2222 */
2323
24+ #include < array>
2425#include < filesystem>
2526#include < sstream>
2627
@@ -38,6 +39,26 @@ using namespace dwarfs;
3839
3940namespace {
4041
42+ using namespace std ::string_view_literals;
43+
44+ constexpr std::array kSkipOn32Bit = {
45+ " 0161bfabd70ee4d3700a46dbe0bf2335.dwarfs" sv,
46+ " 0ca44aa3dda67fe9e9dd85bafbcf8c65.dwarfs" sv,
47+ " 1ee0685c6ec60cc83d204dcd2a86cf6e.dwarfs" sv,
48+ " 288e74070d7e82ba12a6c7f87c7b74c2.dwarfs" sv,
49+ " 320da6d7bce5948ef356e4fe01b20275.dwarfs" sv,
50+ " 38528a6800d8907065e9bc3de6545030.dwarfs" sv,
51+ " 3935bf683501ba8e0812b96a32f9e9c1.dwarfs" sv,
52+ " 3cdd36c5bfdcad8f1cb11f3757b10e0d.dwarfs" sv,
53+ " 67eb016e1ec15aef9e50ddac8119544f.dwarfs" sv,
54+ " 72028fdf38bc8bf5767467a8eb33cea1.dwarfs" sv,
55+ " 80c6ae30d257cf7a936eafa54c85e0f4.dwarfs" sv,
56+ " af9384d3fac4850ed2f10125b5db730c.dwarfs" sv,
57+ " b5c4dfdbba53dda0eea180ae3acccebc.dwarfs" sv,
58+ " ccbfc9eb10aa7b89138996ab90a172a1.dwarfs" sv,
59+ " f93cd8ed5de226bca0ecefc521df9f13.dwarfs" sv,
60+ };
61+
4162auto const testdata{std::filesystem::path{TEST_DATA_DIR } / " badfs" };
4263
4364std::vector<std::string> find_all_filesystems () {
@@ -60,7 +81,13 @@ class bad_fs : public ::testing::TestWithParam<std::string> {};
6081} // namespace
6182
6283TEST_P (bad_fs, test) {
63- auto filename = testdata / GetParam ();
84+ auto const filename = GetParam ();
85+ auto const filepath = testdata / GetParam ();
86+
87+ if (sizeof (size_t ) == 4 && std::find (kSkipOn32Bit .begin (), kSkipOn32Bit .end (),
88+ filename) != kSkipOn32Bit .end ()) {
89+ GTEST_SKIP () << " skipping test for 32-bit systems: " << filename;
90+ }
6491
6592 test::test_logger lgr;
6693 test::os_access_mock os;
@@ -70,7 +97,7 @@ TEST_P(bad_fs, test) {
7097
7198 try {
7299 nerror = reader::filesystem_v2::identify (
73- lgr, os, std::make_shared<mmap>(filename ), oss, 9 , 1 , true ,
100+ lgr, os, std::make_shared<mmap>(filepath ), oss, 9 , 1 , true ,
74101 reader::filesystem_options::IMAGE_OFFSET_AUTO );
75102 } catch (std::exception const &) {
76103 nerror = 1 ;
0 commit comments