|
| 1 | +/* |
| 2 | + * Copyright (C) 2026 HERE Europe B.V. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + * |
| 16 | + * SPDX-License-Identifier: Apache-2.0 |
| 17 | + * License-Filename: LICENSE |
| 18 | + */ |
| 19 | + |
| 20 | +#include <gtest/gtest.h> |
| 21 | + |
| 22 | +#include <boost/json/parse.hpp> |
| 23 | + |
| 24 | +namespace { |
| 25 | + |
| 26 | +using UtilsTest = testing::Test; |
| 27 | + |
| 28 | +const std::string kJsonData = R"json( |
| 29 | + { |
| 30 | + "catalogs": [ |
| 31 | + { |
| 32 | + "hrn": "hrn:here:data::olp:ocm", |
| 33 | + "version": 17, |
| 34 | + "dependencies": [], |
| 35 | + "metadata_type": "partitions" |
| 36 | + } |
| 37 | + ], |
| 38 | + "regions": [ |
| 39 | + { |
| 40 | + "id": 423423, |
| 41 | + "parent_id": 14123411, |
| 42 | + "catalogs": [ |
| 43 | + { |
| 44 | + "hrn": "hrn:here:data::olp:ocm", |
| 45 | + "status": "pending", |
| 46 | + "size_raw_bytes": 4623545, |
| 47 | + "layer_groups": [ |
| 48 | + "rendering" |
| 49 | + ], |
| 50 | + "tiles": [ |
| 51 | + 2354325, |
| 52 | + 5243252 |
| 53 | + ] |
| 54 | + } |
| 55 | + ] |
| 56 | + } |
| 57 | + ] |
| 58 | + })json"; |
| 59 | + |
| 60 | +TEST(UtilsTest, BoostJsonAvailable) { |
| 61 | + boost::system::error_code error_code; |
| 62 | + auto parsed_json = boost::json::parse(kJsonData, error_code); |
| 63 | + |
| 64 | + EXPECT_FALSE(error_code.failed()); |
| 65 | +} |
| 66 | + |
| 67 | +} // namespace |
0 commit comments