clibs / cmocka

An elegant unit testing framework for C with support for mock objects.
Apache License 2.0
232 stars 55 forks source link

Executing cmocka unit tests on Oracle Proc*C code #15

Closed vasu5235 closed 2 years ago

vasu5235 commented 5 years ago

Is it possible to run unit tests on *Oracle ProC code**?

If it is possible,

I tried googling this with no results.

For example, creating a simple database connection and returning via cn.pc file as follows:

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<sqlca.h>

char *p="username/password@SID";

void main()
{  
    EXEC SQL CONNECT :p;

    if(sqlca.sqlcode==0)
    {  
       printf("Database connection successful to %s",p);
    }
    else
    {   printf("\n connection to  %s   failed ",p);
    }

}

How should a test_cn.cfile be coded for this?