[Liblas-commits] hg-main-tree: only run OCI test if you give a connection string ...

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Apr 13 14:28:57 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/a1448c371ec4
changeset: 555:a1448c371ec4
user:      Howard Butler <hobu.inc at gmail.com>
date:      Wed Apr 13 13:28:49 2011 -0500
description:
only run OCI test if you give a connection string via command line argument

diffstat:

 test/unit/OCITest.cpp |  14 +++++++++++++-
 test/unit/support.cpp |   2 +-
 2 files changed, 14 insertions(+), 2 deletions(-)

diffs (66 lines):

diff -r ecdf00941504 -r a1448c371ec4 test/unit/OCITest.cpp
--- a/test/unit/OCITest.cpp	Wed Apr 13 10:58:09 2011 -0700
+++ b/test/unit/OCITest.cpp	Wed Apr 13 13:28:49 2011 -0500
@@ -55,6 +55,11 @@
 
 using namespace libpc::drivers::oci;
 
+bool ShouldRunTest()
+{
+    return TestConfig::g_oracle_connection.size() > 0;
+}
+
 Options GetOptions()
 {
     Options options;
@@ -87,6 +92,8 @@
 
 BOOST_AUTO_TEST_CASE(initialize)
 {
+    if (!ShouldRunTest()) return;
+    
     Options options = GetOptions();
     
     Connection connection = Connect(options);
@@ -103,6 +110,8 @@
 
 BOOST_AUTO_TEST_CASE(test_writer)
 {
+    if (!ShouldRunTest()) return;
+
     Options options = GetOptions();
     libpc::drivers::liblas::LiblasReader reader(TestConfig::g_data_path +  "1.2-with-color.las");
 
@@ -119,9 +128,10 @@
 
 BOOST_AUTO_TEST_CASE(test_reader)
 {
+    if (!ShouldRunTest()) return;
+
     Options options = GetOptions();
 
-
     libpc::drivers::oci::Reader reader(options);
     const boost::uint64_t numPoints = reader.getNumPoints();
 
@@ -133,6 +143,8 @@
 
 BOOST_AUTO_TEST_CASE(clean_up)
 {
+    if (!ShouldRunTest()) return;
+    
     libpc::drivers::oci::Options options = GetOptions();
     
     Connection connection = Connect(options);
diff -r ecdf00941504 -r a1448c371ec4 test/unit/support.cpp
--- a/test/unit/support.cpp	Wed Apr 13 10:58:09 2011 -0700
+++ b/test/unit/support.cpp	Wed Apr 13 13:28:49 2011 -0500
@@ -89,7 +89,7 @@
 }
 
 std::string TestConfig::g_data_path = "../../test/data";
-std::string TestConfig::g_oracle_connection = "lidar/lidar at oracle.hobu.biz/orcl";
+std::string TestConfig::g_oracle_connection = "";
 TestConfig::TestConfig()
 {
     int argc = ::boost::unit_test::framework::master_test_suite().argc;


More information about the Liblas-commits mailing list