diff options
Diffstat (limited to 'test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp')
-rw-r--r-- | test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp index 11152e6ab..5e26e8e10 100644 --- a/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp @@ -1,9 +1,8 @@ //===----------------------------------------------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -125,7 +124,7 @@ TimeSpec LastAccessTime(path const& p) { return GetTimes(p).access; } TimeSpec LastWriteTime(path const& p) { return GetTimes(p).write; } -std::pair<TimeSpec, TimeSpec> GetSymlinkTimes(path const& p) { +Times GetSymlinkTimes(path const& p) { StatT st; if (::lstat(p.c_str(), &st) == -1) { std::error_code ec(errno, std::generic_category()); @@ -136,7 +135,10 @@ std::pair<TimeSpec, TimeSpec> GetSymlinkTimes(path const& p) { std::exit(EXIT_FAILURE); #endif } - return {extract_atime(st), extract_mtime(st)}; + Times res; + res.access = extract_atime(st); + res.write = extract_mtime(st); + return res; } namespace { @@ -500,9 +502,8 @@ TEST_CASE(last_write_time_symlink_test) TEST_CHECK(CompareTime(LastWriteTime(file), new_time)); TEST_CHECK(CompareTime(LastAccessTime(sym), old_times.access)); - std::pair<TimeSpec, TimeSpec> sym_times = GetSymlinkTimes(sym); - TEST_CHECK(CompareTime(sym_times.first, old_sym_times.first)); - TEST_CHECK(CompareTime(sym_times.second, old_sym_times.second)); + Times sym_times = GetSymlinkTimes(sym); + TEST_CHECK(CompareTime(sym_times.write, old_sym_times.write)); } |