MCPcopy Create free account
hub / github.com/chigraph/chigraph / checkForErrors

Function checkForErrors

test/error/errorchecker.cpp:19–32  ·  view source on GitHub ↗

returns -1 for failure, 1 for keep going and 0 for success

Source from the content-addressed store, hash-verified

17
18// returns -1 for failure, 1 for keep going and 0 for success
19int checkForErrors(Result res, const char* expectedErr) {
20 if (!res) {
21 if (res.result_json[0]["errorcode"] == expectedErr) {
22 return 0;
23 } else {
24 std::cerr << "Expected error " << expectedErr << " but got "
25 << res.result_json[0]["errorcode"] << std::endl
26 << res << std::endl;
27 return -1;
28 }
29 }
30
31 return 1;
32}
33
34int main(int argc, char** argv) {
35 const char* mode = argv[1];

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected