LCOV - code coverage report
Current view: top level - src/odbc/unittests - wchar.c (source / functions) Hit Total Coverage
Test: FreeTDS coverage Lines: 12 15 80.0 %
Date: 2026-07-19 14:02:14 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include "common.h"
       2             : 
       3             : /* test SQL_C_DEFAULT with NCHAR type */
       4             : 
       5          10 : TEST_MAIN()
       6             : {
       7             :         char buf[102];
       8             :         SQLLEN ind;
       9          10 :         bool failed = false;
      10             : 
      11          10 :         odbc_connect();
      12             : 
      13          10 :         CHKBindCol(1, SQL_C_DEFAULT, buf, 100, &ind, "S");
      14          10 :         odbc_command("SELECT CONVERT(NCHAR(10), 'Pippo 123')");
      15             : 
      16             :         /* get data */
      17          10 :         memset(buf, 0, sizeof(buf));
      18          10 :         CHKFetch("S");
      19             : 
      20          10 :         SQLMoreResults(odbc_stmt);
      21          10 :         SQLMoreResults(odbc_stmt);
      22             : 
      23          10 :         odbc_disconnect();
      24             : 
      25             :         /* the second string could came from Sybase configured with UTF-8 */
      26          10 :         if (strcmp(buf, "Pippo 123 ") != 0
      27           0 :             && (odbc_db_is_microsoft() || strcmp(buf, "Pippo 123                     ") != 0)) {
      28           0 :                 fprintf(stderr, "Wrong results '%s'\n", buf);
      29           0 :                 failed = true;
      30             :         }
      31             : 
      32          10 :         return failed ? 1 : 0;
      33             : }
      34             : 

Generated by: LCOV version 1.13