LCOV - code coverage report
Current view: top level - src/backend/snowball/libstemmer - api.c (source / functions) Coverage Total Hit
Test: PostgreSQL 20devel Lines: 64.7 % 17 11
Test Date: 2026-07-03 19:57:34 Functions: 66.7 % 3 2
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
Branches: 25.0 % 8 2

             Branch data     Line data    Source code
       1                 :             : #include "snowball_runtime.h"
       2                 :             : 
       3                 :             : static const struct SN_env default_SN_env;
       4                 :             : 
       5                 :          29 : extern struct SN_env * SN_new_env(int alloc_size)
       6                 :             : {
       7                 :          29 :     struct SN_env * z = (struct SN_env *) malloc(alloc_size);
       8         [ -  + ]:          29 :     if (z == NULL) return NULL;
       9                 :          29 :     *z = default_SN_env;
      10                 :          29 :     z->p = create_s();
      11         [ -  + ]:          29 :     if (z->p == NULL) {
      12                 :           0 :         SN_delete_env(z);
      13                 :           0 :         return NULL;
      14                 :             :     }
      15                 :          29 :     return z;
      16                 :             : }
      17                 :             : 
      18                 :           0 : extern void SN_delete_env(struct SN_env * z)
      19                 :             : {
      20         [ #  # ]:           0 :     if (z == NULL) return;
      21         [ #  # ]:           0 :     if (z->p) lose_s(z->p);
      22                 :           0 :     free(z);
      23                 :             : }
      24                 :             : 
      25                 :        5562 : extern int SN_set_current(struct SN_env * z, int size, const symbol * s)
      26                 :             : {
      27                 :        5562 :     int err = replace_s(z, 0, z->l, size, s);
      28                 :        5562 :     z->c = 0;
      29                 :        5562 :     return err;
      30                 :             : }
        

Generated by: LCOV version 2.0-1