core: rename mbgl namespace to mln (#4487)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Bart Louwers
2026-08-14 23:25:20 +02:00
committed by GitHub
parent 836b862984
commit 550f64be22
1970 changed files with 8931 additions and 8967 deletions

View File

@@ -45,8 +45,8 @@
#include <atomic>
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
using namespace std::literals::string_literals;
template <class FileSource = StubFileSource, class Frontend = HeadlessFrontend>
@@ -1686,7 +1686,7 @@ TEST(Map, ResourceError) {
test.frontend.render(test.map);
} catch (...) {
auto error = std::current_exception(); // captur
EXPECT_EQ(mbgl::util::toString(error), "Font file Server failed");
EXPECT_EQ(mln::util::toString(error), "Font file Server failed");
}
}
@@ -1946,7 +1946,7 @@ TEST(Map, ObserveTileLifecycle) {
}
TEST(BackgroundLayer, StyleUpdateZoomDependency) {
using namespace mbgl::style::expression::dsl;
using namespace mln::style::expression::dsl;
MapTest<> test;
test.map.getStyle().loadJSON(util::read_file("test/fixtures/map/style_update_zoom_dependency/style.json"));

View File

@@ -9,7 +9,7 @@
#include <mbgl/util/timer.hpp>
#include <mbgl/util/io.hpp>
using namespace mbgl;
using namespace mln;
static PremultipliedImage namedImage(const std::string& name) {
return decodeImage(util::read_file("test/fixtures/sprites/" + name + ".png"));
@@ -43,10 +43,10 @@ TEST(MapSnapshotter, setStyleJSON) {
})JSON");
snapshotter.snapshot([&runLoop](std::exception_ptr ptr,
mbgl::PremultipliedImage image,
mbgl::MapSnapshotter::Attributions,
mbgl::MapSnapshotter::PointForFn,
mbgl::MapSnapshotter::LatLngForFn) {
mln::PremultipliedImage image,
mln::MapSnapshotter::Attributions,
mln::MapSnapshotter::PointForFn,
mln::MapSnapshotter::LatLngForFn) {
EXPECT_EQ(nullptr, ptr);
EXPECT_EQ(32, image.size.width);
EXPECT_EQ(16, image.size.height);
@@ -71,10 +71,10 @@ TEST(MapSnapshotter, setSize) {
snapshotter.setSize(Size{16, 32});
snapshotter.snapshot([&runLoop](std::exception_ptr ptr,
mbgl::PremultipliedImage image,
mbgl::MapSnapshotter::Attributions,
mbgl::MapSnapshotter::PointForFn,
mbgl::MapSnapshotter::LatLngForFn) {
mln::PremultipliedImage image,
mln::MapSnapshotter::Attributions,
mln::MapSnapshotter::PointForFn,
mln::MapSnapshotter::LatLngForFn) {
EXPECT_EQ(nullptr, ptr);
EXPECT_EQ(16, image.size.width);
EXPECT_EQ(32, image.size.height);
@@ -89,10 +89,10 @@ TEST(MapSnapshotter, TEST_REQUIRES_SERVER(setStyleURL)) {
MapSnapshotter snapshotter(Size{64, 32}, 1.0f, ResourceOptions());
snapshotter.setStyleURL("http://127.0.0.1:3000/online/style.json");
snapshotter.snapshot([&runLoop](std::exception_ptr ptr,
mbgl::PremultipliedImage image,
mbgl::MapSnapshotter::Attributions,
mbgl::MapSnapshotter::PointForFn,
mbgl::MapSnapshotter::LatLngForFn) {
mln::PremultipliedImage image,
mln::MapSnapshotter::Attributions,
mln::MapSnapshotter::PointForFn,
mln::MapSnapshotter::LatLngForFn) {
EXPECT_EQ(nullptr, ptr);
EXPECT_EQ(64, image.size.width);
EXPECT_EQ(32, image.size.height);
@@ -107,10 +107,10 @@ TEST(MapSnapshotter, TEST_REQUIRES_SERVER(cancel)) {
MapSnapshotter snapshotter(Size{1, 1}, 1.0f, ResourceOptions());
snapshotter.setStyleURL("http://127.0.0.1:3000/online/style.json");
snapshotter.snapshot([](std::exception_ptr,
mbgl::PremultipliedImage,
mbgl::MapSnapshotter::Attributions,
mbgl::MapSnapshotter::PointForFn,
mbgl::MapSnapshotter::LatLngForFn) { ASSERT_TRUE(false); });
mln::PremultipliedImage,
mln::MapSnapshotter::Attributions,
mln::MapSnapshotter::PointForFn,
mln::MapSnapshotter::LatLngForFn) { ASSERT_TRUE(false); });
snapshotter.cancel();
@@ -132,10 +132,10 @@ TEST(MapSnapshotter, TEST_REQUIRES_SERVER(runtimeStyling)) {
fillLayer->setFillColor(Color(0.25f, 0.88f, 0.82f, 1.0f));
snapshotter.getStyle().addLayer(std::move(fillLayer));
snapshotter.snapshot([&runLoop](std::exception_ptr ptr,
mbgl::PremultipliedImage image,
mbgl::MapSnapshotter::Attributions,
mbgl::MapSnapshotter::PointForFn,
mbgl::MapSnapshotter::LatLngForFn) {
mln::PremultipliedImage image,
mln::MapSnapshotter::Attributions,
mln::MapSnapshotter::PointForFn,
mln::MapSnapshotter::LatLngForFn) {
EXPECT_EQ(nullptr, ptr);
EXPECT_EQ(256, image.size.width);
EXPECT_EQ(128, image.size.height);
@@ -161,10 +161,10 @@ TEST(MapSnapshotter, TEST_REQUIRES_SERVER(annotation)) {
lineAnnotation.width = {5};
snapshotter.addAnnotation(lineAnnotation);
snapshotter.snapshot([&runLoop](std::exception_ptr ptr,
mbgl::PremultipliedImage image,
mbgl::MapSnapshotter::Attributions,
mbgl::MapSnapshotter::PointForFn,
mbgl::MapSnapshotter::LatLngForFn) {
mln::PremultipliedImage image,
mln::MapSnapshotter::Attributions,
mln::MapSnapshotter::PointForFn,
mln::MapSnapshotter::LatLngForFn) {
EXPECT_EQ(nullptr, ptr);
EXPECT_EQ(256, image.size.width);
EXPECT_EQ(128, image.size.height);

View File

@@ -14,8 +14,8 @@
#include <string>
#include <vector>
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
using namespace std::literals::string_literals;
using namespace std::chrono_literals;

View File

@@ -10,7 +10,7 @@
#include <numbers>
using namespace std::numbers;
using namespace mbgl;
using namespace mln;
TEST(Transform, InvalidZoom) {
Transform transform;
@@ -136,7 +136,7 @@ TEST(Transform, PerspectiveProjection) {
ASSERT_NEAR(point.x, 1000.0, 1e-5);
ASSERT_NEAR(point.y, 0.0, 1e-4);
mbgl::vec4 p;
mln::vec4 p;
point = transform.getState().latLngToScreenCoordinate({37.692872969426375, -76.75823239205641}, p);
ASSERT_NEAR(point.x, 1000.0, 1e-5);
ASSERT_NEAR(point.y, 0.0, 1e-4);
@@ -567,7 +567,7 @@ TEST(Transform, IsPanning) {
}
TEST(Transform, DefaultTransform) {
struct TransformObserver : public mbgl::TransformObserver {
struct TransformObserver : public mln::TransformObserver {
void onCameraWillChange(MapObserver::CameraChangeMode) final { cameraWillChangeCallback(); };
void onCameraDidChange(MapObserver::CameraChangeMode) final { cameraDidChangeCallback(); };
@@ -767,7 +767,7 @@ TEST(Transform, LatLngBounds) {
ASSERT_DOUBLE_EQ(transform.getLatLng().longitude(), 120.0);
// Simulate swipe to the left.
mbgl::AnimationOptions easeOptions(mbgl::Seconds(1));
mln::AnimationOptions easeOptions(mln::Seconds(1));
easeOptions.transitionFrameFn = [&](double /* t */) {
ASSERT_NEAR(transform.getLatLng().longitude(), 120.0, 1e-4);
};