MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / main

Function main

lib/tiny-process/tests/open_close_test.cpp:7–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5using namespace TinyProcessLib;
6
7int main() {
8 bool stdout_error=false;
9 for(size_t c=0;c<10000;c++) {
10 Process process("echo Hello World "+to_string(c), "", [&stdout_error, c](const char *bytes, size_t n) {
11 if(string(bytes, n)!="Hello World "+to_string(c)+"\n")
12 stdout_error=true;
13 }, [](const char *, size_t) {
14 }, true);
15 auto exit_status=process.get_exit_status();
16 if(exit_status!=0) {
17 cerr << "Process returned failure." << endl;
18 return 1;
19 }
20 if(stdout_error) {
21 cerr << "Wrong output to stdout." << endl;
22 return 1;
23 }
24 }
25
26 return 0;
27}

Callers

nothing calls this directly

Calls 1

get_exit_statusMethod · 0.45

Tested by

no test coverage detected