|
| simpleWrite () |
|
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 381 of file fileOpsTests.cpp.
◆ simpleWrite()
simpleWrite::simpleWrite |
( |
| ) |
|
|
inline |
Definition at line 383 of file fileOpsTests.cpp.
384 "create a file and write into it", {
385 {
"file",
"path to file"
388 {{
time,
"wait this long between writes"},
389 {
truncate,
"use O_TRUNC on open()"}}) {};
◆ execute()
void simpleWrite::execute |
( |
const std::vector< std::string > & |
remainingOptions | ) |
|
|
inlineoverridevirtual |
Implements baseTest.
Definition at line 390 of file fileOpsTests.cpp.
391 auto file = remainingOptions.at(0);
392 auto fd =
throwcall::badval(open(file.c_str(), O_CREAT | O_WRONLY | (
truncate ? O_TRUNC : 0), 0744), -1,
"open ", file);
393 for (
unsigned i = 0; i <
blocks; i++) {
395 std::this_thread::sleep_for(
time);
References throwcall::badval(), baseTest::blocks, baseTest::content, baseTest::createdFiles, baseTest::ensuredWrite(), throwcall::good0(), baseTest::time, and baseTest::truncate.
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