Line data Source code
1 : #include "common.h"
2 :
3 : int
4 10 : main(void)
5 : {
6 : CS_CONTEXT *ctx;
7 : CS_CONNECTION *conn;
8 10 : int ret = 1;
9 :
10 10 : read_login_info();
11 :
12 10 : check_call(cs_ctx_alloc, (CS_VERSION_100, &ctx));
13 10 : check_call(ct_init, (ctx, CS_VERSION_100));
14 10 : check_call(ct_con_alloc, (ctx, &conn));
15 10 : check_call(ct_con_props, (conn, CS_SET, CS_USERNAME, (CS_VOID*) "sa", CS_NULLTERM, NULL));
16 10 : check_call(ct_con_props, (conn, CS_SET, CS_PASSWORD, (CS_VOID*) "invalid", CS_NULLTERM, NULL));
17 10 : if (ct_connect(conn, SERVER, CS_NULLTERM) != CS_FAIL) {
18 0 : fprintf(stderr, "Connection succeeded??\n");
19 0 : return ret;
20 : }
21 :
22 10 : check_call(ct_cancel, (conn, NULL, CS_CANCEL_ALL));
23 10 : check_call(ct_close, (conn, CS_UNUSED));
24 10 : check_call(ct_con_drop, (conn));
25 10 : check_call(ct_exit, (ctx, CS_UNUSED));
26 10 : check_call(cs_ctx_drop,(ctx));
27 :
28 10 : printf("Test succeeded\n");
29 10 : return 0;
30 : }
|