From 02977f10f6a043e4fbec0a0a8f593d6ed60fad14 Mon Sep 17 00:00:00 2001 From: "Michael P. Gerlek" Date: Tue, 12 May 2015 17:17:43 -0400 Subject: [PATCH] cleaner LogPtr and less whitespace --- plugins/sqlite/test/SQLiteTest.cpp | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/sqlite/test/SQLiteTest.cpp b/plugins/sqlite/test/SQLiteTest.cpp index a622fd15ce..cc730b9708 100644 --- a/plugins/sqlite/test/SQLiteTest.cpp +++ b/plugins/sqlite/test/SQLiteTest.cpp @@ -163,13 +163,13 @@ TEST(SQLiteTest, readWriteCompressScale) TEST(SQLiteTest, Issue895) { - LogPtr log = std::shared_ptr(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; @@ -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); @@ -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); @@ -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)); @@ -234,13 +234,13 @@ TEST(SQLiteTest, Issue895) TEST(SQLiteTest, testSpatialite) { - LogPtr log = std::shared_ptr(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); @@ -250,7 +250,7 @@ TEST(SQLiteTest, testSpatialite) db.initSpatialiteMetadata(); EXPECT_TRUE(db.haveSpatialite()); - + FileUtils::deleteFile(filename); } @@ -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