LCOV - code coverage report
Current view: top level - data/source/set - data_stat.c (source / functions) Hit Total Coverage
Test: crystal-facet-uml_v1.57.0_covts Lines: 16 16 100.0 %
Date: 2024-04-07 11:14:42 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /* File: data_stat.c; Copyright and License: see below */
       2             : 
       3             : #include "set/data_stat.h"
       4             : #include "u8/u8_trace.h"
       5             : #include <assert.h>
       6             : 
       7             : /*! human readable list of stat-categories for trace output */
       8             : static const char *const ( data_stat_private_series[(int)DATA_STAT_SERIES_MAX] )
       9             :     = { "CREX", "MODI", "DELE", "IGNO", "WARN", "ERR_" };
      10             : 
      11           1 : void data_stat_trace ( const data_stat_t *this_ )
      12             : {
      13           1 :     U8_TRACE_BEGIN();
      14           1 :     U8_TRACE_INFO( "                   l C F R E D" );
      15           7 :     for ( int series_idx = 0; series_idx < DATA_STAT_SERIES_MAX; series_idx ++ )
      16             :     {
      17           6 :         const char prefix[] = "data_stat_t[";
      18           6 :         const char infix1[] = "]: ";
      19             :         char stat_buf[sizeof(prefix)-1+4+sizeof(infix1)-1+3+5*DATA_STAT_TABLE_MAX];
      20           6 :         utf8stringbuf_t stat_str = UTF8STRINGBUF( stat_buf );
      21           6 :         utf8stringbuf_copy_str( stat_str, prefix );
      22           6 :         utf8stringbuf_append_str( stat_str, data_stat_private_series[series_idx] );
      23           6 :         utf8stringbuf_append_str( stat_str, infix1 );
      24             : 
      25          42 :         for ( int tables_idx = 0; tables_idx < DATA_STAT_TABLE_MAX; tables_idx ++ )
      26             :         {
      27          36 :             utf8stringbuf_append_str( stat_str, (tables_idx==0)?"":"," );
      28          36 :             utf8stringbuf_append_int( stat_str, (*this_).data[tables_idx][series_idx] );
      29             :         }
      30           6 :         U8_TRACE_INFO( utf8stringbuf_get_string( stat_str ) );
      31             :     }
      32           1 :     U8_TRACE_END();
      33           1 : }
      34             : 
      35             : 
      36             : /*
      37             : Copyright 2020-2024 Andreas Warnke
      38             : 
      39             : Licensed under the Apache License, Version 2.0 (the "License");
      40             : you may not use this file except in compliance with the License.
      41             : You may obtain a copy of the License at
      42             : 
      43             :     http://www.apache.org/licenses/LICENSE-2.0
      44             : 
      45             : Unless required by applicable law or agreed to in writing, software
      46             : distributed under the License is distributed on an "AS IS" BASIS,
      47             : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      48             : See the License for the specific language governing permissions and
      49             : limitations under the License.
      50             : */

Generated by: LCOV version 1.16