Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Identation and build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pozdnyakov committed Nov 19, 2019
1 parent 37b3328 commit 9f24115
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 34 deletions.
1 change: 1 addition & 0 deletions next/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ add_library(
${MBGL_ROOT}/test/tile/geometry_tile_data.test.cpp
${MBGL_ROOT}/test/tile/raster_dem_tile.test.cpp
${MBGL_ROOT}/test/tile/raster_tile.test.cpp
${MBGL_ROOT}/test/tile/tile_cache.test.cpp
${MBGL_ROOT}/test/tile/tile_coordinate.test.cpp
${MBGL_ROOT}/test/tile/tile_id.test.cpp
${MBGL_ROOT}/test/tile/vector_tile.test.cpp
Expand Down
65 changes: 31 additions & 34 deletions test/tile/tile_cache.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
#include <mbgl/tile/tile_cache.hpp>

#include <mbgl/test/fake_file_source.hpp>
#include <mbgl/tile/tile_loader_impl.hpp>
#include <mbgl/tile/vector_tile.hpp>
#include <mbgl/tile/vector_tile_data.hpp>
#include <mbgl/tile/tile_loader_impl.hpp>

#include <mbgl/util/run_loop.hpp>
#include <mbgl/annotation/annotation_manager.hpp>
#include <mbgl/geometry/feature_index.hpp>
#include <mbgl/map/transform.hpp>
#include <mbgl/style/style.hpp>
#include <mbgl/style/layers/symbol_layer.hpp>
#include <mbgl/renderer/tile_parameters.hpp>
#include <mbgl/renderer/buckets/symbol_bucket.hpp>
#include <mbgl/renderer/query.hpp>
#include <mbgl/geometry/feature_index.hpp>
#include <mbgl/annotation/annotation_manager.hpp>
#include <mbgl/renderer/image_manager.hpp>
#include <mbgl/renderer/query.hpp>
#include <mbgl/renderer/tile_parameters.hpp>
#include <mbgl/style/layers/symbol_layer.hpp>
#include <mbgl/style/style.hpp>
#include <mbgl/text/glyph_manager.hpp>
#include <mbgl/util/run_loop.hpp>

#include <memory>

Expand All @@ -28,39 +28,38 @@ class VectorTileTest {
std::shared_ptr<FileSource> fileSource = std::make_shared<FakeFileSource>();
TransformState transformState;
util::RunLoop loop;
style::Style style { *fileSource, 1 };
AnnotationManager annotationManager { style };
style::Style style{*fileSource, 1};
AnnotationManager annotationManager{style};
ImageManager imageManager;
GlyphManager glyphManager;
Tileset tileset { { "https://example.com" }, { 0, 22 }, "none" };
Tileset tileset{{"https://example.com"}, {0, 22}, "none"};

TileParameters tileParameters {
1.0,
MapDebugOptions(),
transformState,
fileSource,
MapMode::Continuous,
annotationManager,
imageManager,
glyphManager,
0
};
TileParameters tileParameters{1.0,
MapDebugOptions(),
transformState,
fileSource,
MapMode::Continuous,
annotationManager,
imageManager,
glyphManager,
0};
};

class VectorTileMock : public VectorTile {
public:
VectorTileMock(const OverscaledTileID & id,
std::string sourceID,
const TileParameters & parameters,
const Tileset & tileset) : VectorTile(id, sourceID, parameters, tileset)
{ renderable = true; }
public:
VectorTileMock(const OverscaledTileID& id,
std::string sourceID,
const TileParameters& parameters,
const Tileset& tileset)
: VectorTile(id, sourceID, parameters, tileset) {
renderable = true;
}
};


TEST(TileCache, Smoke) {
VectorTileTest test;
TileCache cache(1);
OverscaledTileID id(0,0,0);
OverscaledTileID id(0, 0, 0);
std::unique_ptr<Tile> tile = std::make_unique<VectorTileMock>(id, "source", test.tileParameters, test.tileset);

cache.add(id, std::move(tile));
Expand All @@ -69,12 +68,11 @@ TEST(TileCache, Smoke) {
EXPECT_FALSE(cache.has(id));
}


TEST(TileCache, Issue15926) {
VectorTileTest test;
TileCache cache(2);
OverscaledTileID id0(0,0,0);
OverscaledTileID id1(1,0,0);
OverscaledTileID id0(0, 0, 0);
OverscaledTileID id1(1, 0, 0);
std::unique_ptr<Tile> tile1 = std::make_unique<VectorTileMock>(id0, "source", test.tileParameters, test.tileset);
std::unique_ptr<Tile> tile2 = std::make_unique<VectorTileMock>(id0, "source", test.tileParameters, test.tileset);
std::unique_ptr<Tile> tile3 = std::make_unique<VectorTileMock>(id1, "source", test.tileParameters, test.tileset);
Expand All @@ -87,4 +85,3 @@ TEST(TileCache, Issue15926) {
EXPECT_FALSE(cache.has(id0));
EXPECT_TRUE(cache.has(id1));
}

0 comments on commit 9f24115

Please sign in to comment.