LCOV - code coverage report
Current view: top level - test - proactor_filters.c (source / functions) Hit Total Coverage
Test: all.info Lines: 20 20 100.0 %
Date: 2012-09-24 Functions: 4 4 100.0 %
Branches: 4 8 50.0 %

           Branch data     Line data    Source code
       1                 :            : 
       2                 :            : #include "gwrl/proactor.h"
       3                 :            : 
       4                 :         21 : void filter(gwpr * pr, gwpr_io_info * info){}
       5                 :         21 : void filter2(gwpr * pr, gwpr_io_info * info){}
       6                 :         21 : void filter3(gwpr * pr, gwpr_io_info * info){}
       7                 :            : 
       8                 :         21 : int main(int argc, char ** argv) {
       9                 :         21 :         gwrl * rl = gwrl_create();
      10                 :         21 :         gwpr * pr = gwpr_create(rl);
      11                 :         21 :         gwrlsrc_file * src1 = _gwrlsrcf(gwrl_src_file_create(0,0,NULL,NULL));
      12                 :            :         
      13                 :            :         if(GWPR_FILTERS_MAX < 2) {
      14                 :            :                 printf("error: GWPR_FILTERS_MAX must be at least 2 for this test.\n");
      15                 :            :                 return -1;
      16                 :            :         }
      17                 :            : 
      18                 :         21 :         gwpr_src_add(pr,src1);
      19                 :         21 :         gwpr_filter_add(pr,src1,gwpr_rdfilter_id,&filter);
      20                 :         21 :         assert(((gwprdata *)src1->pdata)->rdfilters != NULL);
      21         [ -  + ]:         21 :         assert(((gwprdata *)src1->pdata)->rdfilters[0] == &filter);
      22                 :            :         
      23                 :         21 :         gwpr_filter_add(pr,src1,gwpr_rdfilter_id,&filter2);
      24         [ -  + ]:         21 :         assert(_gwprdata(src1->pdata)->rdfilters != NULL);
      25         [ -  + ]:         21 :         assert(_gwprdata(src1->pdata)->rdfilters[1] == &filter2);
      26                 :            :         
      27                 :         21 :         gwpr_filter_reset(pr,src1,gwpr_rdfilter_id);
      28         [ -  + ]:         21 :         assert(((gwprdata *)src1->pdata)->rdfilters[0] == NULL);
      29                 :            : 
      30                 :         21 :         filter(NULL,NULL);
      31                 :         21 :         filter2(NULL,NULL);
      32                 :         21 :         filter3(NULL,NULL);
      33                 :            : 
      34                 :         21 :         return 0;
      35                 :            : }

Generated by: LCOV version 1.9