| 95 | m_bSkipTests(false) {}; |
| 96 | protected: |
| 97 | virtual void SetUp() |
| 98 | { |
| 99 | std::string connstr = getMasterDBConn(); |
| 100 | m_masterConnection = pg_connect( connstr ); |
| 101 | m_testConnection = NULL; |
| 102 | |
| 103 | // Silence those pesky notices |
| 104 | executeOnMasterDb("SET client_min_messages TO WARNING"); |
| 105 | |
| 106 | dropTestDb(); |
| 107 | |
| 108 | std::stringstream createDbSql; |
| 109 | createDbSql << "CREATE DATABASE " << |
| 110 | testDbTempname << " TEMPLATE template0"; |
| 111 | try |
| 112 | { |
| 113 | executeOnMasterDb(createDbSql.str()); |
| 114 | } |
| 115 | catch( const pdal_error& ) |
| 116 | { |
| 117 | m_bSkipTests = true; |
| 118 | return; |
| 119 | } |
| 120 | |
| 121 | m_testConnection = pg_connect( getTestDBTempConn() ); |
| 122 | |
| 123 | try |
| 124 | { |
| 125 | executeOnTestDb("CREATE EXTENSION pointcloud"); |
| 126 | } |
| 127 | catch( const pdal_error& ) |
| 128 | { |
| 129 | m_bSkipTests = true; |
| 130 | return; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | void executeOnTestDb(const std::string& sql) |
| 135 | { |
nothing calls this directly
no test coverage detected