brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · f7e26e0 Raw
41 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8// UNSUPPORTED: c++03, c++11, c++14, c++179 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"18namespace fs = std::filesystem;19using namespace fs;20 21constexpr 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 30int 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