mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
46
drape_frontend/drape_frontend_tests/frame_values_tests.cpp
Normal file
46
drape_frontend/drape_frontend_tests/frame_values_tests.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "testing/testing.hpp"
|
||||
|
||||
#include "drape_frontend/frame_values.hpp"
|
||||
|
||||
#include "drape/glsl_types.hpp"
|
||||
|
||||
#include "shaders/program_params.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
glsl::mat4 const kTestMatrix1 = glsl::mat4(1.0f, 2.0f, 3.0f, 4.0f,
|
||||
1.0f, 2.0f, 3.0f, 4.0f,
|
||||
1.0f, 2.0f, 3.0f, 4.0f,
|
||||
1.0f, 2.0f, 3.0f, 4.0f);
|
||||
glsl::mat4 const kTestMatrix2 = glsl::mat4(4.0f, 3.0f, 2.0f, 1.0f,
|
||||
4.0f, 3.0f, 2.0f, 1.0f,
|
||||
4.0f, 3.0f, 2.0f, 1.0f,
|
||||
4.0f, 3.0f, 2.0f, 1.0f);
|
||||
} // namespace
|
||||
|
||||
UNIT_TEST(FrameValues_SetTo)
|
||||
{
|
||||
df::FrameValues frameValues;
|
||||
frameValues.m_pivotTransform = kTestMatrix1;
|
||||
frameValues.m_projection = kTestMatrix2;
|
||||
frameValues.m_zScale = 42.0f;
|
||||
|
||||
gpu::MapProgramParams params;
|
||||
frameValues.SetTo(params);
|
||||
|
||||
TEST(params.m_pivotTransform == frameValues.m_pivotTransform, ());
|
||||
TEST(params.m_projection == frameValues.m_projection, ());
|
||||
TEST(params.m_zScale == frameValues.m_zScale, ());
|
||||
}
|
||||
|
||||
UNIT_TEST(FrameValues_SetTo_Partial)
|
||||
{
|
||||
df::FrameValues frameValues;
|
||||
frameValues.m_pivotTransform = kTestMatrix1;
|
||||
frameValues.m_projection = kTestMatrix2;
|
||||
gpu::RouteProgramParams params;
|
||||
frameValues.SetTo(params);
|
||||
|
||||
TEST(params.m_pivotTransform == frameValues.m_pivotTransform, ());
|
||||
TEST(params.m_projection == frameValues.m_projection, ());
|
||||
}
|
||||
Reference in New Issue
Block a user