src/server/plugins/postgresql/pgtest.c

changeset 664
9b1066313c17
parent 660
f00d03835dd9
equal deleted inserted replaced
663:bd116bd44926 664:9b1066313c17
48 #define xstreq(a,b) xmlStrEqual(BAD_CAST a, BAD_CAST b) 48 #define xstreq(a,b) xmlStrEqual(BAD_CAST a, BAD_CAST b)
49 49
50 #define MAP_GET(map, key) cxMapGet(map, cx_hash_key_str(key)) 50 #define MAP_GET(map, key) cxMapGet(map, cx_hash_key_str(key))
51 #define MAP_PUT(map, key, value) cxMapPut(map, cx_hash_key_str(key), value) 51 #define MAP_PUT(map, key, value) cxMapPut(map, cx_hash_key_str(key), value)
52 52
53 static char *pg_connstr = "postgresql://localhost/test1"; 53 static char *pg_connstr = "dbname=test1";
54 static int abort_pg_tests = 0; 54 static int abort_pg_tests = 0;
55 static PGconn *test_connection; 55 static PGconn *test_connection;
56 static ResourceData resdata; 56 static ResourceData resdata;
57 static PgRepository test_repo; 57 static PgRepository test_repo;
58 58
87 test_connection = PQconnectdb(pg_connstr); 87 test_connection = PQconnectdb(pg_connstr);
88 if(!test_connection) { 88 if(!test_connection) {
89 abort_pg_tests = 1; 89 abort_pg_tests = 1;
90 } 90 }
91 91
92 if(PQstatus(test_connection) != CONNECTION_OK) { 92 ConnStatusType status = PQstatus(test_connection);
93 if(status != CONNECTION_OK) {
93 abort_pg_tests = 1; 94 abort_pg_tests = 1;
94 } 95 }
95 96
96 resdata.data = test_connection; 97 resdata.data = test_connection;
97 test_root_lookup(); 98 test_root_lookup();

mercurial