From 385f6f23fee37617e0148babdb00783775d04a70 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Mon, 11 Jun 2018 21:39:55 +0200 Subject: Initial port of PostgreSQL egg to CHICKEN 5 --- feature-tests/connectdb-params.c | 7 +++++++ feature-tests/diag-query-position.c | 7 +++++++ feature-tests/diag-schema-info.c | 10 ++++++++++ feature-tests/escape-identifier.c | 6 ++++++ 4 files changed, 30 insertions(+) create mode 100644 feature-tests/connectdb-params.c create mode 100644 feature-tests/diag-query-position.c create mode 100644 feature-tests/diag-schema-info.c create mode 100644 feature-tests/escape-identifier.c (limited to 'feature-tests') diff --git a/feature-tests/connectdb-params.c b/feature-tests/connectdb-params.c new file mode 100644 index 0000000..d79a2e0 --- /dev/null +++ b/feature-tests/connectdb-params.c @@ -0,0 +1,7 @@ +#include +int main(void) +{ + const char *kw[] = {"a", NULL}; + const char *val[] = {"b", NULL}; + return PQconnectdbParams(kw, val, 0) != NULL; +} diff --git a/feature-tests/diag-query-position.c b/feature-tests/diag-query-position.c new file mode 100644 index 0000000..8feb629 --- /dev/null +++ b/feature-tests/diag-query-position.c @@ -0,0 +1,7 @@ +#include +int main(void) +{ + int foo = PG_DIAG_INTERNAL_QUERY; + int bar = PG_DIAG_INTERNAL_POSITION; + return foo + bar; +} diff --git a/feature-tests/diag-schema-info.c b/feature-tests/diag-schema-info.c new file mode 100644 index 0000000..e64e990 --- /dev/null +++ b/feature-tests/diag-schema-info.c @@ -0,0 +1,10 @@ +#include +int main(void) +{ + int s = PG_DIAG_SCHEMA_NAME; + int t = PG_DIAG_TABLE_NAME; + int col = PG_DIAG_COLUMN_NAME; + int d = PG_DIAG_DATATYPE_NAME; + int con = PG_DIAG_CONSTRAINT_NAME; + return s + t + col + d + con; +} diff --git a/feature-tests/escape-identifier.c b/feature-tests/escape-identifier.c new file mode 100644 index 0000000..8188cbf --- /dev/null +++ b/feature-tests/escape-identifier.c @@ -0,0 +1,6 @@ +#include +int main(void) +{ + PGconn *conn = NULL; /* Bork */ + return PQescapeIdentifier(conn, "test", 4) != NULL; +} -- cgit v1.2.3