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: 2024-04-18 20:40:06 Functions: 1 1 100.0 %

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

Generated by: LCOV version 1.13