MCPcopy Create free account
hub / github.com/CLIUtils/CLI11 / loadFailureFile

Function loadFailureFile

tests/FuzzFailTest.cpp:13–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <vector>
12
13std::string loadFailureFile(const std::string &type, int index) {
14 std::string fileName(TEST_FILE_FOLDER "/fuzzFail/");
15 fileName.append(type);
16 fileName += std::to_string(index);
17 std::ifstream crashFile(fileName, std::ios::in | std::ios::binary);
18 if(crashFile) {
19 std::vector<char> buffer(std::istreambuf_iterator<char>(crashFile), {});
20
21 std::string cdata(buffer.begin(), buffer.end());
22 return cdata;
23 }
24 return std::string{};
25}
26
27TEST_CASE("app_fail") {
28 CLI::FuzzApp fuzzdata;

Callers 1

FuzzFailTest.cppFile · 0.85

Calls 1

to_stringFunction · 0.85

Tested by

no test coverage detected