rename llmr => mbgl
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <llmr/util/clip_ids.hpp>
|
||||
#include <llmr/util/std.hpp>
|
||||
#include <mbgl/util/clip_ids.hpp>
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
TEST(ClipIDs, ClipMasks) {
|
||||
ASSERT_EQ(0, clipMask[0]);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <iostream>
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <llmr/style/filter_comparison_private.hpp>
|
||||
#include <llmr/style/filter_expression_private.hpp>
|
||||
#include <mbgl/style/filter_comparison_private.hpp>
|
||||
#include <mbgl/style/filter_expression_private.hpp>
|
||||
|
||||
#include <map>
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
class MockExtractor {
|
||||
public:
|
||||
inline MockExtractor(const std::multimap<std::string, llmr::Value> &values) : values(values) {}
|
||||
inline MockExtractor(const std::multimap<std::string, mbgl::Value> &values) : values(values) {}
|
||||
inline MockExtractor() {}
|
||||
|
||||
inline std::vector<llmr::Value> getValues(const std::string &key) const {
|
||||
std::vector<llmr::Value> result;
|
||||
inline std::vector<mbgl::Value> getValues(const std::string &key) const {
|
||||
std::vector<mbgl::Value> result;
|
||||
// Find all values with the requested key.
|
||||
const auto ret = values.equal_range(key);
|
||||
for (auto it = ret.first; it != ret.second; it++) {
|
||||
@@ -25,12 +25,12 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
const std::multimap<std::string, llmr::Value> values;
|
||||
const std::multimap<std::string, mbgl::Value> values;
|
||||
};
|
||||
|
||||
|
||||
TEST(FilterComparison, EqualsSingleStringValue) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::Equal, std::vector<Value> { std::string("bar") });
|
||||
@@ -52,7 +52,7 @@ TEST(FilterComparison, EqualsSingleStringValue) {
|
||||
|
||||
|
||||
TEST(FilterComparison, EqualsSingleDoubleValue) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::Equal, std::vector<Value> { double(32.8) });
|
||||
@@ -72,7 +72,7 @@ TEST(FilterComparison, EqualsSingleDoubleValue) {
|
||||
}
|
||||
|
||||
TEST(FilterComparison, EqualsSingleUintValue) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::Equal, std::vector<Value> { uint64_t(42) });
|
||||
@@ -94,7 +94,7 @@ TEST(FilterComparison, EqualsSingleUintValue) {
|
||||
}
|
||||
|
||||
TEST(FilterComparison, EqualsSingleIntValue) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::Equal, std::vector<Value> { int64_t(-42) });
|
||||
@@ -115,7 +115,7 @@ TEST(FilterComparison, EqualsSingleIntValue) {
|
||||
}
|
||||
|
||||
TEST(FilterComparison, EqualsSingleBoolValue) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::Equal, std::vector<Value> { bool(true) });
|
||||
@@ -138,7 +138,7 @@ TEST(FilterComparison, EqualsSingleBoolValue) {
|
||||
|
||||
|
||||
TEST(FilterComparison, EqualsMultipleStringValues) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::Equal, std::vector<Value> { std::string("bar"), std::string("baz") });
|
||||
@@ -152,7 +152,7 @@ TEST(FilterComparison, EqualsMultipleStringValues) {
|
||||
}
|
||||
|
||||
TEST(FilterComparison, EqualsMultipleIdenticalStringValues) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::Equal, std::vector<Value> { std::string("bar"), std::string("bar") });
|
||||
@@ -167,7 +167,7 @@ TEST(FilterComparison, EqualsMultipleIdenticalStringValues) {
|
||||
|
||||
|
||||
TEST(FilterComparison, NotEqualsSingleStringValue) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::NotEqual, std::vector<Value> { std::string("bar") });
|
||||
@@ -189,7 +189,7 @@ TEST(FilterComparison, NotEqualsSingleStringValue) {
|
||||
|
||||
|
||||
TEST(FilterComparison, NotEqualsSingleDoubleValue) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::NotEqual, std::vector<Value> { double(32.8) });
|
||||
@@ -209,7 +209,7 @@ TEST(FilterComparison, NotEqualsSingleDoubleValue) {
|
||||
}
|
||||
|
||||
TEST(FilterComparison, NotEqualsSingleUintValue) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::NotEqual, std::vector<Value> { uint64_t(42) });
|
||||
@@ -232,7 +232,7 @@ TEST(FilterComparison, NotEqualsSingleUintValue) {
|
||||
|
||||
|
||||
TEST(FilterComparison, NotEqualsSingleIntValue) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::NotEqual, std::vector<Value> { int64_t(-42) });
|
||||
@@ -254,7 +254,7 @@ TEST(FilterComparison, NotEqualsSingleIntValue) {
|
||||
|
||||
|
||||
TEST(FilterComparison, NotEqualsSingleBoolValue) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::NotEqual, std::vector<Value> { bool(true) });
|
||||
@@ -277,7 +277,7 @@ TEST(FilterComparison, NotEqualsSingleBoolValue) {
|
||||
|
||||
|
||||
TEST(FilterComparison, NotEqualsMultipleStringValues) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::NotEqual, std::vector<Value> { std::string("bar"), std::string("baz") });
|
||||
@@ -293,7 +293,7 @@ TEST(FilterComparison, NotEqualsMultipleStringValues) {
|
||||
|
||||
|
||||
TEST(FilterComparison, NotEqualsMultipleIdenticalStringValues) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
FilterComparison comparison("test");
|
||||
comparison.add(FilterComparison::Operator::NotEqual, std::vector<Value> { std::string("bar"), std::string("bar") });
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <llmr/style/types.hpp>
|
||||
#include <mbgl/style/types.hpp>
|
||||
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
TEST(Enums, StyleLayerType) {
|
||||
std::cerr << StyleLayerType::Raster;
|
||||
|
||||
2
test/fixtures/fixture_log.cpp
vendored
2
test/fixtures/fixture_log.cpp
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace llmr {
|
||||
namespace mbgl {
|
||||
|
||||
FixtureLogBackend::~FixtureLogBackend() {
|
||||
std::cerr << unchecked();
|
||||
|
||||
10
test/fixtures/fixture_log.hpp
vendored
10
test/fixtures/fixture_log.hpp
vendored
@@ -1,15 +1,15 @@
|
||||
#ifndef LLMR_TEST_FIXTURE_LOG
|
||||
#define LLMR_TEST_FIXTURE_LOG
|
||||
#ifndef MBGL_TEST_FIXTURE_LOG
|
||||
#define MBGL_TEST_FIXTURE_LOG
|
||||
|
||||
#include <llmr/platform/log.hpp>
|
||||
#include <llmr/util/noncopyable.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/util/noncopyable.hpp>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <cstdarg>
|
||||
|
||||
namespace llmr {
|
||||
namespace mbgl {
|
||||
|
||||
class FixtureLogBackend : public LogBackend, private util::noncopyable {
|
||||
public:
|
||||
|
||||
12
test/fixtures/fixture_request.cpp
vendored
12
test/fixtures/fixture_request.cpp
vendored
@@ -1,7 +1,7 @@
|
||||
#include <llmr/platform/platform.hpp>
|
||||
#include <llmr/platform/request.hpp>
|
||||
#include <llmr/util/uv.hpp>
|
||||
#include <llmr/platform/log.hpp>
|
||||
#include <mbgl/platform/platform.hpp>
|
||||
#include <mbgl/platform/request.hpp>
|
||||
#include <mbgl/util/uv.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
|
||||
const std::string base_directory = []{
|
||||
std::string fn = __FILE__;
|
||||
@@ -10,7 +10,7 @@ const std::string base_directory = []{
|
||||
}();
|
||||
|
||||
|
||||
namespace llmr {
|
||||
namespace mbgl {
|
||||
|
||||
std::shared_ptr<platform::Request>
|
||||
platform::request_http(const std::string &url,
|
||||
@@ -103,4 +103,4 @@ void platform::cancel_request_http(const std::shared_ptr<Request> &req) {
|
||||
}
|
||||
}
|
||||
|
||||
} // end namespace llmr
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
#include <iostream>
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <llmr/style/function_properties.hpp>
|
||||
#include <mbgl/style/function_properties.hpp>
|
||||
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
TEST(Function, Constant) {
|
||||
EXPECT_EQ(2.0f, llmr::ConstantFunction<float>(2).evaluate(0));
|
||||
EXPECT_EQ(3.8f, llmr::ConstantFunction<float>(3.8).evaluate(0));
|
||||
EXPECT_EQ(22.0f, llmr::ConstantFunction<float>(22).evaluate(0));
|
||||
EXPECT_EQ(2.0f, llmr::ConstantFunction<float>(2).evaluate(4));
|
||||
EXPECT_EQ(3.8f, llmr::ConstantFunction<float>(3.8).evaluate(4));
|
||||
EXPECT_EQ(22.0f, llmr::ConstantFunction<float>(22).evaluate(4));
|
||||
EXPECT_EQ(2.0f, llmr::ConstantFunction<float>(2).evaluate(22));
|
||||
EXPECT_EQ(3.8f, llmr::ConstantFunction<float>(3.8).evaluate(22));
|
||||
EXPECT_EQ(22.0f, llmr::ConstantFunction<float>(22).evaluate(22));
|
||||
EXPECT_EQ(2.0f, mbgl::ConstantFunction<float>(2).evaluate(0));
|
||||
EXPECT_EQ(3.8f, mbgl::ConstantFunction<float>(3.8).evaluate(0));
|
||||
EXPECT_EQ(22.0f, mbgl::ConstantFunction<float>(22).evaluate(0));
|
||||
EXPECT_EQ(2.0f, mbgl::ConstantFunction<float>(2).evaluate(4));
|
||||
EXPECT_EQ(3.8f, mbgl::ConstantFunction<float>(3.8).evaluate(4));
|
||||
EXPECT_EQ(22.0f, mbgl::ConstantFunction<float>(22).evaluate(4));
|
||||
EXPECT_EQ(2.0f, mbgl::ConstantFunction<float>(2).evaluate(22));
|
||||
EXPECT_EQ(3.8f, mbgl::ConstantFunction<float>(3.8).evaluate(22));
|
||||
EXPECT_EQ(22.0f, mbgl::ConstantFunction<float>(22).evaluate(22));
|
||||
}
|
||||
|
||||
TEST(Function, Stops) {
|
||||
// Explicit constant slope in fringe regions.
|
||||
llmr::StopsFunction<float> slope_1({ { 0, 1.5 }, { 6, 1.5 }, { 8, 3 }, { 22, 3 } });
|
||||
mbgl::StopsFunction<float> slope_1({ { 0, 1.5 }, { 6, 1.5 }, { 8, 3 }, { 22, 3 } });
|
||||
EXPECT_EQ(1.5, slope_1.evaluate(0));
|
||||
EXPECT_EQ(1.5, slope_1.evaluate(4));
|
||||
EXPECT_EQ(1.5, slope_1.evaluate(6));
|
||||
@@ -31,7 +31,7 @@ TEST(Function, Stops) {
|
||||
|
||||
|
||||
// Test constant values in fringe regions.
|
||||
llmr::StopsFunction<float> slope_2({ { 6, 1.5 }, { 8, 3 } });
|
||||
mbgl::StopsFunction<float> slope_2({ { 6, 1.5 }, { 8, 3 } });
|
||||
EXPECT_EQ(1.5, slope_2.evaluate(0));
|
||||
EXPECT_EQ(1.5, slope_2.evaluate(4));
|
||||
EXPECT_EQ(1.5, slope_2.evaluate(6));
|
||||
@@ -42,7 +42,7 @@ TEST(Function, Stops) {
|
||||
EXPECT_EQ(3.0, slope_2.evaluate(22));
|
||||
|
||||
// Test no values.
|
||||
llmr::StopsFunction<float> slope_3({});
|
||||
mbgl::StopsFunction<float> slope_3({});
|
||||
EXPECT_EQ(1, slope_3.evaluate(2));
|
||||
EXPECT_EQ(1, slope_3.evaluate(6));
|
||||
EXPECT_EQ(1, slope_3.evaluate(12));
|
||||
@@ -50,7 +50,7 @@ TEST(Function, Stops) {
|
||||
|
||||
|
||||
TEST(Function, Linear) {
|
||||
llmr::LinearFunction<float> slope_1(/* val */ 7.5, /* z_base */ 4, /* slope */ 2, /* min */ 7.5, /* max */ 20);
|
||||
mbgl::LinearFunction<float> slope_1(/* val */ 7.5, /* z_base */ 4, /* slope */ 2, /* min */ 7.5, /* max */ 20);
|
||||
ASSERT_FLOAT_EQ(7.5, slope_1.evaluate(3));
|
||||
ASSERT_FLOAT_EQ(7.5, slope_1.evaluate(4));
|
||||
ASSERT_FLOAT_EQ(8.5, slope_1.evaluate(4.5));
|
||||
@@ -63,7 +63,7 @@ TEST(Function, Linear) {
|
||||
|
||||
|
||||
TEST(Function, Exponential) {
|
||||
llmr::ExponentialFunction<float> slope_1(/* val */ 7.5, /* z_base */ 4, /* exp_base */ 1.75, /* slope */ 2, /* min */ 7.5, /* max */ 20);
|
||||
mbgl::ExponentialFunction<float> slope_1(/* val */ 7.5, /* z_base */ 4, /* exp_base */ 1.75, /* slope */ 2, /* min */ 7.5, /* max */ 20);
|
||||
ASSERT_FLOAT_EQ(8.6428576, slope_1.evaluate(3)); // 7.5 + 1.75^(3 - 4) * 2
|
||||
ASSERT_FLOAT_EQ(9.5, slope_1.evaluate(4)); // 7.5 + 1.75^(4 - 4) * 2
|
||||
ASSERT_FLOAT_EQ(10.145751, slope_1.evaluate(4.5)); // 7.5 + 1.75^(4.5 - 4) * 2
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <llmr/map/map.hpp>
|
||||
#include <llmr/util/image.hpp>
|
||||
#include <llmr/util/io.hpp>
|
||||
#include <llmr/util/std.hpp>
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/util/image.hpp>
|
||||
#include <mbgl/util/io.hpp>
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
#include <rapidjson/document.h>
|
||||
|
||||
@@ -22,7 +22,7 @@ const std::string base_directory = []{
|
||||
class HeadlessTest : public ::testing::TestWithParam<std::string> {};
|
||||
|
||||
TEST_P(HeadlessTest, render) {
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
const std::string &base = GetParam();
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <llmr/text/rotation_range.hpp>
|
||||
#include <mbgl/text/rotation_range.hpp>
|
||||
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
double deg(double x) { return x / M_PI * 180.0; }
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
],
|
||||
"dependencies": [
|
||||
"../deps/gtest/gtest.gyp:gtest",
|
||||
"../llmr.gyp:llmr-x86"
|
||||
"../mbgl.gyp:mbgl-x86"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -87,7 +87,7 @@
|
||||
],
|
||||
"dependencies": [
|
||||
"../deps/gtest/gtest.gyp:gtest",
|
||||
"../llmr.gyp:llmr-x86"
|
||||
"../mbgl.gyp:mbgl-x86"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -103,7 +103,7 @@
|
||||
],
|
||||
"dependencies": [
|
||||
"../deps/gtest/gtest.gyp:gtest",
|
||||
"../llmr.gyp:llmr-x86"
|
||||
"../mbgl.gyp:mbgl-x86"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -119,7 +119,7 @@
|
||||
],
|
||||
"dependencies": [
|
||||
"../deps/gtest/gtest.gyp:gtest",
|
||||
"../llmr.gyp:llmr-x86"
|
||||
"../mbgl.gyp:mbgl-x86"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -135,7 +135,7 @@
|
||||
],
|
||||
"dependencies": [
|
||||
"../deps/gtest/gtest.gyp:gtest",
|
||||
"../llmr.gyp:llmr-x86"
|
||||
"../mbgl.gyp:mbgl-x86"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -151,7 +151,7 @@
|
||||
],
|
||||
"dependencies": [
|
||||
"../deps/gtest/gtest.gyp:gtest",
|
||||
"../llmr.gyp:llmr-x86"
|
||||
"../mbgl.gyp:mbgl-x86"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -167,7 +167,7 @@
|
||||
],
|
||||
"dependencies": [
|
||||
"../deps/gtest/gtest.gyp:gtest",
|
||||
"../llmr.gyp:llmr-x86"
|
||||
"../mbgl.gyp:mbgl-x86"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -188,9 +188,9 @@
|
||||
],
|
||||
"dependencies": [
|
||||
"../deps/gtest/gtest.gyp:gtest",
|
||||
"../llmr.gyp:llmr-x86",
|
||||
"../mbgl.gyp:mbgl-x86",
|
||||
"link_gl",
|
||||
'../llmr.gyp:copy_default_stylesheet',
|
||||
'../mbgl.gyp:copy_default_stylesheet',
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <iostream>
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <llmr/map/tile.hpp>
|
||||
#include <mbgl/map/tile.hpp>
|
||||
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
|
||||
TEST(Variant, isChild) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <iostream>
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <llmr/style/value.hpp>
|
||||
#include <llmr/style/value_comparison.hpp>
|
||||
#include <mbgl/style/value.hpp>
|
||||
#include <mbgl/style/value_comparison.hpp>
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#ifndef __clang__
|
||||
@@ -11,17 +11,17 @@
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
using namespace llmr;
|
||||
using namespace mbgl;
|
||||
|
||||
TEST(Variant, toString) {
|
||||
EXPECT_EQ("lord", llmr::toString( (std::string)"lord" ));
|
||||
EXPECT_EQ("36", llmr::toString( (uint64_t)36 ));
|
||||
EXPECT_EQ("-239", llmr::toString( (int64_t)-239 ));
|
||||
EXPECT_EQ("0", llmr::toString( (int64_t)0 ));
|
||||
EXPECT_EQ("3.14159268", llmr::toString( (double)3.14159268 ));
|
||||
EXPECT_EQ("3.1415926535897931", llmr::toString( (double)3.1415926535897931 ));
|
||||
EXPECT_EQ("true", llmr::toString( true ));
|
||||
EXPECT_EQ("false", llmr::toString( false ));
|
||||
EXPECT_EQ("lord", toString( (std::string)"lord" ));
|
||||
EXPECT_EQ("36", toString( (uint64_t)36 ));
|
||||
EXPECT_EQ("-239", toString( (int64_t)-239 ));
|
||||
EXPECT_EQ("0", toString( (int64_t)0 ));
|
||||
EXPECT_EQ("3.14159268", toString( (double)3.14159268 ));
|
||||
EXPECT_EQ("3.1415926535897931", toString( (double)3.1415926535897931 ));
|
||||
EXPECT_EQ("true", toString( true ));
|
||||
EXPECT_EQ("false", toString( false ));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user