|
| vimWrite () |
|
void | execute (const std::vector< std::string > &remainingOptions) override |
|
| baseTest (const std::string &aName, const std::string &aDescription, const decltype(parameters)&aParameters, const decltype(options)&aOptions={}) |
|
void | ensuredWrite (int fd, const std::string &data) |
|
void | ensuredRead (int fd, std::string &data) |
|
void | Execute (const std::vector< std::string > &remainingOptions) |
|
Definition at line 298 of file fileOpsTests.cpp.
◆ vimWrite()
Definition at line 300 of file fileOpsTests.cpp.
301 "simulate the way vim writes a file", {
302 {
"file",
"path to the file to create"
◆ execute()
void vimWrite::execute |
( |
const std::vector< std::string > & |
remainingOptions | ) |
|
|
inlineoverridevirtual |
Implements baseTest.
Definition at line 306 of file fileOpsTests.cpp.
307 auto file = remainingOptions.at(0);
308 std::string tildeFile(file);
311 unlink(tildeFile.c_str());
312 if (stat(file.c_str(), &buf) != 0) {
313 if (errno == ENOENT) {
314 auto fd =
throwcall::badval(open(file.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0644), -1,
323 "rename ", file,
" to ", tildeFile);
324 auto fd =
throwcall::badval(open(file.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0644), -1,
References throwcall::badval(), baseTest::content, baseTest::createdFiles, baseTest::ensuredWrite(), and throwcall::good0().
The documentation for this class was generated from the following file:
T badval(T call, t badvalue, const Args &... args)
template function to wrap system calls that return a special bad value on failure