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