- // Check lookup
- auto jtests = j.value("tests", json());
-
- if (!jtests.empty()) {
- DB("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(
- get<int>(j["surface_id"]),
- get<int>(j["expect_layer_id"]));
- });
-
- for (auto sid : tests) {
- int lid = stl.get_layer_for_surface(sid.first).value_or(-1);
- DB("this=" << sid.first << ", that=" << lid
- << ", expect=" << sid.second);
- if (lid != sid.second) {
- return Err<surface_id_to_layer_map>(
- "ID Map embedded test failed!");
- }
- }
+ auto msi = j.find("main_surface");
+ if (msi != j.end()) {
+ stl.main_surface_name = msi->value("surface_role", "");
+ stl.main_surface = -1;