adding test scripts
[csql.git] / test / sqlapi / Csql / Connect / closetwicewithoutconnect.c
blobb80ad64898c225813ccf788acf33e315c246a9ae
1 /*
2 closing the connection twice with single connect.
3 second close should fail because of connection is already closed.
4 */
6 #include"common.h"
8 int main()
10 DbRetVal rv = OK;
11 AbsSqlConnection *con = createConnection();
12 rv = con->connect("root","manager");
13 if(rv !=OK) {
14 delete con;
15 return 1;
17 printf("Connection Opened\n");
18 //Closing Connection.
19 rv = con->disconnect();
20 if(rv !=OK) {
21 delete con;
22 return 2;
24 printf("Connection Closed\n");
25 //Closing Connection without connect.
26 rv = con->disconnect();
27 if(rv ==OK) {
28 delete con;
29 printf("Test script Failed\n");
30 return 3;
32 printf("Closing Connection without connect failed");
33 delete con;
34 printf("Test Script Passed\n");
35 return 0;