- stl.main_surface =
- stl.main_surface_name.empty() ? int((*msi)["surface_id"]) : -1;
- }
-
- // Check lookup
- auto jtests = j.value("tests", json());
-
- if (!jtests.empty()) {
- logdebug("Embedded tests...");
- std::vector<std::pair<int, int>> tests;
- tests.reserve(jtests.size());
- std::transform(std::cbegin(jtests), std::cend(jtests),
- std::back_inserter(tests), [](json const &j) {
- return std::make_pair(j["surface_id"],
- j["expect_layer_id"]);
- });
-
- for (auto sid : tests) {
- int lid = stl.get_layer_id(sid.first).value_or(-1);
- 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!");
- }
- }