title: Is there a possibility of unit testing database functions using cmocka?
body: <p>I am trying to make some unit tests for database functions in C language, but i am not aware is it possible with cmocka?
  I couldn't find any example on the internet for database testing using cmocka, so i wonder if someone has an example of testing database functions with cmocka. For example it could be connecting to database, reading from database, writing to database, updating database, any example would help.</p>
  <p><strong>EDIT</strong>
  Let's say i have the following function in a separate Base.c file:</p>
  <pre><code>static  void    dbclose(int SQLnumber)
      {
  
      if (hDbc[SQLnumber])
          {
          SQLDisconnect(hDbc[SQLnumber]);
          SQLFreeConnect(hDbc[SQLnumber]);
          }
  
      hDbc[SQLnumber] = NULL;
      }
  </code></pre>
  <p>How to define the wrap method in CMakeLists.txt so i could use it in Tests.c file?
  Also, is it possible to wrap the SQLDisconnect and SQLFreeConnect from the SQL API separately?</p>