13 #include <libfossdb.h>
21 #include <CUnit/CUnit.h>
24 #define COMMIT_HASH "COMMIT_HASH Unknown"
40 int nonexistant_table;
47 CU_ASSERT_PTR_NOT_NULL(
pgConn);
50 CU_ASSERT_FALSE(nonexistant_table);
52 PGresult* result = PQexec(
pgConn,
"CREATE table exists()");
53 CU_ASSERT_PTR_NOT_NULL_FATAL(result);
57 CU_ASSERT_TRUE(existing_table);
67 CU_TestInfo libfossdb_testcases[] =
PGconn * pgConn
Database connection.
PGconn * fo_dbconnect(char *DBConfFile, char **ErrorBuf)
Connect to a database. The default is Db.conf.
int fo_tableExists(PGconn *pgConn, const char *tableName)
Check if table exists. Note, this assumes the database name is 'fossology'.
int fo_checkPQcommand(PGconn *pgConn, PGresult *result, char *sql, char *FileID, int LineNumb)
Check the result status of a postgres commands (not select) If an error occured, write the error to s...
char * DBConfFile
DB conf file location.
void test_fo_tableExists()
fo_tableExists() tests