Skip to content

Commit

Permalink
cleaner LogPtr
Browse files Browse the repository at this point in the history
and less whitespace
  • Loading branch information
mpgerlek committed May 12, 2015
1 parent 37762a8 commit 02977f1
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions plugins/sqlite/test/SQLiteTest.cpp
Expand Up @@ -163,13 +163,13 @@ TEST(SQLiteTest, readWriteCompressScale)

TEST(SQLiteTest, Issue895)
{
LogPtr log = std::shared_ptr<pdal::Log>(new pdal::Log("Issue895", "stdout"));
LogPtr log(new pdal::Log("Issue895", "stdout"));
log->setLevel(LogLevel::Debug);

const std::string filename(Support::temppath("issue895.sqlite"));

FileUtils::deleteFile(filename);

bool ok;
const char* sql;

Expand All @@ -187,11 +187,11 @@ TEST(SQLiteTest, Issue895)
db.connect(false);
sql = "SELECT name FROM sqlite_master WHERE type = \"table\"";
db.query(sql);
// because order of the returned rows is undefined

// because order of the returned rows is undefined
bool foundMine = false;
bool foundTheirs = false;

{
const row* r = db.get();
column const& c = r->at(0);
Expand All @@ -200,7 +200,7 @@ TEST(SQLiteTest, Issue895)
foundTheirs = (strcmp(c.data.c_str(), "sqlite_sequence") == 0);
//printf("%s %d %d\n", c.data.c_str(), (int)foundMine, (int)foundTheirs);
EXPECT_TRUE(foundMine || foundTheirs);
}
}

ok = db.next();
EXPECT_TRUE(ok);
Expand All @@ -213,11 +213,11 @@ TEST(SQLiteTest, Issue895)
//printf("%s %d %d\n", c.data.c_str(), (int)foundMine, (int)foundTheirs);
EXPECT_TRUE(foundMine && foundTheirs);
}

ok = db.next();
EXPECT_FALSE(ok);
}

// open the DB, ask if the tables exist
{
SQLite db(filename, LogPtr(log));
Expand All @@ -234,13 +234,13 @@ TEST(SQLiteTest, Issue895)

TEST(SQLiteTest, testSpatialite)
{
LogPtr log = std::shared_ptr<pdal::Log>(new pdal::Log("spat", "stdout"));
LogPtr log(new pdal::Log("spat", "stdout"));
log->setLevel(LogLevel::Debug);

const std::string filename(Support::temppath("spat.sqlite"));

FileUtils::deleteFile(filename);

SQLite db(filename, LogPtr(log));
db.connect(true);

Expand All @@ -250,7 +250,7 @@ TEST(SQLiteTest, testSpatialite)
db.initSpatialiteMetadata();

EXPECT_TRUE(db.haveSpatialite());

FileUtils::deleteFile(filename);
}

Expand All @@ -261,13 +261,13 @@ TEST(SQLiteTest, testVersionInfo)
log->setLevel(LogLevel::Debug);

const std::string filename(Support::temppath("spver.sqlite"));

FileUtils::deleteFile(filename);

SQLite db(filename, LogPtr(log));
db.connect(true);
db.loadSpatialite();

const std::string p = db.getSQLiteVersion();
EXPECT_EQ(p[0], '3'); // 3.8.9 as of this commit

Expand Down

0 comments on commit 02977f1

Please sign in to comment.