LCOV - code coverage report
Current view: top level - home/mbr/git/openssl.git/test - md2test.c (source / functions) Hit Total Coverage
Test: lcov_coverage_final.info Lines: 20 21 95.2 %
Date: 2014-08-02 Functions: 1 1 100.0 %
Branches: 11 20 55.0 %

           Branch data     Line data    Source code
       1                 :            : #include <stdio.h>
       2                 :            : #include <stdlib.h>
       3                 :            : #include <string.h>
       4                 :            : #include <ctype.h>
       5                 :            : #include <openssl/crypto.h>
       6                 :            : #include <openssl/e_os2.h>
       7                 :            : #include <openssl/buffer.h>
       8                 :            : 
       9                 :          1 : int main(int argc, char *argv[])
      10                 :            :         {
      11                 :          1 :         char *p, *q = 0, *program;
      12                 :            : 
      13                 :          1 :         p = strrchr(argv[0], '/');
      14         [ -  + ]:          1 :         if (!p) p = strrchr(argv[0], '\\');
      15                 :            : #ifdef OPENSSL_SYS_VMS
      16                 :            :         if (!p) p = strrchr(argv[0], ']');
      17                 :            :         if (p) q = strrchr(p, '>');
      18                 :            :         if (q) p = q;
      19                 :            :         if (!p) p = strrchr(argv[0], ':');
      20                 :            :         q = 0;
      21                 :            : #endif
      22         [ +  - ]:          1 :         if (p) p++;
      23         [ -  + ]:          1 :         if (!p) p = argv[0];
      24         [ +  - ]:          1 :         if (p) q = strchr(p, '.');
      25         [ +  - ]:          1 :         if (p && !q) q = p + strlen(p);
      26                 :            : 
      27         [ -  + ]:          1 :         if (!p)
      28                 :          0 :                 program = BUF_strdup("(unknown)");
      29                 :            :         else
      30                 :            :                 {
      31                 :          1 :                 program = OPENSSL_malloc((q - p) + 1);
      32                 :          1 :                 strncpy(program, p, q - p);
      33                 :          1 :                 program[q - p] = '\0';
      34                 :            :                 }
      35                 :            : 
      36         [ +  + ]:          8 :         for(p = program; *p; p++)
      37         [ +  + ]:          7 :                 if (islower((unsigned char)(*p)))
      38                 :          6 :                         *p = toupper((unsigned char)(*p));
      39                 :            : 
      40                 :          1 :         q = strstr(program, "TEST");
      41 [ -  + ][ #  # ]:          1 :         if (q > p && q[-1] == '_') q--;
      42                 :          1 :         *q = '\0';
      43                 :            : 
      44                 :            :         printf("No %s support\n", program);
      45                 :            : 
      46                 :          1 :         OPENSSL_free(program);
      47                 :          1 :         return(0);
      48                 :            :         }

Generated by: LCOV version 1.9