[Liblas-commits] hg-main-tree: make test dir work for win32

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Mar 17 14:00:20 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/2ef6f89b7659
changeset: 338:2ef6f89b7659
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Thu Mar 17 13:59:57 2011 -0400
description:
make test dir work for win32
Subject: hg-main-tree: merge

details:   http://hg.libpc.orghg-main-tree/rev/a0f0ac25b68c
changeset: 339:a0f0ac25b68c
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Thu Mar 17 14:00:17 2011 -0400
description:
merge

diffstat:

 src/Chipper.cpp               |  1 +
 src/drivers/las/Reader.cpp    |  7 +++++--
 src/drivers/liblas/Reader.cpp |  5 +++--
 src/drivers/oci/Writer.cpp    |  2 +-
 test/unit/CMakeLists.txt      |  2 +-
 test/unit/support.cpp         |  2 +-
 6 files changed, 12 insertions(+), 7 deletions(-)

diffs (98 lines):

diff -r 9821c483080e -r a0f0ac25b68c src/Chipper.cpp
--- a/src/Chipper.cpp	Thu Mar 17 13:26:18 2011 -0400
+++ b/src/Chipper.cpp	Thu Mar 17 14:00:17 2011 -0400
@@ -139,6 +139,7 @@
         const Bounds<double>& bounds = Bounds<double>::getDefaultSpatialExtent();
         boost::uint32_t num_read =  m_stage.read(buffer, bounds);
         
+        if (num_read == 0) break;
         assert(num_read <= num_to_read);
 
         for (boost::uint32_t j = 0; j < m_threshold; j++)
diff -r 9821c483080e -r a0f0ac25b68c src/drivers/las/Reader.cpp
--- a/src/drivers/las/Reader.cpp	Thu Mar 17 13:26:18 2011 -0400
+++ b/src/drivers/las/Reader.cpp	Thu Mar 17 14:00:17 2011 -0400
@@ -91,7 +91,7 @@
 
 boost::uint32_t LasReader::readBuffer(PointData& pointData, const Bounds<double>&)
 {
-    boost::uint32_t numPoints = pointData.getNumPoints();
+    boost::uint32_t numPoints = pointData.getCapacity();
 
     const LasHeader& lasHeader = getLasHeader();
     const SchemaLayout& schemaLayout = pointData.getSchemaLayout();
@@ -238,12 +238,15 @@
             pointData.setField<boost::uint16_t>(pointIndex, fieldIndexRed, red);
             pointData.setField<boost::uint16_t>(pointIndex, fieldIndexGreen, green);
             pointData.setField<boost::uint16_t>(pointIndex, fieldIndexBlue, blue);
-
+            
         }
+        
         else
         {
             throw;
         }
+        pointData.setNumPoints(pointIndex+1);
+        
     }
 
     return numPoints;
diff -r 9821c483080e -r a0f0ac25b68c src/drivers/liblas/Reader.cpp
--- a/src/drivers/liblas/Reader.cpp	Thu Mar 17 13:26:18 2011 -0400
+++ b/src/drivers/liblas/Reader.cpp	Thu Mar 17 14:00:17 2011 -0400
@@ -235,7 +235,7 @@
 
 boost::uint32_t LiblasReader::readBuffer(PointData& pointData, const Bounds<double>&)
 {
-    boost::uint32_t numPoints = pointData.getNumPoints();
+    boost::uint32_t numPoints = pointData.getCapacity();
     boost::uint32_t i = 0;
 
     const Schema& schema = pointData.getSchema();
@@ -323,7 +323,8 @@
             pointData.setField(i, indexGreen, green);
             pointData.setField(i, indexBlue, blue);
         }
-
+        
+        pointData.setNumPoints(i+1);
         if (m_hasWaveData)
         {
             throw not_yet_implemented("Waveform data (types 4 and 5) not supported");
diff -r 9821c483080e -r a0f0ac25b68c src/drivers/oci/Writer.cpp
--- a/src/drivers/oci/Writer.cpp	Thu Mar 17 13:26:18 2011 -0400
+++ b/src/drivers/oci/Writer.cpp	Thu Mar 17 14:00:17 2011 -0400
@@ -950,7 +950,7 @@
         {
             m_stage.seekToPoint(*it);
             
-            // FIXME: Use a user bounds here instead of reading everything
+            // FIXME: Use a user bounds here instead of reading everything  
             m_stage.read(buffer, libpc::Bounds<double>());
             
             block.copyPointsFast(static_cast<std::size_t>(count), static_cast<std::size_t>(0), buffer, 1); // put single point onto our block
diff -r 9821c483080e -r a0f0ac25b68c test/unit/CMakeLists.txt
--- a/test/unit/CMakeLists.txt	Thu Mar 17 13:26:18 2011 -0400
+++ b/test/unit/CMakeLists.txt	Thu Mar 17 14:00:17 2011 -0400
@@ -48,7 +48,7 @@
 if(WIN32)
     add_definitions("-DLIBPC_DLL_EXPORT=1")
   if (MSVC)
-    add_definitions("-DBOOST_TEST_DYN_LINK")
+    #add_definitions("-DBOOST_TEST_DYN_LINK")
   endif()
 else()
     if(Boost_PROGRAM_OPTIONS_LIBRARY MATCHES "\\.a$")
diff -r 9821c483080e -r a0f0ac25b68c test/unit/support.cpp
--- a/test/unit/support.cpp	Thu Mar 17 13:26:18 2011 -0400
+++ b/test/unit/support.cpp	Thu Mar 17 14:00:17 2011 -0400
@@ -88,7 +88,7 @@
     return true;
 }
 
-std::string TestConfig::g_data_path = "../test/data";
+std::string TestConfig::g_data_path = "../../test/data";
 
 TestConfig::TestConfig()
 {


More information about the Liblas-commits mailing list