xref: /llvm-project/libcxx/test/std/input.output/filesystems/fs.filesystem.synopsis/space_info.pass.cpp (revision ac8c9f1e39e1a773fd81ce23dbf1c80ea186f226)
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 
test()21 constexpr bool test() {
22   assert(testEquality(space_info{1, 2, 3}, space_info{1, 2, 3}, true));
23   assert(testEquality(space_info{0, 2, 3}, space_info{1, 2, 3}, false));
24   assert(testEquality(space_info{1, 0, 3}, space_info{1, 2, 3}, false));
25   assert(testEquality(space_info{1, 2, 0}, space_info{1, 2, 3}, false));
26 
27   return true;
28 }
29 
main(int,char **)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