LCOV - code coverage report
Current view: top level - tests - vector-renderer.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 24 24 100.0 %
Date: 2024-05-11 21:41:31 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 12 24 50.0 %

           Branch data     Line data    Source code
       1                 :            : #undef G_DISABLE_ASSERT
       2                 :            : 
       3                 :            : #include <glib-object.h>
       4                 :            : #include <shumate/shumate.h>
       5                 :            : #include "shumate/shumate-tile-private.h"
       6                 :            : #include "shumate/shumate-vector-renderer-private.h"
       7                 :            : #include "shumate/shumate-utils-private.h"
       8                 :            : 
       9                 :            : static void
      10                 :          3 : test_vector_renderer_render (void)
      11                 :            : {
      12                 :          3 :   GError *error = NULL;
      13                 :          6 :   g_autoptr(GBytes) style_json = NULL;
      14         [ +  - ]:          3 :   g_autoptr(GBytes) tile_data = NULL;
      15         [ +  - ]:          3 :   g_autoptr(ShumateVectorRenderer) renderer = NULL;
      16         [ +  - ]:          6 :   g_autoptr(ShumateTile) tile = shumate_tile_new_full (0, 0, 512, 0);
      17         [ +  - ]:          3 :   g_autoptr(GdkPaintable) paintable = NULL;
      18         [ +  - ]:          3 :   g_autoptr(GPtrArray) symbols = NULL;
      19                 :          3 :   ShumateGridPosition source_position = { 0, 0, 0 };
      20                 :            : 
      21                 :          3 :   style_json = g_resources_lookup_data ("/org/gnome/shumate/Tests/style.json", G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
      22         [ -  + ]:          3 :   g_assert_no_error (error);
      23                 :            : 
      24                 :          3 :   renderer = shumate_vector_renderer_new ("", g_bytes_get_data (style_json, NULL), &error);
      25         [ -  + ]:          3 :   g_assert_no_error (error);
      26                 :            : 
      27                 :          3 :   tile_data = g_resources_lookup_data ("/org/gnome/shumate/Tests/0.pbf", G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
      28         [ -  + ]:          3 :   g_assert_no_error (error);
      29                 :            : 
      30                 :          3 :   shumate_vector_renderer_render (renderer, tile, tile_data, &source_position, &paintable, &symbols);
      31         [ -  + ]:          3 :   g_assert_no_error (error);
      32         [ -  + ]:          3 :   g_assert_true (GDK_IS_PAINTABLE (paintable));
      33   [ -  +  +  - ]:          3 :   g_assert_nonnull (symbols);
      34                 :          3 : }
      35                 :            : 
      36                 :            : int
      37                 :          3 : main (int argc, char *argv[])
      38                 :            : {
      39                 :          3 :   g_test_init (&argc, &argv, NULL);
      40                 :            : 
      41                 :          3 :   g_test_add_func ("/vector-renderer/render", test_vector_renderer_render);
      42                 :            : 
      43                 :          3 :   return g_test_run ();
      44                 :            : }

Generated by: LCOV version 1.14