MCPcopy Create free account
hub / github.com/HO-COOH/FastCopy / Run

Method Run

SpeedTest/FilesystemApiTest.cpp:5–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <execution>
4#include <cassert>
5bool FilesystemApiTest::Run(std::vector<TestOperation> const& paths)
6{
7 try
8 {
9 std::for_each(
10 std::execution::par_unseq,
11 std::begin(paths),
12 std::end(paths),
13 [](TestOperation const& test) {
14 switch (test.operation)
15 {
16 case TestOperation::Operation::Copy:
17 std::filesystem::copy(test.source, test.destination, std::filesystem::copy_options::recursive | std::filesystem::copy_options::overwrite_existing);
18 break;
19 case TestOperation::Operation::Move:
20 std::filesystem::rename(test.source, test.destination);
21 break;
22 default:
23 assert(false);
24 }
25 }
26 );
27 return true;
28 }
29 catch (...)
30 {
31 return false;
32 }
33}
34
35std::string FilesystemApiTest::GetName() const
36{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected