LCOV - code coverage report
Current view: top level - src/ctlib/unittests - t0001.c (source / functions) Hit Total Coverage
Test: FreeTDS coverage Lines: 7 11 63.6 %
Date: 2024-03-23 09:12:27 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include <config.h>
       2             : 
       3             : #include <stdio.h>
       4             : #include <ctpublic.h>
       5             : #include "common.h"
       6             : 
       7             : int
       8           8 : main(int argc, char **argv)
       9             : {
      10             :         CS_CONTEXT *ctx;
      11             :         CS_CONNECTION *conn;
      12             :         CS_COMMAND *cmd;
      13             :         CS_RETCODE ret;
      14           8 :         int verbose = 0;
      15             : 
      16           8 :         printf("%s: Testing login, logout\n", __FILE__);
      17             :         if (verbose) {
      18             :                 printf("Trying login\n");
      19             :         }
      20           8 :         ret = try_ctlogin(&ctx, &conn, &cmd, verbose);
      21           8 :         if (ret != CS_SUCCEED) {
      22           0 :                 fprintf(stderr, "Login failed\n");
      23           0 :                 return 1;
      24             :         }
      25             : 
      26             :         if (verbose) {
      27             :                 printf("Trying logout\n");
      28             :         }
      29           8 :         ret = try_ctlogout(ctx, conn, cmd, verbose);
      30           8 :         if (ret != CS_SUCCEED) {
      31           0 :                 fprintf(stderr, "Logout failed\n");
      32           0 :                 return 2;
      33             :         }
      34             : 
      35             :         if (verbose) {
      36             :                 printf("Test succeeded\n");
      37             :         }
      38             :         return 0;
      39             : }

Generated by: LCOV version 1.13