LCOV - code coverage report
Current view: top level - src/odbc/unittests - norowset.c (source / functions) Hit Total Coverage
Test: FreeTDS coverage Lines: 14 16 87.5 %
Date: 2025-01-18 12:13:41 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include "common.h"
       2             : 
       3             : static char software_version[] = "$Id: norowset.c,v 1.9 2010-07-05 09:20:33 freddy77 Exp $";
       4             : static void *no_unused_var_warn[] = { software_version, no_unused_var_warn };
       5             : 
       6             : /* Test that a select following a store procedure execution return results */
       7             : 
       8             : int
       9           8 : main(int argc, char *argv[])
      10             : {
      11             :         char output[256];
      12             :         SQLLEN dataSize;
      13             : 
      14           8 :         odbc_connect();
      15             : 
      16           8 :         odbc_command_with_result(odbc_stmt, "drop proc sp_norowset_test");
      17             : 
      18           8 :         odbc_command("create proc sp_norowset_test as begin declare @i int end");
      19             : 
      20           8 :         odbc_command("exec sp_norowset_test");
      21             : 
      22             :         /* note, mssql 2005 seems to not return row for tempdb, use always master */
      23           8 :         odbc_command("select name from master..sysobjects where name = 'sysobjects'");
      24           8 :         CHKFetch("S");
      25             : 
      26           8 :         CHKGetData(1, SQL_C_CHAR, output, sizeof(output), &dataSize, "S");
      27             : 
      28           8 :         if (strcmp(output, "sysobjects") != 0) {
      29           0 :                 printf("Unexpected result\n");
      30           0 :                 exit(1);
      31             :         }
      32             : 
      33           8 :         CHKFetch("No");
      34             : 
      35           8 :         CHKMoreResults("No");
      36             : 
      37           8 :         odbc_command("drop proc sp_norowset_test");
      38             : 
      39           8 :         odbc_disconnect();
      40             : 
      41           8 :         printf("Done.\n");
      42             :         return 0;
      43             : }

Generated by: LCOV version 1.13