Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/drape
diff options
context:
space:
mode:
authorExMix <rahuba.youri@mapswithme.com>2014-12-30 16:06:51 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:35:48 +0300
commit462aa62950543c91949736e2bc9665669c03cfbd (patch)
tree1acada15110c245df5eaac197f0fe5a03d8ba3c8 /drape
parent5d3977bebd9fb7e68c7eec158e5ca06385372a5e (diff)
[drape] test fixes
Diffstat (limited to 'drape')
-rw-r--r--drape/drape_tests/drape_tests.pro1
-rw-r--r--drape/drape_tests/dummy_texture.hpp13
-rw-r--r--drape/drape_tests/font_texture_tests.cpp7
-rw-r--r--drape/drape_tests/stipple_pen_tests.cpp16
-rw-r--r--drape/drape_tests/texture_of_colors_tests.cpp25
-rw-r--r--drape/drape_tests/uniform_value_tests.cpp2
6 files changed, 30 insertions, 34 deletions
diff --git a/drape/drape_tests/drape_tests.pro b/drape/drape_tests/drape_tests.pro
index 82d9b17d1e..6e685a3eef 100644
--- a/drape/drape_tests/drape_tests.pro
+++ b/drape/drape_tests/drape_tests.pro
@@ -48,3 +48,4 @@ HEADERS += \
glmock_functions.hpp \
memory_comparer.hpp \
img.hpp \
+ dummy_texture.hpp
diff --git a/drape/drape_tests/dummy_texture.hpp b/drape/drape_tests/dummy_texture.hpp
new file mode 100644
index 0000000000..ebbdcbc0fb
--- /dev/null
+++ b/drape/drape_tests/dummy_texture.hpp
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "../pointers.hpp"
+#include "../texture.hpp"
+
+class DummyTexture : public dp::Texture
+{
+public:
+ virtual dp::RefPointer<ResourceInfo> FindResource(Key const & /*key*/) const
+ {
+ return dp::RefPointer<ResourceInfo>();
+ }
+};
diff --git a/drape/drape_tests/font_texture_tests.cpp b/drape/drape_tests/font_texture_tests.cpp
index 4454b06447..07b6d44f13 100644
--- a/drape/drape_tests/font_texture_tests.cpp
+++ b/drape/drape_tests/font_texture_tests.cpp
@@ -1,5 +1,6 @@
#include "../../testing/testing.hpp"
#include "img.hpp"
+#include "dummy_texture.hpp"
#include "../font_texture.hpp"
#include "../glyph_manager.hpp"
@@ -25,12 +26,6 @@ using namespace dp;
namespace
{
- class DummyTexture : public dp::Texture
- {
- public:
- virtual ResourceInfo const * FindResource(Key const & key) const { return nullptr; }
- };
-
class UploadedRender
{
public:
diff --git a/drape/drape_tests/stipple_pen_tests.cpp b/drape/drape_tests/stipple_pen_tests.cpp
index 0597925b0f..642d78ece2 100644
--- a/drape/drape_tests/stipple_pen_tests.cpp
+++ b/drape/drape_tests/stipple_pen_tests.cpp
@@ -1,11 +1,13 @@
#include "../../testing/testing.hpp"
#include "memory_comparer.hpp"
+#include "dummy_texture.hpp"
#include "../glconstants.hpp"
#include "../stipple_pen_resource.hpp"
#include "../texture.hpp"
+
#include "glmock_functions.hpp"
#include <gmock/gmock.h>
@@ -20,14 +22,6 @@ using namespace dp;
namespace
{
- class DummyTexture : public Texture
- {
- public:
- DummyTexture() {}
-
- virtual ResourceInfo const * FindResource(Key const & key) const { return NULL; }
- };
-
void TestPacker(StipplePenPacker & packer, uint32_t width, m2::RectU const & expect)
{
m2::RectU rect = packer.PackResource(width);
@@ -410,11 +404,11 @@ UNIT_TEST(StippleMappingTest)
info.m_pattern.push_back(10);
info.m_pattern.push_back(10);
- StipplePenResourceInfo const * r1 = index.MapResource(info);
+ RefPointer<Texture::ResourceInfo> r1 = index.MapResource(info);
TEST(IsRectsEqual(r1->GetTexRect(), m2::RectF(1.0f / width, 1.0f / height,
241.0f / width, 1.0f / height)), ());
- StipplePenResourceInfo const * r2 = index.MapResource(info);
+ RefPointer<Texture::ResourceInfo> r2 = index.MapResource(info);
TEST(IsRectsEqual(r1->GetTexRect(), r2->GetTexRect()), ());
info.m_pattern.clear();
@@ -451,7 +445,7 @@ UNIT_TEST(StippleMappingTest)
StipplePenKey secInfo;
secInfo.m_pattern.push_back(20);
secInfo.m_pattern.push_back(20);
- StipplePenResourceInfo const * r12 = index.MapResource(secInfo);
+ RefPointer<Texture::ResourceInfo> r12 = index.MapResource(secInfo);
TEST(IsRectsEqual(r12->GetTexRect(), m2::RectF(1.0f / width, 7.0f / height,
241.0f / width, 7.0f / height)), ());
diff --git a/drape/drape_tests/texture_of_colors_tests.cpp b/drape/drape_tests/texture_of_colors_tests.cpp
index 0a9de054de..612e9bdce2 100644
--- a/drape/drape_tests/texture_of_colors_tests.cpp
+++ b/drape/drape_tests/texture_of_colors_tests.cpp
@@ -1,10 +1,10 @@
#include "../../testing/testing.hpp"
#include "memory_comparer.hpp"
+#include "dummy_texture.hpp"
#include "../glconstants.hpp"
#include "../texture_of_colors.hpp"
-#include "../texture_set_holder.hpp"
#include "../texture.hpp"
#include "glmock_functions.hpp"
@@ -21,13 +21,6 @@ using namespace dp;
namespace
{
-class SimpleTexture : public Texture
-{
-public:
- SimpleTexture() {}
-
- virtual ResourceInfo const * FindResource(Key const & key) const { return NULL; }
-};
void TestRects(m2::RectF const & a, m2::RectF const & b)
{
@@ -55,12 +48,12 @@ UNIT_TEST(ColorPalleteMappingTests)
{
ColorPalette cp(m2::PointU(32, 16));
- ColorResourceInfo const * info1 = cp.MapResource(dp::Color(0, 0, 0, 0));
- ColorResourceInfo const * info2 = cp.MapResource(dp::Color(1, 1, 1, 1));
- ColorResourceInfo const * info3 = cp.MapResource(dp::Color(0, 0, 0, 0));
+ RefPointer<Texture::ResourceInfo> info1 = cp.MapResource(dp::Color(0, 0, 0, 0));
+ RefPointer<Texture::ResourceInfo> info2 = cp.MapResource(dp::Color(1, 1, 1, 1));
+ RefPointer<Texture::ResourceInfo> info3 = cp.MapResource(dp::Color(0, 0, 0, 0));
- TEST_NOT_EQUAL(info1, info2, ());
- TEST_EQUAL(info1, info3, ());
+ TEST_NOT_EQUAL(info1.GetRaw(), info2.GetRaw(), ());
+ TEST_EQUAL(info1.GetRaw(), info3.GetRaw(), ());
TestRects(info1->GetTexRect(), m2::RectF(1.0f / 32.0f, 1.0f / 16,
1.0f / 32.0f, 1.0f / 16));
TestRects(info2->GetTexRect(), m2::RectF(3.0f / 32.0f, 1.0f / 16,
@@ -81,7 +74,7 @@ UNIT_TEST(ColorPalleteUploadingSingleRow)
int const height = 16;
InitOpenGLTextures(width, height);
- SimpleTexture texture;
+ DummyTexture texture;
texture.Create(width, height, dp::RGBA8);
ColorPalette cp(m2::PointU(width, height));
cp.UploadResources(MakeStackRefPointer<Texture>(&texture));
@@ -147,7 +140,7 @@ UNIT_TEST(ColorPalleteUploadingPartialyRow)
int const height = 16;
InitOpenGLTextures(width, height);
- SimpleTexture texture;
+ DummyTexture texture;
dp::ColorKey key(dp::Color(0, 0, 0, 0));
texture.Create(width, height, dp::RGBA8);
ColorPalette cp(m2::PointU(width, height));
@@ -222,7 +215,7 @@ UNIT_TEST(ColorPalleteUploadingMultipyRow)
int const height = 16;
InitOpenGLTextures(width, height);
- SimpleTexture texture;
+ DummyTexture texture;
dp::ColorKey key(dp::Color(0, 0, 0, 0));
texture.Create(width, height, dp::RGBA8);
ColorPalette cp(m2::PointU(width, height));
diff --git a/drape/drape_tests/uniform_value_tests.cpp b/drape/drape_tests/uniform_value_tests.cpp
index 3f91e5e034..3917975669 100644
--- a/drape/drape_tests/uniform_value_tests.cpp
+++ b/drape/drape_tests/uniform_value_tests.cpp
@@ -166,7 +166,7 @@ UNIT_TEST(UniformValueTest)
}
GpuProgramManager * manager = new GpuProgramManager();
- RefPointer<GpuProgram> program = manager->GetProgram(gpu::SOLID_AREA_PROGRAM);
+ RefPointer<GpuProgram> program = manager->GetProgram(gpu::TEXTURING_PROGRAM);
program->Bind();