LCOV - code coverage report
Current view: top level - tests - utf8-test.c (source / functions) Hit Total Coverage
Test: lcov.out Lines: 12 12 100.0 %
Date: 2012-07-17 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 5 10 50.0 %

           Branch data     Line data    Source code
       1                 :            : #include <stdio.h>
       2                 :            : #include <assert.h>
       3                 :            : 
       4                 :            : #include <pulse/utf8.h>
       5                 :            : #include <pulse/xmalloc.h>
       6                 :            : 
       7                 :          1 : int main(int argc, char *argv[]) {
       8                 :            :     char *c;
       9                 :            : 
      10         [ -  + ]:          1 :     assert(pa_utf8_valid("hallo"));
      11         [ -  + ]:          1 :     assert(pa_utf8_valid("hallo\n"));
      12         [ -  + ]:          1 :     assert(!pa_utf8_valid("hüpfburg\n"));
      13         [ -  + ]:          1 :     assert(pa_utf8_valid("hallo\n"));
      14         [ -  + ]:          1 :     assert(pa_utf8_valid("hüpfburg\n"));
      15                 :            : 
      16                 :          1 :     fprintf(stderr, "LATIN1: %s\n", c = pa_utf8_filter("hüpfburg"));
      17                 :          1 :     pa_xfree(c);
      18                 :          1 :     fprintf(stderr, "UTF8: %sx\n", c = pa_utf8_filter("hüpfburg"));
      19                 :          1 :     pa_xfree(c);
      20                 :          1 :     fprintf(stderr, "LATIN1: %sx\n", c = pa_utf8_filter("üxknärzmörzeltörszß³§dsjkfh"));
      21                 :          1 :     pa_xfree(c);
      22                 :            : 
      23                 :            :     return 0;
      24                 :            : }

Generated by: LCOV version 1.9