Skip to content

Commit

Permalink
Slight changes
Browse files Browse the repository at this point in the history
  • Loading branch information
netheril96 committed Mar 11, 2024
1 parent 1bbc98d commit 39d4feb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
name: securefs-linux-amd64

build-mac:
runs-on: macos-11
runs-on: macos-12
timeout-minutes: 35
steps:
- uses: actions/checkout@v3
Expand All @@ -55,7 +55,7 @@ jobs:
manifest-dir: ${{ github.workspace }}
triplet: x64-osx
token: ${{ github.token }}
cache-key: macos-11-x64
cache-key: macos-12-x64
github-binarycache: true
- name: build
run: python3 build.py --enable_unit_test --vcpkg_root=${{ github.workspace }}/vcpkg --triplet=x64-osx --build_root=./build
Expand All @@ -66,7 +66,7 @@ jobs:
name: securefs-macos-amd64

build-mac-arm64:
runs-on: macos-11
runs-on: macos-12
timeout-minutes: 35
steps:
- uses: actions/checkout@v3
Expand All @@ -86,7 +86,7 @@ jobs:
manifest-dir: ${{ github.workspace }}
triplet: arm64-osx
token: ${{ github.token }}
cache-key: macos-11-arm64
cache-key: macos-12-arm64
github-binarycache: true
- name: build
run: python3 build.py --vcpkg_root=${{ github.workspace }}/vcpkg --triplet=arm64-osx --build_root=./build --cmake_defines CMAKE_OSX_ARCHITECTURES=arm64
Expand Down
9 changes: 0 additions & 9 deletions sources/lite_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,3 @@ class FuseHighLevelOps : public ::securefs::FuseHighLevelOpsBase
std::string long_name_table_file_name(absl::string_view enc_path);
};
} // namespace securefs::lite_format

template <>
struct std::hash<securefs::lite_format::NameNormalizationFlags>
{
std::size_t operator()(const securefs::lite_format::NameNormalizationFlags& args) const noexcept
{
return args.should_case_fold + args.should_normalize_nfc + args.supports_long_name;
}
};
17 changes: 7 additions & 10 deletions test/test_lite_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ namespace
},
std::move(flags));
auto t = injector.get<NameTranslator*>();
CHECK(t->encrypt_full_path("/abCDe/ß", nullptr)
== t->encrypt_full_path("/ABCde/ss", nullptr));
CHECK(t->encrypt_full_path(u8"/abCDe/ß", nullptr)
== t->encrypt_full_path(u8"/ABCde/ss", nullptr));
}

TEST_CASE("Unicode normalizing name translator")
Expand All @@ -99,14 +99,11 @@ namespace
std::move(flags));
auto t = injector.get<NameTranslator*>();

// NFC form of "/aaa/ÄÄÄ"
constexpr unsigned char kAAA1[] = {47, 97, 97, 97, 47, 195, 132, 195, 132, 195, 132, 0};
// NFD form of "/aaa/ÄÄÄ"
constexpr unsigned char kAAA2[]
= {47, 97, 97, 97, 47, 65, 204, 136, 65, 204, 136, 65, 204, 136, 0};

CHECK(t->encrypt_full_path(reinterpret_cast<const char*>(kAAA1), nullptr)
== t->encrypt_full_path(reinterpret_cast<const char*>(kAAA2), nullptr));
CHECK(t->encrypt_full_path(u8"/aaa/ÄÄÄ", nullptr)
== t->encrypt_full_path(u8"/aaa/A\xcc\x88"
"A\xcc\x88"
"Ä",
nullptr));
}

using ListDirResult = std::vector<std::pair<std::string, fuse_stat>>;
Expand Down

0 comments on commit 39d4feb

Please sign in to comment.