using json = nlohmann::json;
layer::layer(nlohmann::json const &j) {
- DB(j);
if (j["type"] == "range") {
this->id_min = j["first_surface_id"];
this->id_max = j["last_surface_id"];
}
struct result<struct layer_map> to_layer_map(nlohmann::json const &j) {
- DB(j);
try {
layer_map stl{};
auto m = j["mappings"];
auto jtests = j.value("tests", json());
if (!jtests.empty()) {
- DB("Embedded tests...");
+ logdebug("Embedded tests...");
std::vector<std::pair<int, int>> tests;
tests.reserve(jtests.size());
std::transform(std::cbegin(jtests), std::cend(jtests),
for (auto sid : tests) {
int lid = stl.get_layer_id(sid.first).value_or(-1);
- DB("this=" << sid.first << ", that=" << lid
- << ", expect=" << sid.second);
+ logdebug("this=%d, that=%d, expect=%d", sid.first, lid, sid.second);
if (lid != sid.second) {
return Err<layer_map>("ID Map embedded test failed!");
}