MCPcopy Create free account
hub / github.com/Fields2Cover/Fields2Cover / checkIfFileExists

Function checkIfFileExists

tests/cpp/utils/visualizer_test.cpp:16–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#include "../test_helpers/robot_data.hpp"
15
16bool checkIfFileExists(const std::string& file, double max_time_waiting = 10.0) {
17 struct stat buffer;
18 const clock_t begin_time = std::clock();
19 double t {0.0};
20 while (t < max_time_waiting) {
21 std::this_thread::sleep_for(std::chrono::milliseconds(50));
22 t = double(std::clock() - begin_time) / CLOCKS_PER_SEC;
23 if (stat(file.c_str(), &buffer) == 0) {
24 return true;
25 }
26 }
27 return false;
28}
29
30F2CCell create_polygon(void) {
31 F2CCell poly;

Callers 1

TESTFunction · 0.85

Calls 1

statClass · 0.85

Tested by

no test coverage detected