Add checks for enum conversions and reduceMemoryUse to improve coverage

This commit is contained in:
Tim Sylvester
2023-10-04 09:05:22 -07:00
parent a8f6a3b6af
commit 501125ba4b
3 changed files with 166 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
#include <mbgl/map/map.hpp>
#include <mbgl/map/map_options.hpp>
#include <mbgl/platform/gl_functions.hpp>
#include <mbgl/renderer/renderer.hpp>
#include <mbgl/storage/resource_options.hpp>
#include <mbgl/style/layers/background_layer.hpp>
#include <mbgl/style/layers/fill_layer.hpp>
@@ -114,7 +115,11 @@ TEST(GLContextMode, Shared) {
MBGL_CHECK_ERROR(glEnableVertexAttribArray(paintShader.a_pos));
MBGL_CHECK_ERROR(glVertexAttribPointer(paintShader.a_pos, 2, GL_FLOAT, GL_FALSE, 0, nullptr));
MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, 3));
frontend.getRenderer()->reduceMemoryUse();
ASSERT_TRUE(static_cast<gl::Context&>(frontend.getBackend()->getContext()).empty());
}
test::checkImage("test/fixtures/shared_context", frontend.render(map).image, 0.5, 0.1);
}