@@ -99,15 +99,15 @@ using fstream = ghc::filesystem::fstream;
99
99
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
100
100
101
101
template <typename TP>
102
- std::time_t to_time_t (TP tp)
102
+ static std::time_t to_time_t (TP tp)
103
103
{
104
104
using namespace std ::chrono;
105
105
auto sctp = time_point_cast<system_clock::duration>(tp - TP::clock::now () + system_clock::now ());
106
106
return system_clock::to_time_t (sctp);
107
107
}
108
108
109
109
template <typename TP>
110
- TP from_time_t (std::time_t t)
110
+ static TP from_time_t (std::time_t t)
111
111
{
112
112
using namespace std ::chrono;
113
113
auto sctp = system_clock::from_time_t (t);
@@ -214,7 +214,7 @@ static void generateFile(const fs::path& pathname, int withSize = -1)
214
214
}
215
215
216
216
#ifdef GHC_OS_WINDOWS
217
- inline bool isWow64Proc ()
217
+ static bool isWow64Proc ()
218
218
{
219
219
typedef BOOL (WINAPI * IsWow64Process_t)(HANDLE, PBOOL);
220
220
BOOL bIsWow64 = FALSE ;
@@ -303,13 +303,13 @@ class TestAllocator
303
303
};
304
304
305
305
template <class T , class U >
306
- bool operator ==(TestAllocator<T> const &, TestAllocator<U> const &) noexcept
306
+ static bool operator ==(TestAllocator<T> const &, TestAllocator<U> const &) noexcept
307
307
{
308
308
return true ;
309
309
}
310
310
311
311
template <class T , class U >
312
- bool operator !=(TestAllocator<T> const & x, TestAllocator<U> const & y) noexcept
312
+ static bool operator !=(TestAllocator<T> const & x, TestAllocator<U> const & y) noexcept
313
313
{
314
314
return !(x == y);
315
315
}
@@ -1208,7 +1208,7 @@ TEST_CASE("fs.class.filesystem_error - class filesystem_error", "[filesystem][fi
1208
1208
CHECK (fse.path2 () == " some/other" );
1209
1209
}
1210
1210
1211
- constexpr fs::perms constExprOwnerAll ()
1211
+ static constexpr fs::perms constExprOwnerAll ()
1212
1212
{
1213
1213
return fs::perms::owner_read | fs::perms::owner_write | fs::perms::owner_exec;
1214
1214
}
@@ -1787,6 +1787,19 @@ TEST_CASE("fs.op.copy_file - copy_file", "[filesystem][operations][fs.op.copy_fi
1787
1787
CHECK_NOTHROW (fs::copy_file (" foobar" , " foobar2" , ec));
1788
1788
CHECK (ec);
1789
1789
CHECK (!fs::exists (" foobar" ));
1790
+ fs::path file1 (" temp1.txt" );
1791
+ fs::path file2 (" temp2.txt" );
1792
+ generateFile (file1, 200 );
1793
+ generateFile (file2, 200 );
1794
+ auto allWrite = fs::perms::owner_write | fs::perms::group_write | fs::perms::others_write;
1795
+ CHECK_NOTHROW (fs::permissions (file1, allWrite, fs::perm_options::remove ));
1796
+ CHECK ((fs::status (file1).permissions () & fs::perms::owner_write) != fs::perms::owner_write);
1797
+ CHECK_NOTHROW (fs::permissions (file2, allWrite, fs::perm_options::add));
1798
+ CHECK ((fs::status (file2).permissions () & fs::perms::owner_write) == fs::perms::owner_write);
1799
+ fs::copy_file (file1, file2, fs::copy_options::overwrite_existing);
1800
+ CHECK ((fs::status (file2).permissions () & fs::perms::owner_write) != fs::perms::owner_write);
1801
+ CHECK_NOTHROW (fs::permissions (file1, allWrite, fs::perm_options::add));
1802
+ CHECK_NOTHROW (fs::permissions (file2, allWrite, fs::perm_options::add));
1790
1803
}
1791
1804
1792
1805
TEST_CASE (" fs.op.copy_symlink - copy_symlink" , " [filesystem][operations][fs.op.copy_symlink]" )
0 commit comments