#include <nlohmann/json-schema.hpp>
#include <iostream>
Go to the source code of this file.
◆ EXPECT_EQ
| #define EXPECT_EQ |
( |
| a, |
|
|
| b ) |
Value: do { \
if (a != b) { \
std::cerr << "Failed: '" << a << "' != '" << b << "'\n"; \
} \
} while (0)
Definition at line 7 of file issue-70-root-schema-constructor.cpp.
7#define EXPECT_EQ(a, b) \
8 do { \
9 if (a != b) { \
10 std::cerr << "Failed: '" << a << "' != '" << b << "'\n"; \
11 error_count++; \
12 } \
13 } while (0)
◆ main()
Definition at line 75 of file issue-70-root-schema-constructor.cpp.
76{
78
79 validator.validate({{
"age", 42}, {
"name",
"John"}}, err);
82
84
88
89 validator.validate({{
"street",
"Boulevard"}}, err);
95
96 validator.validate({{
"age", 42}, {
"name", 12}}, err);
100
102 {"age", 42},
103 {"name", "John"},
104 {"phones", {1234, "223"}},
105 },
106 err);
110
112 {"age", 42},
113 {"name", "John"},
114 {"phones", {0}},
115 {"post-code", 12345},
116 },
117 err);
121
123}
nlohmann::json_schema::json_validator validator
std::vector< nlohmann::json::json_pointer > failed_pointers
References error_count, anonymous_namespace{issue-70-root-schema-constructor.cpp}::store_ptr_err_handler::failed_pointers, anonymous_namespace{issue-70-root-schema-constructor.cpp}::store_ptr_err_handler::reset(), nlohmann::json_schema::json_validator::validate(), and validator.
◆ error_count
◆ validator