| 32 | } |
| 33 | |
| 34 | int main() |
| 35 | { |
| 36 | json_validator validator(nullptr, uri_format_checker); // create validator |
| 37 | |
| 38 | try { |
| 39 | validator.set_root_schema(uri_schema); // insert root-schema |
| 40 | } catch (const std::exception &e) { |
| 41 | std::cerr << "Validation of schema failed, here is why: " << e.what() << "\n"; |
| 42 | return EXIT_FAILURE; |
| 43 | } |
| 44 | |
| 45 | validator.validate(good_uri); |
| 46 | |
| 47 | try { |
| 48 | validator.validate(bad_uri); |
| 49 | } catch (const std::exception &e) { |
| 50 | std::cerr << "Validation expectedly failed, here is why: " << e.what() << "\n"; |
| 51 | } |
| 52 | |
| 53 | return EXIT_SUCCESS; |
| 54 | } |
nothing calls this directly
no test coverage detected