MCPcopy Create free account
hub / github.com/PDAL/PDAL / SetUp

Method SetUp

plugins/pgpointcloud/test/PgpointcloudTest.cpp:97–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 m_bSkipTests(false) {};
96protected:
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 {

Callers

nothing calls this directly

Calls 4

getMasterDBConnFunction · 0.85
pg_connectFunction · 0.85
getTestDBTempConnFunction · 0.85
strMethod · 0.80

Tested by

no test coverage detected