| 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // UNSUPPORTED: c++03, c++11, c++14, c++17 |
| 9 | |
| 10 | // <filesystem> |
| 11 | |
| 12 | // friend bool operator==(const space_info&, const space_info&); |
| 13 | |
| 14 | #include <filesystem> |
| 15 | |
| 16 | #include "test_macros.h" |
| 17 | #include "test_comparisons.h" |
| 18 | namespace fs = std::filesystem; |
| 19 | using namespace fs; |
| 20 | |
| 21 | constexpr bool test() { |
| 22 | assert(testEquality(space_info{.capacity: 1, .free: 2, .available: 3}, space_info{.capacity: 1, .free: 2, .available: 3}, true)); |
| 23 | assert(testEquality(space_info{.capacity: 0, .free: 2, .available: 3}, space_info{.capacity: 1, .free: 2, .available: 3}, false)); |
| 24 | assert(testEquality(space_info{.capacity: 1, .free: 0, .available: 3}, space_info{.capacity: 1, .free: 2, .available: 3}, false)); |
| 25 | assert(testEquality(space_info{.capacity: 1, .free: 2, .available: 0}, space_info{.capacity: 1, .free: 2, .available: 3}, false)); |
| 26 | |
| 27 | return true; |
| 28 | } |
| 29 | |
| 30 | int main(int, char**) { |
| 31 | using space_info = std::filesystem::space_info; |
| 32 | |
| 33 | AssertEqualityAreNoexcept<space_info>(); |
| 34 | AssertEqualityReturnBool<space_info>(); |
| 35 | |
| 36 | test(); |
| 37 | static_assert(test()); |
| 38 | |
| 39 | return 0; |
| 40 | } |
| 41 | |